ActionScript 2.0 :: Loaded Swf Controlling Main Swf?
Oct 25, 2005
is it possible for a loaded swf to control the timeline of the main swf or even to tell the main swf to unload the loaded swf just by pressing a button in the loaded swf.
I have a simple swf called site.swf that loads a menu with UILoader called menu.swf, from menu I'm able to navigateToURL but I also need that it goes to frame 50 in menu.swf.
So basically I have two swfs, main.swf and level.swf.. main.swf simply has two frames, first one has the code below to load level.swf and the second frame has some text in it, it's labelled "theend".
Code: var request:URLRequest = new URLRequest("level.swf"); var loader:Loader = new Loader() loader.load(request); addChild(loader);
level.swf is more complicated, it's a little game and blah blah, but the thing is that I have a button (cnt_btn) in the last frame. I'd like this button to go to the second frame ("theend") of the main timeline.
I am building a website in as3. As of now this is what I have. My main file has a button on it and builds a movieclip to hold loaded movieclips.
The file runs and loads about.swf into the main file. When the button is pressed it tells about.swf to play the exit animation.
All of that is working. What I want to happen now is once the exit animation finishes I want the about.swf file to tell the main timeline to load a new movie.
I can control loaded movieclips from the main timeline I just do not know how to control the main timeline from loaded movieclips.
My main flash file is setup with a scroll pane component. The scroll pane is loading an external swf. This external swf has a button that when pressed I want to load another external swf into the scroll pane in the main flash file. How do I make the button functional? Is it using sprites? If so, could someone direct me to a tutorial?
I'm having a bit of time getting this to work. Setup like this: Main mov: Nav1 is clicked and loads in external swf. In the swf that was just loaded there is button to call another external swf on the main movie's timeline. I'm trying make a "lightbox" effect. Where you click on the external swf and the screen darkens and a swf is loaded on top of it. Above the loaded swf. Of course on a new layer.
PHP Code: This is handling the swfs that get loaded in EXTERNAL SWF LOADER _root.page_mc.preloader_mc._visible = false; _root.page_mc.preloaderText_txt._visible = false; var mcLoader:MovieClipLoader = new MovieClipLoader(); var myListener:Object = new Object(); mcLoader.addListener(myListener); [Code] .....
At the moment I am working on a flash website. There is a main swf with the menu, which loads external swfs as subpages. These external swfs contain some html text. Now I want to have a link inside this html text to another subpage.
[Code]....
But this doesn´t work. It seems "page_2" or "page_3" gets never dispatched.
this ex. .fla controls the mc from itself but i would like to control it from the main timeline, ive tried a number of things but cant seam to get it to workthe .fla is here.and the code is here if you dont dl the .fla:
I have a main.swf which plays, then stops, loads a dynamic .swf... And what I want is, from either the dynamic .swf or the main one, when the dynamic .swf is finished, the main .swf will continue/play.
which work perfectly fine. Now due some reason i had to place the navigation bar in the external movie clip , in external.swf Using the same script how can i control the textBox animation which is on the main.swf??
How would one on a specific frame inside a movie clip cause the main timeline to go to a certain frame label?
I know how to use gotoandstop(), but i can't seem to find a working, correct syntax variable that accesses the main timeline and not the movie clip's timeline.
I'm in the process of designing this site as a portfolio for my art and am in the process of creating and laying out the galleries. My idea was to create movie clip animated buttons that would react to the roll over stuff. I got that part to work the way I wanted it. But now, I can't seem to figure out how to put a "Gotoandplay" type of code on the buttons so that the timeline would jump to the appropriate frame and play. (I put an "on(release) gotoandplay" on it the way I would put it on a button but it never responds. I have a couple of buttons that work fine with a "geturl". so I thought a "gotoandplay" would work fine. If this can be figured out in a way that I can easily use it for all buttons with just the frame number needing alteration, that would be best. After you click the splashpage door jpg, there will be a piece of paper on the floor. That is a button which should trigger the animation that starts at frame 114. When clicked, the page lifts up and spread open to two pages. But it never reacts
This code is currently contained within my "mc_1" movieclip. I want to be able to have this code on my main timeline, however no matter what I try I constantly get errors, multiple different versions. I've tried adding mc_1 infront of everything, but that just gives an output error about a Sprite.Also, I'm currently using visible to control whether the back image to the textbox should show - What I'd really like to do is control it using a child, but they're movieclips not buttons, so when I try to addChild within the function it errors saying I'm trying to control a movieclip within a simplebutton function.
i've made a drop down menu that works fine as it goes for dropping down when moused over the button which triggers is menu. but when im trying to add functionality which is triggered by the nested buttons that drop down i cant control the frame position of the main timeline does anyone know how i can do this.
Am gonna create an encyclopedia program, consist many of Chapter. I have difficulties about **controlling external swf inside my Main swf**. This is my Main.as in Actionscript 3
Code: public class utama extends MovieClip { var loader:Loader;
Am gonna create an encyclopedia program, consist many of Chapter. I have difficulties about controlling external swf inside my Main swf. This is my Main.as in Actionscript 3
public class utama extends MovieClip { var loader:Loader; var urlReq:URLRequest;[code]........
Am using eksternal page as a Chapter, and A Chapter consist of many Pages (it using Scene) For an example :
Chapter 1 --> Page 1 it will be represented as hal1.swf-->Scene 1 Chapter 1 --> Page 2 it will be represented as hal1.swf-->Scene 2
Ive been having problems getting buttons within a movie clip to control the main timeline and switch scenes. Ive tried everything from _root.gotoAndPlay to with(_parent) and such.
So I have been trying to figure out a way to control multiple clips using the same "on press" & "on release" statements located on 1st frame of main timeline. A variable is being set to a value that correlates to the name of each movie clip as an interaction occurs.Ex: user clicks from a selection of buttons & depending on the button clicked it sets clipNum = "1" through "21".What I want is to have something like the following code that will give the user the ability to click and drag the clip with code on the main timeline similar to the following:
I'm loading a SWF into a main SWF using the code bellow, from senocular tutorials:
Code: var request:URLRequest = new URLRequest("home.swf"); var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
[code]....
I have buttons inside a movie clip, at the main movie (parent) and I want to control the home.swf movie that I just loaded. How can I do that?I'm trying this, without any result:
Code: function botao_clique(e:MouseEvent):void{ MovieClip(root).window_mc.textos_mc.gotoAndStop(2); }
I have several flash swf's that are about 10 - 20 min. each. I load these in a player that I have created as the user selects them from a menu in the main swf (a swf player basically). I can pause start and stop the swf's with no problem, but I can't seem to get a handle on controlling the audio. I have the audio in the loaded swf's timelines because I need to sync the audio with the animation taking place in those swfs. I could, take the audio out of the timeline (after syncing it), and then load it separately, but it would be much cleaner for me to just have it in the timeline.
I've resorted to the SoundMixer of the main swf to mute and change the volume, but I can't get hold of the Sound(), soundTransforms etc. of the loaded swf. To assign a play location for the soundChannel I need to access the loaded swf's Sound().Play() function, but I can't seem to do that. I have exported the timeline audio in it's actionscript, supplied a name (same as it's class name), and then tried to access it, but I can't seem to do it (yes I wrap the loaded.content variable in a MovieClip cast--that's how I can control the pause and play of the animation). Tutorials I have found only seem to work with sounds loaded into variables, and none refer accessing timeline sounds in a loaded swf.
I'm loading assets from a swc and I need to loop through every frame of the movieclip and find a certain instance so I can colorize it. Is this possible? It seems that with a swc I loose the ability to control the movieclips playback. It just plays and repeats no matter what I do.
the .FLA files are attached at the bottom. intro.swf is the actual movie and introLoader.swf is the preloader and it loads intro.swf into it.the problem with the actionscript previously was that itd start playing the external movie halfway through the preloader bar as if it was streaming..however i found a workaround that doesnt really work.. i used xyz.stop(); and xyz.play(); functions to control when the external movie plays.The problem with those functions is that i need a check for them i.e if(percentage <100) etc. which causes problems like if the flash movie is already watched once and cached and you reload the page it wont play.
I have a button on my main scene which creates the varaiable "soundoff", then if one of the placed swf's when loaded detect the variable it stops all sounds,
if(soundoff == true){ stopAllSounds();
This works fine but does not target sounds placed in movieclips in the loaded swf's timeline. I've tried targeting them with the _root. command and using linkage but I can only stop the sound in the main timeline level.
Is it possible to control one loaded SWF File e.g.,(MOVIE-1.swf) from another loaded SWF file e.g., (MOVIE-0.swf) on a different level? E.g. with a syntax like: onRelease _MOVIE-1.SWF.gotoAndStop (4) or: onRelease gotoAndStop (MOVIE-1.swf, frame4)
I am loading a .swf that a previous developer made (don't have the .fla) but the actionscript at the end of the movie is resolving to home.html. Instead of it resolving to home.html I would like for it to instead have gotoandPlay.
i had made a image gallery using xml in flash MX 2004. some of the images are jpgs and some are swfs. i'm trying to get it so that once the external file, be it jpg or swf, is loaded, it would recenter itself in the middle of the page.so i attached the following code to the container clip that the files were loaded into:
I'm creating a flash site, navigation is simple, or so I thought. Buttons along the top load external swf's to the stage. As they are loaded and unloaded the swf's animate in and out again on button clicks so the next one can come in.
I have suceeded in controlling the loaded swf's to get them to animate onto the stage, but what I have added to animate them off again does not work. I don't even get error messages, it is just ignored.
I have indicated below what I have added to try and 'animate out'
Actionscript:
stop(); //////// HOMEPAGE CONTENT LOADS ON PAGELOAD /////////// addChild(loader); var swfloader:URLRequest=new URLRequest('contentboxhome.swf');
[Code].....
This is a sample of two of the 5 buttons, I have tried using both the 'if' function on all buttons and the 'event complete' function on all of them, and both are just ignored. No error messages, no unusual occurrences at all. The code is just skipped over and the swf I have requested to load, just animates in and replaces the one there currently. Only funny thing is that, despite the 'loader.unload();' being WITHIN the 'complete' function, it still seems to be fired. The swf's never overlap each other.