ActionScript 3.0 :: From Root Load Frame Label In Mc?
Jun 15, 2010From root I want to load frame labels in a movie clip called mySampleMC
First frame label is "one"
Second frame label is "two"
From root I want to load frame labels in a movie clip called mySampleMC
First frame label is "one"
Second frame label is "two"
How do I reference the root frame label in a function for event dispatching using a switch statement.
SUMMARY: This is simple, but as I've stepped away from ActionScript for too long, I'm having trouble figuring out the proper test expression to reference the root timeline frame label (e.g., switch(the root frame label)).
Nothing i've tried works:
switch(this.label)://obviously this would look at the button timeline switch(event.root.label)://player says there is no "root" property ...
STRUCTURE: I have five MCs, one on each of five frames. I have a forward button and a back button. I created a switch statement to specify different actions, based on the root frame label. Frame labels are f1, f2, f3, f4, fend.
THE RELEVANT CODE on Frame one ("f1"):
Code:
stop();
nexter.addEventListener(MouseEvent.CLICK, onNexter);
nexter.buttonMode = true;
[Code]...
I have main flash file called index.swf and in that I'm loading an external movie called help.swf using the below code: loadMovie("help.swf",1);
On help.swf I have a button which brings me back to the main file i.e. index.swf using the below code. _root.loadMovie("index.swf");
When index.swf is loaded I want it to go to a particular frame. I tried using levels but then my print function doesn't work properly.
I have an swf with a menu button that loads an external swf on(release) {loadMovie("Unit-Type.swf",_root.MC_UnitTypes);}When that menu movie is loaded I want to be able to click a button and have it go to a certain frame in the root movie and close itself. I have this code but it's not workingon(release){_root.gotoAndPlay(25);}
View 1 RepliesI have an swf with a menu button that loads an external swf: on(release) {loadMovie("Unit-Type.swf",_root.MC_UnitTypes);} When that menu movie is loaded I want to be able to click a button and have it go to a certain frame in the root movie and close itself. I have this code but it's not working: on(release){_root.gotoAndPlay(25);}
View 5 RepliesI have made a slightly complicated movie-menu system for a portfolio. I was making separate .swf's but had problems linking them.
So I combined some.
I combined an intro movie into scene 1. I added the menu system to scene 2.
From Scene 2 you can select objects on my menu. One object that I could not include was a 122 layer flash movie. So when you click this button it loads the flash movie. The movie goes fullscreen then when finished goes back to the original file and closes itself. The problem is that I do not want it to go to the intro movie from scene 1. Is there a way to load the original movie AND send it to scene 2?
I'm trying to access a specific frame label in an externally loaded swf. I have the external swf loading, but I'm not sure how to access the specific frame label after release. This is an example of the code on my external swf timeline:
[Code]....
I have a button on the main timeline. When clicking it, I would like to move the main timeline to a frame label called "history" and load and play a movie clip called "slideshow1".
I have the "gotoAndPlay" code working properly but can't seem to get the external swf "slideshow1" to load and play.[code]...
I am using Flash CS3, Actionscript 2.
I need to load an external movie file into the root of my main movie, so it replaces the main movie, and when it loads, it loads at a specific frame (or label)of that newly loaded movie.
Explanation: My main movie, lets call it "Main.swf", has a button which is part of a drop down (tree) list. When you click on the button, I want to load my second movie called "bearings.swf", and to immediately go to frame #2 of the "bearings.swf" movie.
i made swf which contain 7 button to control 7 pages i put this swf in dreamweaver to control ths file, i tried to give every single button Avalue to tell the root which frame in which movie clip(for the button to be highlight) but it deosn't work
here is the code
////////////// the code for Buttons
on (release) { if (_root.link != 1) {
// if there anther selected button _root.menu["item"+_root.link].gotoAndPlay("s2"); _root.link = 1;
[Code].....
Is it possible to change a frame label within a gotoAndStop('label') with the parameters in a function?I'm playing around with updating code as I learn more and more techniques, and at the moment the code is a basic click-a-button to select the object shape, and on press the button disappears:
// Change the object into a circle.
circle_btn.addEventListener(MouseEvent.CLICK,function(){changeShape_fun(circle_btn,circle);});
// Change the object into a square.
square_btn.addEventListener(MouseEvent.CLICK,function(){changeShape_fun(square_btn,square);});
[code]....
However I can't/don't seem to know how to change a frame label through function parameters, or if what I'm trying to do is even possible.Also to note, while I'm all ears for any more efficient ways of doing what I'm trying to do, I would still like to know how/if you can change frame labels through function parmeters.
i tried to jump to the root and then to sepecific label and if in that label in the root enter in a instance my cod eis something like this.
[Code]...
i have one button (enter_btn) inside of one moviclip(enter_mc), and I need to know how to call the button through my frame root?
I use one movieclip only to make a fade in of my button in only one frame of my frame root.
[Code]...
I have a series of MCs in my root timeline. On each frame in the root, I am simply running 'stop();' to allow the MC within the frame to play through all the way. Once the timeline within the MC reaches the last frame, I have the following AS to go back to the root and play the next frame (each frame is labelled):
[Code]....
is there an action script code that enables the timeline to automatically enter a frame label on entering a certain frame.
View 1 RepliesI'm trying to get this function to target myClip_mc and movethe frame head to another frame label.
var counter:Number = 1;
//textBeGone
invisible_btn.onRelease = function(){
counter++;
if(counter % 2 = true) {
[code].....
is it possible automatically name frame label with instance name of item in frame.
View 2 Replies1. I make a simple movie (call it movieClip) first frame has stop(); action, second frame has label playMovie, last frame has action gotoAndPlay(2); (so that movie not stop anymore2. Now I place movieClip on stage3. Question... what is code to make movieClip play frame label playMovie?
I already try to put many different type action in frame one of stage
this.movieClip.gotoAndPlay("2"); //NOT WORK
this.movieClip.gotoAndPlay(2); //NOT WORK
[code].....
Yesterday Kglad gave me the following :
nextTX.onRelease = function (){var nextFrameLabelNum:Number = (1+Math.round(thTX._currentframe/27))%10;
thTX.gotoAndPlay("next "+nextFrameLabelNum);
}[code].....
which works great IF I am moving one image at a time.What I have done now is tween 3 slides to move into a visible mask by pressing next, but when I press previous of course the above doesn't work.It just jumps to the previous three with no tween.I would like to maintain the tween but in reverse.I would like the previous just to undo, in reverse, what the next button just did with the tween?Is there anyway to make this happen with as 2.0?
if its possible, via AS3, to create a frame label in a movieclip on a specific frame.
Obviously I can do it by manually by setting up labels on the timeline within the target movieclip, but I would rather use an array so I can loop through it, creating a label name on a the specific frame each time?
so for example I would end up with:
myLabelOne on frame 10
myLabelTwo on frame 25
myLabelThree on frame 115
etc
I am trying to use this if statement with a frame label instead of a frame number. I believe that _currentframe is looking for a number only. Is there a different command that looks at frame labels instead of frame numbers?
View 1 Repliesis it possible to find the frame number of frame label with AS if a button is rolled over, the timeline jumps to a label - which plays a set of 3D rendered frames to 'raise' and element, once a user rolls out of the 'button' area the button is meant to 'lower' - which can be done by simply playing backwards to the previous label.
View 5 RepliesI am trying to use this if statement with a frame label instead of a frame number. I believe that _currentframe is looking for a number only. Is there a different command that looks at frame labels instead of frame numbers?
View 1 RepliesIs there a simple way to get the frame number of a frame label?
View 2 RepliesI am loading a swf into an empty MC with this code:
on(release) {
loadMovie("movie.swf", _root.container);
}
what I want to do is also go to a specific frame or frame label in that loaded movie. I thought I could do it by adding something like this:
_root.containter.gotoAndPlay("frame");
Is there a way to get the frame label on a specific frame, without it being the current frame?
I've tried accessing it through:
this.scenes[0].labels but it doesn't allow me to check a specific point on the timeline.
Trying to go to a frame label - 1 frame -
[Code]...
Does anyone know why if I use
on (press) {
_parent._parent.gotoAndPlay(19);
}[code]....
it will work? My labeled frame is two parent mc's previous and it doesnt work when I call to it with the label?I would really like to use the label so if I move my keyframes around I dont have to change a lot of code.....
Im loading an external SWF in to the main SWF at frame 1.
When that animation is done I want it to go to the next frame of the root SWF .
In AS2 this might be done like this:
_parent.nextFrame();
or
_root.nextFrame();
or
_level0.nextFrame();
How would I do the same in AS3 ?
I have three buttons, btn_1,btn_2,btn_3, and two movie clips, image_1,image_2. The names listed btn_1,btn_2,btn_3, image_1,image_2. are all instance names. All buttons and movie clips are on their own layer in a single frame on the main time line. the movie clips have a stop action on the first and last frame, with a frame label, on the first frame in the sub time line. For image_1 the frame label is image_1_1 and for image_2 the frame label is image_2_1.
I would like btn_1 and btn_2 to control the movie clips, image_1,image_2. Either button should be able to close the other buttons movie clip and play it's own movie clip. Also i am trying to make the movie clips themselves have the ability to be closed by clicking on the movie clip image area that is playing. Both movie clips when not playing hide behind the appropriate button with an alfa of 0.
When playing they expand to the middle of the window and are at 100% alfa, using a tween. The third button, btn_3 should only be visible when one or the other movie clisp are playing. btn_3 dose nothing else but this for now. As of now, my movies continuously loop and btn_3 is always visible. I can't seem to figure this out. my code for this action is:
[Code]...