wherever I look for scripts is either AS 1.0 or 3.0... I used to work as a cartoon animator (didn't need AS at all) now I'm trying to build up my own site to show my portfolio. I'm having difficulties loading and unloading external swf files. Basically I'm a total newbie, I managed to figure out that you need an empty movie clip where it will be played, and the buttons themselves...
I spent almost a week trying to figure out how to unload a currently loaded swf using its button and loading a new swf... I have three files, a main.fla, file1.fla and file2.fla. In my main.fla, I have a code which loads the other two files. If i will click the "unload" button in the file1.swf, I would like the main.fla to unload the file1.swf and load the other file, file2.swf. Here is the code to load the file1.swf:
From my main file I'm loading an external swf file. This file overlaps the original file so I began looking for a way to unload the original file. I've not been too successful. Right now, I've created a background layer which allows the loaded file to cover the original file without bleed through. I'd rather have the original file unload before the newly called file is loaded.
Here's the code I've found so far: //Declare Variablesvar Xpos = 0; var Ypos = 0; var loader:Loader = new Loader(); var swfFileToLoad:URLRequest = new URLRequest("holdHumans.swf"); //Go to CreationremoveChild(loader); loader.load(swfFileToLoad); loader.x = Xpos; loader.y = Ypos;addChild(loader);
This code is normally associated with a button event but I have to be able to use it from within a timer function in the original file. When the function is called, I get this message: Error #2025: The supplied DisplayObject must be a child of the caller. I get this message too when I try using it from the externally loaded swf file.
At the moment, the Main.swf loads perfectly and works fine. But when I click the gallery button, it jumps to frame 76, and plays the Main.swf. It doesn't load the ZenGalleryDemo.swf file.....
I am trying to load external swf files for each page of my website. I load the home right off the bat, then when I click on a different page, the content only loads on top of the previous loaded swf without getting rid of the previous page. I could be doing it wrong, but I use unload and removeChild before reloading the new page in the button function and it still stays on the stage.I could go back into my external swf files and add a white background underneath the content in order to mask out the swf that stays behind. But even if I do that it still would be loading multiple copies of each swf gradually slowing the whole site down.
So I posted a few days ago about having problems unloadins SWFs. Pretty much I load one for each page in my website into a content_mc. When you click back and forth between the pages, the previous page doesn't disappear, but just gets pushed behind the new page. I've tried unload and remove child and nothing happens. The goal would be able to unload the previous page and load the new page to replace the old one.
when u go to the index page or index.swf i guess, after hitting the enter button id like it to go to the homepage.swf but the problems im running into are
1.the new homepage.swf will load over the index.swf after pressing enter button on index.swf which is set up through the .fla
2. movie wont load
am i not setting the target properly or? no target? or am i not using the loadMovie("example.swf"); action script properly
in short im just trying to get it to work like an html page, click one link, takes you to that page, click another link, and it takes you to a different part of the page.
I have created a site using the most basic amount of AS possible because i am new to it and am just finding my feet, i thought i might be able to get away with using just button links and slideshows but now my site is getting very big and is taking a while to load, i have added a preloader to the beginning of the site in a different scene.On my second frame i have a external .SWF file being loaded, it loads just fine but when i navigate away from the frame it is still there on every frame.
here is my code for the frame;
////// var SlideshowURL:URLRequest = new URLRequest("Slideshow.swf"); var SlideshowLoader:Loader = new Loader(); SlideshowLoader.load(SlideshowURL);
I am able to successfully load two of the swf game files (Shooting.swf and Butterfly.swf). I will be playing this game swf in full screen mode. As in it will Occupy the entire area. I want this swf file to be unloaded upon clicking "homeShoot" which is in the library. Thus, when loading the swf files, at the same time I will addChild this button "homeShoot" from the library. So that when I press this "homeShoot" it will unload the swf file. But i am having problem with this part. The following is my code.
ActionScript Code: var Xpos:Number = 0; var Ypos:Number = 0; var swf:MovieClip; var loaderShoot:Loader = new Loader(); var loaderButterfly:Loader = new Loader(); [Code] .....
I used to do this fine with AS2 and now i'm struggling to get it to work in AS3.my code is as follows:
PW1.addEventListener( MouseEvent.CLICK,loader1 ); //==================== PS function ============================================= var ldr:Loader = new Loader();
I'm trying to load an external swf and unload it after its completion. I have tried a few things and am stuck. Here is my current code to loading the swf, which seems to be working fine, its the unload I cant get:
I have a external swf that has an embedded video that loads automatically. Once it loads I have a button that unloads it and reloads. The first time I unload it, it works fine. The second time the video unloads but the sound continues? This happens each time I load and unload; the sound continues to loop.
stage.scaleMode = "noScale"; var loader:Loader = new Loader(); var defaultSWF:URLRequest = new URLRequest("swfs1/ME_video1a1.swf");
I am slowly learning AS3 but have hit a bit of a brick wall though I am sure it is something that many will see as easily resolvable, just my lack of knowledge and understanding of AS3 at this moment.
My query is I am trying to create a SWF which loads in (3) external SWF's using three movieclips I have within the main SWF. I have managed to get the external SWF's (1.swf, 2.swf, 3.swf) to load in when each of the movieclips / AS3 buttons have been clicked but I cannot figure out how to unload the current selected SWF file (e.g. have initially click on btnOne which displays 1.swf yet when click on btnThree to display 3.swf, 1.swf has not been removed from the stage and overlaps 3.swf) when I want to load another SWF file (sorry if this does not make sense). Below is the test code I have tried:
My question is how do I unload (or removeChild I guess) the current SWF from the stage when I click on another movieclip / AS3 button to load another external SWF without the mish-mash as can be seen in the uploaded test files?
Anyways i have a series of buttons, and I would like them to each load a external SWF file into a movieclip. I have accomplished this so far but, I would like it so that whenever I click a button it unloads any already loaded SWF file that is already there. This is what I Have So far
on (release) { loadMovie("movie.swf", this.movieholder); }
I am studying AS3 by myself, It's all about loading and unloading external swf's. My code is working perfectly though I just have some questions about load and unload issues. I have three buttons on the stage and it should load its external SWF
[Code]...
Each of the button should load it's external SWF's intro when click. My problem is that I don't know how to command the button to play the swf's outro and then load the next swf everytime I click a button Example: When I click homeButton_btn, the external swf should load "home.swf" and then if I am going to click page1Button_btn, the outro of "home.swf' should play and then once it reaches the end of it's timeline, it should load "page1.swf". Same goes with page2Button_btn, whatever swf that is on the stage should play it's outro first and then load "page2.swf" My questions are:
1. How can I control the external SWF to play it's outro and then load the next SWF.
2. What code should I put at the end of the external SWF's timeline.
3. Where do you think I should put the preloader? Is it better to put it at the external swf timeline? or on my main swf timeline?
4. Does load and unload of external swf also work with movieclips? Like for example I will not use a external swfs, instead I will use movieclips to load and unload its content.My Actionscript 3.0 code
I have a question, I'm new so i dont know much ^_^ I am Using Flash MX ActionScript. Anyways i have a series of buttons, and I would like them to each load a external SWF file into a movieclip. I have accomplished this so far but, I would like it so that whenever I click a button it unloads any already loaded SWF file that is already there. This is what I Have So far
I have a question regarding the swapping out of swf files in Flash CS3 / AS3.I start my project with a �logo� swf, which has no interactivity.At the last frame, the following code is used to load another swf from the local folder:
------------------------------------------- //Stop current swf and stop its sound stop(); SoundMixer.stopAll();
[code]...
How do I remove and/or unload the previous swf when a new one is loaded? and remove that previous swf from memory? Can I give the current swf access to the previous one, then run a �remove� or �unload� function on it?
After years of putting it off, I've finally begun the move to AS3.The frustration I've encountered is evidently shared by a lot of other designer/developers. Knowing that the future is inevitable, I have bitten the bullet and forged ahead. There has been one thing, however, that has just been a real quandry and has cost me hours of banging my head against the wall.That would be getting an externally loaded swf to (really) unload in an AS3 file.Before I even begin to post code, let me just say that I've tried a lot of things read in books, posts from this and other forums, and trial and error to no real avail. In my research I've come across many others who are experiencing the same problem and even one reference that suggests you not use AS3.For a project that uses multiple loads and unloads that's due in a month, should I just go with AS2?I'm using CS4 on a PC publishing to Flash player 10. And yes I have tried "unloadAndStop()" and "removeChild()".
I have 7 buttons on my main page, on the left side of the screen. I want the buttons to load the external swf on the right, and then unload when a different button is pressed. Do I need to make an array? Do I need an empty movie clip to load each swf into?
ive been trying to load 3 games(swf's) into a main swf and ive had nothing but problems.
what im trying to do is have three buttons on the main swf, each one loading a different game. im having no problems getting the game loaded into the swf its unloading it and getting back to the first frame of the MAIN TIMELINE, or MAIN SWF.
ive tried loading the swf's into a movie clip and ive tried loading them in there own frame BUT nothing is working and it is SO FRUSTRATING
Is there a way to load an external swf onto, say, frame 7, and unload the sucker on say, frame, 12? Just wisk it away to neverneverland when the playhead hits the right frame/s? Is there a way to change it's visibility in this way also?
I am making a website that will have many levels of externally loaded swfs.
1. How do you load and unload the externally called swfs with either an animation within the swf movie, or through the AS when you call it.
2. I will have my navigation loaded on a top level and everything else loaded below. When I click on another Button from my navigation that will load another swf movie- How do I unload the swf that is previously there?
how to load external SWFs into an empty movieclip, and then having them unload when another is selected. At the moment, all I can do is load the swf onto the stage with no positioning, and clicking the other button just loads the next swf on top.
Actionscript Code: stop();standard_btn.addEventListener(MouseEvent.CLICK, onLoadClick);function onLoadClick(evt:MouseEvent):void{ var loader:Loader = new Loader();
Working on a project that has a main stage and loads/unloads external swfs into it. Most of these external swfs also contain FLVs (that are also loaded externally via FLVPlayback). Basically the user clicks on a button in the navigation and it should unload the swf and FLV that is currently playing and then load the new one. Then after the the FLV and swf play theres a "close" button that they can click to go back to the "home" swf which would be hidden underneath. I got it to work to an extent - but the FLV (even though not visually there) still has its audio playing in the background..
I have gotten my movies to play at random from external files but the links that where coded into the random swf files no longer work. could there be an action script issue? The random swf files are as3 and the player file is as2????
I am creating an interactive slideshow, like a PowerPoint effect, I have a main scene, 4 Buttons, a Home Button, Play Button, Forward Button & Back Button. I want the Home Button to take me back to the start of the scene, Forward Button to Load a External swf slide and when the Forward Button is clicked again to Unload External swf and load in the next swf slide, I also want the Back Button to do a similar thing!
Im creating a flash projector which has a holder swf with an empty movieclip. A series of external SWFs are loaded into the empty movieclip on the push of a button. Once the clip has been loaded, other external SWFs can be replaced in the empty movieclip at the push of a button. As memory leaks and garbage collection seem to be an issue, I was wondering the most memory efficient way of loading, unloading and replacing these external swfs so that memory leaks are kept to an absolute minimum.
I am creating an interactive slideshow, like a PowerPoint effect, I have a main scene, 4 Buttons, a Home Button, Play Button, Forward Button & Back Button.I want the Home Button to take me back to the start of the scene, Forward Button to Load a External swf slide and when the Forward Button is clicked again to Unload External swf and load in the next swf slide, I also want the Back Button to do a similar thing!I keep getting External Swf pile-ups or flickering
Here's my code: [CODE] Play_button1.addEventListener(MouseEvent.CLICK, Play_btn1);
I am working on a few websites at the moment, one of the being my online portfolio, as well as my website for a sleep product I am trying to sell. I have very little experience with AS3, last time I created a website AS2 was used. I've tried a few online tutorials, but nothing gets the job done, there is always some error..I have a index.swf which loads the default home.swf.There is also an about.swf, contact.swf, order.swf, and All I need is for the external swf to pull up when the corresponding button is clicked, and when the next button is clicked, for the current swf to unload and the new swf to load. This was so simple with AS2, one would think things might be as simple if not easier.