In AS2 when I had a button on an external page swf that was loaded into the main website swf and I wanted that button to go back to the main website swf main time line and change to a specific frame I just used ...
Code: _root.gotoAndPlay("$/pmp/engine/"); ...in the button's release code. How do I do that in AS3? I guess I just need to know how to get to the main swf since root refers to the external page swf's main timeline. Garrr this is annoying. My structure is this:
main.swf's main time line has a button. Click that button, it loads preloaderpmp.swf into a blank movie frame with the instance name container. preloaderpmp.swf loads pmp.swf in. In pmp.swf's main timeline there is a movie clip inside a movie clip which contains a button that I want link back to main.swf and go to the frame "$/pmp/engine/" once it is released. What can I replace _root with since this is AS3?
In AS2 when I had a button on an external page swf that was loaded into the main website swf and I wanted that button to go back to the main website swf main time line and change to a specific frame I just used ...
Code: Select all_root.gotoAndPlay("contact")
...in the button's release code. How do I do that in AS3? I guess I just need to know how to get to the main swf since root refers to the external page swf's main timeline. Garrr this is annoying.
In AS2 when I had a button on an external page swf that was loaded into the main website swf and I wanted that button to go back to the main website swf main time line and change to a specific frame I just used ...
Code: _root.gotoAndPlay("$/pmp/engine/");
...in the button's release code. How do I do that in AS3? I guess I just need to know how to get to the main swf since root refers to the external page swf's main timeline. Garrr this is annoying. My structure is this:
main.swf's main time line has a button. Click that button, it loads preloaderpmp.swf into a blank movie frame with the instance name container. preloaderpmp.swf loads pmp.swf in. In pmp.swf's main timeline there is a movie clip inside a movie clip which contains a button that I want link back to main.swf and go to the frame "$/pmp/engine/" once it is released. What can I replace _root with since this is AS3? Here are some other attempts I have tried and failed to work right:
I have some submenu buttons in a movieclip on the mainline. My first level of navigation in on main timeline. The submenus are grouped in movieclips on the main timeline. I basically used the same code on the main navigation for the sub navigation except the code for the submenus is in that movie clip. My trace statement reads the button is clicked (which was a quantum leap for me) but I know I need some kind of _parent code in there so it knows to go to label back on main timeline.[code]...
If I have a movieclip loaded with Loader and I want it to call back down to the movie that loaded it how do i do that? Referencing a root object just gets me to the root of the child not to the main stage.
I'm re-writing a movie so that elements of it are modular movieclips, so that should I wish to re-use them, I can simply copy onto the root time-line. What should I watch out for regarding my paths in the modular clips? should I always ensure they are relative or absolute? How example should I reference mouse properties (e.g. _root._xmouse) which which will always be properties of the main movie root timeline?
If I have a movieclip on the main timeline, and a button in that movie clip. How would I go about getting it to advance the main timeline to its next frame? I understand that in AS3 movie clips are not connected to the timeline in the same way as they are in AS2 but I dont understand why the following works, or if there is a better way?
stop(); next_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1); function mouseDownHandler1(event:MouseEvent) { MovieClip(this.root).nextFrame(); }
i have 2 flash file,one is mine (the main container) and one is a external swf.i want to load the external swf to my container swf.i write this code in my as2 container code inside the main timeline flash (mine flash) -----first of all i add a movie clip with instance name mc1 to the first layer
i really try to use that code - BUT !!! -> if i use this code the external swf predominant my main swf code and all the rest of my code dosent work (like timer of trace)....
Why does FlexBuilder insist on a main class in the root of the source folder? By insist I mean that if I create an Actionscript project called MainTest. A file called MainTest.as will be placed in the root of the src folder. if I now create a package/folder called some/package and place the MainTest.as in it (and adjust the package statement accordingly), I cannot select the project to use this as the application class in Properties/Actionscript Applications as the package is empty as far as Flexbulider is concerned.
So there is a restriction that a main/application class cannot have a package other than the root package. The mxmlc compiler and FDT do not enforce this restriction so why does Flex Builder?
I have 2 flash files,one is mine (the main container) and one is a external swf.I want to load the external SWF to my container SWF.I write this code in my AS2 container, inside the main timeline flash (mine flash).In the first method, I add a movie clip with instance name mc1 to the first layer:
I really try to use that code - BUT !!! -> if I use this code the external SWF predominant, my main SWF code and all the rest of my code dosen't work (like the setInterval() timer).... I want to load the SWF like the second example and still run the setInterval() function.
I have a label on my root timeline called "services". I have a services button inside a movie clip. How do I access the main time line to send it over to the page services? I'm using actionscript 3. Back in the day it would have been as simple as root.gotoandplay("services")
I recently started creating a flash website from a template that was created back in 2004. I have very little knowledge of either AS 2.0 or AS 3.0. I am currently attempting to link my buttons that are in separate movieclips back to specific parts of the main timeline "scene 1". Currently when clicked, the buttons just cycle through the varying pages that have been created, "s1" , "s2" etc.
How do I link a movieclip/button back to "s8" in the main timeline?The AS 2.0(I think it's AS 2.0 anyway) that currently exists is as follows:
PHP Code:
on (rollOver) { gotoAndPlay(2); }
[code]....
I understand what first rollOver and rollOut commands are and they work fine, but the "On (release)" doesn't seem to go where it needs to.
I have a main swf file called index.swf and 3 games files called game1.swf game2.swf and game3.swf respectively.The main.swf is done is AS2 while the games are in AS3.I have 3 buttons on the main.swf,each will load the game out on a new layer...this is the code I used... btn1.onRelease = function(){
it didn't work. Apparently this code doesn't function in AS3.All the games are in a subcontent folder.Index file will call them out on a new layer...and the back button in those games must be able to go back to the index.swf.
i have a button and i would like to send the user back to the main timeline once click using on (release) does anyone know what code it is to send it back to the main timeline?
I have a main swf file called index.swf and 3 games files called game1.swf game2.swf and game3.swf respectively.The main.swf is done is AS2 while the games are in AS3.I have 3 buttons on the main.swf,each will load the game out on a new layer... this is the code I used...
it didn't work. Apparently this code doesn't function in AS3.Index file will call them out on a new layer..and the back button in those games must be able to go back to the index.swf.
I designed a website using tips from [URL]. It's a single .swf. Nothing complicated about the as3 script. Mostly gotoAndStop commands to jump around the timeline to the different sections of the site. My question is how to set up the site as individual swfs for each "page" so the back and forward buttons on an internet browser will function. I've seen samples of loading external swfs but it's not clear how to write scripts to jump around various pages for a website. Here's the website: [URL]
I'm looking to slideshow or flash my magazine front and back cover and some interior pages on my website. So they will show the different pages back and forth.
I have a project I'm working on where the user is presented with an overhead shot of a building and is able to mouse-over the different rooms to choose one to "enter." Once clicked, the chosen room is an external .SWF that is loaded that has options to view other external .SWFs within that room. Problem is, within the first loaded .SWF, I have a "home" button that is supposed to take the viewer back to the main overhead view but I can't get the AS to work. I've tried _parent and _root with no luck (not sure I even typed out right code).
I'm working on a little project where I have a list of working text I converted to buttons and scituated vertically along the left hand side of the stage. Each button when pressed, triggers a different image with some text. This all works great. The problem is that I have a "Back to Main Menu" button located at teh bottom center of the stage. When depressed, I want this button to clear out the image and text on the stage and leave the user looking at just the original list of buttons along the left hand side of the stage.
I can easily get the main menu button to do this for my first image and text. Here's the code for that:
gbtext_btn.addEventListener(MouseEvent.CLICK, playGearbox); menu_btn.addEventListener(MouseEvent.CLICK, stopGearbox); function playGearbox(event:MouseEvent):void { gearbox_mc.visible = true;
I have created a spark titlewindow (using mxml component) which there I select some stuff and want it to get back to the Main application variables.For example, in the main application I have a var name currMaxPlayers:int and in the TitleWindows I have created a form which you can choose number of players, when selecting the number and then pressing submit button, I want the number that was selected to get back into the currMaxPlayers var in the MainApplication.I have followed the instructions here url... with no success.
Lets say i have a button on the first frame of my main timeline that leads to another frame on my main timeline. On the second frame, i have a button that has tweening animations inside it's over and down states. At the last frame of the tweening, i want to have a button that navigates to the first frame of the main timeline, and not the first frame of the tweening.
When the playhead is sent from the main timeline (Scene 1) to play a movieClip timeline, what code is used to send the playhead back to the main timeline (Scene 1) after the movieClip has played?
Is it possible to make the flash content go back to some previous frame when the user clicks on the back button in the browser? Similarly, can the the refresh button be used to refresh to the same frame and not go back to the starting frame?
I have a movie created that is broken down into sections on the timeline (home about contact etc) Each section has a movieclip I want to be able to be in the about movieclip and click a button that will bring you back to the main timeline contact section Heres is the actionscript I am using to navigate the main timeline for each section stop();
//handle events for buttons... index.addEventListener(MouseEvent.CLICK, clickSection); about.addEventListener(MouseEvent.CLICK, clickSection); wind.addEventListener(MouseEvent.CLICK, clickSection);
I have a btn within a Movieclip at a certain keyframe the user is asked if they want to go back to make another selection from a choice category (within the maintimeline)
As of now the code I have for the btn that jumps you back to the main timeline is: