ActionScript 2.0 :: Call Main Swf From External Swf's Timeline?
Apr 17, 2008
I've got a movie with a few buttons in it. When you click on one of the buttons an external swf opens. At the same time a large, quare, white movieclip opens at the back of the external swf (the white mc is in the main movie). Okay, so for so good.
In the external swf there is a close button. When you click the button, the external swf goes to frame 14 to show a short closing animation. The last frame contains the following code:
I have 2 buttons in my main movieclip, one called "projects by client" and the other "projects by category".I have an external projects.swf which has 2 functions CLIENTS_CLICK and CATEGORIES_CLICK. The code is in the first frame of the projects.fla actions layer and not in a class.
I am curious if there is a way to call back to the main timeline using AS3 after a video clip or audio clip that is being loaded externally, is done playing? For instance: you get to a page with a video on it, but when the video is done playing, instead of just sitting there, it automatically takes you to a new page (framelabel).
I want to call on a button instance that lives two levels up in a movie clip. So, the mc lives here: Scene 1 > startMc > navMC (the navMC contains all the buttons) I thought "page1_btn.child.child.addEventListener(MouseEvent.CLICK, page1content);" would work but doesn't seem to do it. The code on main timeline is:
how to create .as file and how to link it with flash? another question is can anyone teach me on how to create main timeline and also how to call movieclips from the main timeline?
I have a function within another function. Is it possible to call the function inside the function from the main timeline. See example code. I want to call the function called sub from outside off the function called main.
Code: function main():void{ // Do something function sub():void{ //do something }}
I have a main time line and a button defined. Can I define functions in actionscript anywhere and call them from anywhere? For example, if I call a function in main timeline and it's defined in the button, does that work?
How do you call a function on the main timeline from a an onRealease in a nested mc?I have created a function that resides on the main timline, and when a button is released I want to call it, but the button is nested in a movie clip.
I am working on AS3 and I have a created a button class which have an off state and on state. I did the class and it works fine, but i need a little fine tuning. Right now I am polling the button state from the root(main timeline) by checking a boolean property in the button class. I feel it is quite inefficient to check the button state on every enterFrame event of the main timeline. Rather I would prefer the button to tell the root time line by invoking a function written in the root, whenever a state change occurs. t should be cleaner , right?? But when I try to access a function in the root which goes like this
I'm having a bit of a hard time with calling a function in the main timeline through a button in a movieclip. The mc is in the main timeline and in it I added a button with this.removeMovieClip(); and so far it works, but when I try to call a function from the main timeline it just doesn't seem to work.
On the main timeline I have a movie clip called clock_mc and playBtn playBtn is placed in the center of clock_mc When you press playBtn clock_mc starts playing
playBtn.addEventListener(MouseEvent.CLICK, playClock); function playClock(event:MouseEvent):void { if (event.target == playBtn)
[Code].....
I've tryed to placed the replayBtn on the stage on the main timeline and I've set it up to replayBtn.visible = false; And then I add replayBtn.visible = true; to last AS frame of clock_mc but it wont work Even when I put the button physically to the last frame of clock_mc it will not work either.
It's at the back of my head somewhere, but I can't figure it out.I have a dropdown menu movie clip I need to make _visible = false, but calling
PHP Code:
_root.dropdown._visible = false
from the external swf doesn't reach the main swf. How do I communicate commands from an externally loaded swf to the main swf? I tried _root and _level0 to no avail.
I have been going crazy all weekend trying to figure this out. All I want to do is communicate with the main timeline from a loaded external swf. So, I have loaded a external swf called "test.swf" from the main swf called "basetest.swf"So, on basetest.swf I have this code, simply loading test.swf:
var request2:URLRequest = new URLRequest("test.swf"); var loader:Loader = new Loader() loader.load(request2);
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] .....
I'm definitely more designer than flash developer (as most of you might know. At least those that hang in the lounge or Arena). I need to know how to allow a loaded .swf file to control the main timeline in AS3.
I have a container .swf that includes global controls (jump menu/volume control) and branding. Loading a swf for the dialogue boxes (timeline animated ... although I realize there may be better ways to handle it). Another swf for a simcity-ish illustration that has animated elements with various states. I need all to be able to communicate with each other. I was able to load the movies no problem. Even communicate with the loaded ones from the main timeline. Just need to be able to go the other way.
I apologise because I know this has been covered but none of the code I've found seems to have sorted my problem.On my main timeline (_level0 right?) I have the following code:
var loader:MovieClipLoader = new MovieClipLoader(); this.createEmptyMovieClip("container2",2); container2._x=28
keyframe one - dialogue / conversation with characters ( then a button is triggered to call an external swf [placed at keyframe two] )keyframe two - the external swf game. i want to put a button that makes you go back to the main timeline once you're done with the game and proceed to keyframe three (that's the problem. i dont know how to declare and make that button work)keyframe three - dialogue / conversation again .
keyframeone [main timeline]
Code: ... memory_t.addEventListener(MouseEvent.CLICK, recalltraining) function recalltraining(e:MouseEvent):void{ gotoAndStop(2)
I have a external SWF loading into a target on my main swf. Is there a way to control the timeline from the loaded movie from the main timeline. So , control B timeline from A. I've tried mcholder.gotoAndPlay (2); but it won't work. Also, how can I get the mumbers of frames from the external swf into the main timeline. Will a global variable work?
im trying to tell my main movie to goto a certain movieclip in the timeline from my loaded external swf heres the code Im working with,[code]I can tell the script is executing because the external movieclip unloads itself but the main movie does nothing.
when my main app is a MovieClip (extends MovieClip) is working.but my main app is a sprite i take this message cannot convert ROOT@16b26df1 to flash.display.MovieClip.can i change this line
MovieClip(this.parent.parent).traceMe();
to something like this Sprite(this.parent.parent).traceMe();
I'm loading from my main page an external js file, with a function.
I have a flash file in the main page invoking the javascript function.
Everything worked very well until when the javascript code was in the main file, but when I moved javascript to an external file the function seems not called anymore.
So... there is no way to move the javascript code to an external file ? Or any other solution ?
I'm having issues with an animation and need to get it functioning properly. I've posted two example/demo files to illustrate desired functionality.The main timeline (testMain.swf) consists of a loader, section/slide one content, and a button (bttnClick) set to load an external swf (external.swf).
external.swf contains two additional sections/slides and two 'next' buttons (bttnEnter with 'bNextOne' & 'bNextTwo' instance names) to navigate. When the second 'next' button (bNextTwo) is clicked I need the loaded external swf to fade out revealing the original main timeline (testMain.swf) and returning/stopping playhead at the 'slideOne' frame label. Does the external swf need to be unloaded even though users will most likely go back to it? What�s the best way to handle this?
If you could assist with the external swf fadeout to main timeline, the return to 'slideOne' frame label, and insight as far as the best way to return to the external swf.