473,767 Members | 8,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Load a swf with movieClipLoader from the click of a button

37 New Member
Hi

I am trying to load a swf file using the MovieClip loader object.

var myMCL:MovieClip Loader = new MovieClipLoader ();
var myListener:Obje ct = new Object();
myMCL.addListen er(myListener);

At the moment I have the swf loading as soon as a frame is entered on the timeline.

this.button1.on Press = function() {
gotoAndStop("fr amex");
}

Code on frame

myMCL.loadClip( "my.swf", 50);

Is there a way to load the swf as soon as the button is clicked.

Something like


button1.onRelea se = function() {
myMCL.loadClip( "my.swf", 50);
}

Any help would be welcome!
Apr 26 '08 #1
2 4565
Max58kl
37 New Member
Hi

I seem to have solved the problem using the following code -


imgBtn.onReleas e = function()
{
_root.createEmp tyMovieClip("ho lder", 1)
loadMovie("main .swf", "holder");
_root.holder._x scale; //width scale
_root.holder._y scale; //height scale
}

If you want to load a jpg instead of a swf just change main.swf to main.jpg.
You can also specify the hight and width of the file you are loading using -


_root.holder._x scale = 225; //width scale
_root.holder._y scale = 175; //height scale
Apr 28 '08 #2
kelleyg
4 New Member
I use a master SWF called Index, with a main bar of buttons; each button opens a SWF from the assets folder -

For a button called genInfoBtn which, when clicked will open introduction.sw f, I wrote this:

//this will load external SWFs
on (release) {
stop();
stopAllSounds() ;
_root.myMCL.loa dClip("assets/swfs/introduction.sw f", 5);
}
Jun 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6875
by: brianbender | last post by:
I am trying to load and unload assemblies dynamically and call methods and properties when loaded into an Appdomain I can load assemblies all day in the current AppDomain without references and without interfaces if need be. But try as I may they will ot unload. I have been working on this problem for weeks. I have seen other apps using Remoting but I know there has got to be a way to create a child AppDomain and reference obkect via...
1
2466
by: Jeffrey Kelso | last post by:
I am having an issue where doing a PostBack in ASP.NET is losing the form information. This is happening in a NLB environment with two servers using Application Center When a user selects an item from a DropDownList and then clicks a submit button, the Click event on the button redirects them to the value of the selected item. This works fine if you are on Webserver1 and the button click PostBacks to Webserver1. If you are on...
2
3418
by: Samy | last post by:
Hi There, I have a user control with buttons on it which I use on a aspx page (parent page). On a button click, a modal dialog(aspx page) opens up and the user enters some info in the modal dialog and clicks the save button on it. The info is saved to the DB and the parent page is refreshed. Everything works fine but for some reason the page load is called twice. I have set the AutoEventWireUp = false on every page. Also I have load event...
3
2215
by: Colazz | last post by:
var myMCL:MovieClipLoader = new MovieClipLoader(); myMCL.loadClip("apin.jpg", "container"); //container is an instance of a movie clip. Now, the size of "apin.jpg" is too large.. is there any code that i can use to make the pics displayed in certain fixed size ? thx before
2
2270
by: Martin84 | last post by:
Hi, ive managed to import files into a main fla document using a moviecliploader command. The code tracks the percentage of the file downloaded so far and shows this information in a preloader bar. The problem is whenever I import a swf file it tries to play before it is 100% loaded. To counter this I added some more code to solve this (see bold text). The code is supposed to hide the swf file until it is 100% loaded then show and play it. The...
3
21170
by: GauravGupta | last post by:
i want to know that is it posible to call button click event before page load event on post back.... please help me....
2
3118
by: GauravGupta | last post by:
i am displaying a table in page load whose data is fetched from database . it also check what data is to be displayed from data base by a session variable. and i have few button which change the session variable value. when i click on some button page load is called before button click event, so data which is displayed is according to previous session not the session changed by button click.
0
2280
by: chromis | last post by:
Hi, I am trying to get my flash file to load xml data correctly, when i load loader.swf in the browser directly my xml is loaded and the movie functions correctly. However when i embed and load the loader.swf from the index.html file, my xml is not loaded. I have four files- /test/index.html /flash/loader.swf /flash/house.swf
1
3648
anfetienne
by: anfetienne | last post by:
i have this code below that i made....it loads vars from txt file splits it then puts it into an array....once in an array it the brings the pics in from the array to create thumbnails and a larger image. my problem is i have captions to go with it and when i try to load the captions nothing happens or can be seen to be happening. i dont know where i am going wrong as i have no output or compiled errors var locVar = new Array();...
0
9575
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9960
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8840
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6656
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3931
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.