ActionScript 3.0 :: GotoAndPlay Movie In Root?
May 24, 2011In the past I've used _root.smoke.gotoAndPlay(1);.I can't seem to target this "smoke" movie clip that is on the root with actionscript 3.
View 7 RepliesIn the past I've used _root.smoke.gotoAndPlay(1);.I can't seem to target this "smoke" movie clip that is on the root with actionscript 3.
View 7 RepliesBasically the title is the question. I want to loop the root movieclip; in this case it plays from frame 1 through to frame 240, then I want to loop back to 97-240 infinitely afterwards... I tried adding to an actions frame on frame 240, "root.gotoAndPlay(97);" and got an error call to a possibly undefined method).What am I doing wrong?
View 3 RepliesI've a button in MC1 (MC1 is resting in root) and I want it to take another MC2 (also resting in root) to go to a certain frame.. the instance name for MC1 is 'blah1'
How'll i make the button in MC2 to take MC1 to lets say frame#10.. ?
I've a button in MC1 (MC1 is resting in root) and I want it to take another MC2 (also resting in root) to go to a certain frame.Supposing, the instance name for MC1 is 'blah1'.How'll i make the button in MC2 to take MC1 to lets say frame#10.. ?
View 4 RepliesFor some reason i'm having problems swapping scenes in my flash movie. At first i put the action in a "actions" named layer and a link to a button. So basicly when scene1 loads the frame 1 action is "stop ();". The viewer clicks on button1 which has a code of;
[Code]...
Basically trying to set a gotoAndPlay event on a movie clip (onPress / onRelease)
I've tried laying an invisible button over the top of the movie clip which did work, but disabled the movie clip from playing on rollover.
I found the following code on a Adobe forum, but don't really understand it.
myMovieClip.onPress = function () {
trace ("onPress called");
};
I have some sendAndLoad code which works good. Instead of outputting something to a text box I'd like to go to a different place in my movie. I've got quite a few embedded movie clips and the path is the following:
pages_all -> action sc copy 12 -> action content copy 13. Within the pages_all movie clip I'd like to go to frame number 13. How can I use the gotoAndPlay function to go to another movie clip.
I did try the following:
this._parent.gotoAndPlay(13)
I have this situation:
- main movie
- external movie
- 1 mc into external movie
I load the external movie into main movie and i want to put a gotoandplay() in mc of the external movie, to the external, like this:
[AS]on (release) {
_root.gotoAndPlay (45);
}
[/AS]
but it takes action in the main movie and not in external movie..
im having a problem with Loadmovie().im trying to load a movie and gotoandplay it like this
Code:
var placeholder:MovieClip = this.createEmptyMovieClip("monster", 5);
monster.loadMovie(_root.monsterfile);
monster._x = placeholder._x;[code]....
but it doesn't work .it does load the movieclip though
I have some sendAndLoad code which works good. Instead of outputting something to a text box I'd like to go to a different place in my movie. I've got quite a few embedded movie clips and the path is the following: pages_all -> action sc copy 12 -> action content copy 13. Within the pages_all movie clip I'd like to go to frame number 13. How can I use the gotoAndPlay function to go to another movie clip. I did try the following:
this._parent.gotoAndPlay(13)
That didn't work.
here's my problem/code:
I have a mc in the main timeline named contactBox_mc, within this mc I have another mc named closeBtn_mc. I have added an EventListener to closeBtn_mc to set the visibility of contactBox_mc to false on MouseEvent.Click.. but no matter what method I try, I get the following error:
1180: Call to a possibly undefined method contactBox_mc.
This is the code I placed within closeBtn_mc to set the visibility of its parent movie to false:
closeBtn_mc.addEventListener(MouseEvent.CLICK, closeBox);
function closeBox(e:MouseEvent):void{
contactBox_mc(this.parent).visible = false;
}
I also tried: root.contactBox_mc.visible = false; and got the same error,
I have a presentation which is one movie clip in one frame on the main timeline. The movie clip has quite a lengthy timeline. What I need to do is stop the movie at a frame then play on mouse click and in some cases gotoandplay, then stop again. There are no other movie clips inside the main movie clip and I want there to be no buttons. Just proceed to the next bit on mouse click.
View 2 RepliesI have buttons that i've created to play a movie clip.My movie has labels for different parts of the movie.
on_btn.addEventListener(MouseEvent.CLICK, turnOnTv);
function turnOnTv(event:MouseEvent):void{ gotoAndPlay (20);}
Do I have to put the name of the movie clip that should play?
when my character hits a certain object, I want it to play the movie. BUT since the hitTest is techincally always true if my character is just sitting on the object the entire time, it continuosly player frame #2. What is the simple fix for this? The code that will just play movie clip ONE TIME, and not restart continuosuly?
View 1 RepliesWhy with AS3 when i create button with gotoAndPlay(2); in movie with 2 frames it does not work? Its because its last frame. What would be work around?
ActionScript Code:
stop();
movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);
[code]....
[fmx]
related files: 7MB .FLA File
Okay...
At the _root I have an instance using an empty clip named mainPageEmptyClip. Inside of that, are various other movies.
Now, at the _root there is a menu which, when clicked, should access one of the layers within the empty clip's content.
The problem here is that I can't discern what the target would be to actually access the clip. The action worked fine before I implemented the empty clip, but now it won't work any longer.
I've tried using the target tool built into FlashMX, but it doesn't list any of the instances withing mainPageEmptyClip - that's as far as it goes. I've tried entering in what would seem to be the path, based on the instance names of subordinate movies, but it does me no good - I'm continually given the error of Target Not Found.
These are the two options I've tried....
_root.mainPageEmptyClip.gotoAndPlay(351);
_root.mainPageEmptyClip.webLayer.gotoAndPlay(156);
in the end of a frame of a movie clip, can i have some kind of action script that makes that movie clip stop, and then play a frame in a scene?
this is what i have-
stop;
gotoAndPlay("Scene 2", 60)
it works, but instead of going to frame 60 of scene 2, it just goes to frame 60 of the movie clip that's still in scene 1.
I've got a 'simple' problem with some actionscript and movie clips. I have a 1 frame movie with 2 Layers. On Layer 1 I have a movie clip called green1_mc. In this movie clip I have another called green2_mc. This animation is 120 frames long, with a stop(); on frame 59. On Layer 2 of the main timeline I have another movie clip called green_back. This is my button. I've put the following code on the clip.
[Code]...
I have a problem when I try do to my flash movie starts at frame 20 when playing.
In the timeline, I have some stop() function at frame 5, 10, 15...
And at frame 1, I put this action gotoAndPlay(15) for starting the flash from frame 15 When I play on my PC (local), it's ok, but when i upload to internet and play, it stops at frame 5 (where i put the stop action)
make to flash movie start at the special frame.
I have a button inside a movie clip that when pressed it launches another movie clip. That part works great. The problem I'm having now is either removing the original movie clip or at the very least making it invisible when the next movie launches. So far for my button script this is what I have:
onRollOver=function(){
this.gotoAndPlay("_over");
};
onRollOut=function(){
[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 a problem trying to get a button to go back to the start of the a main movie. I have added the button(see below) into the main movie which is only one frame and contains a quiz movie. I want the start button to be visible in the quiz movie (which happens ok) but want it to link back to the main movie when clicked. The link is not working and no errors are showing.
ActionScript Code:
import fl.controls.Button;
var startTextFormat:TextFormat = new TextFormat();
startTextFormat.bold = false;
[code]....
I have only been using FLASH CS3 for a little under a month. I have messed about with it to create some basic stuff. However recently I started on a bit of a larger project. I 'm by no means an expert in FLASH CS3 or AS3.My problem -I created a .FLA file that has seven movie clips on the main timeline, each in its own layer. These are listed below in the order they appear within the main time line.
layer ------------ movie clip
ON -------------- on_mc
RIM ------------- rim_mc
NAV-------------- coverbase_mc
PLAYER---------- player_mc
MAIN------------- main_mc
NAMEBOX------- shellname_mc
BASE------------ Base_mc
The art work for these was all imported from adobe photoshop. They all only have one frame on the main timeline. Each movie clip though has its own internal time line and some have further nested movie clips within them.The issue occurs within the NAV layer/coverbase_mc. I placed a movie clip(to act as a button) within coverbase_mc. This movie clip is called navbut_mc.Now, I already have a couple of similar movie clips, that act as buttons, in on_mc and rim_mc these work as I intended them to. However navbut_mc does not work at all in its current position. I get no errors at all on testing the movie but the action that I want it to do does not work even buttonmode = true; will not work on it.
However, if I use the same movie clip in the rim.mc, but obviously give it a seperate instance name (start_mc), then it works as intended. I have looked at various diffrent things but have to admit i'm stummped. Its almost as if when its in coverbase_mc its being hidden by the clips above it, if thats possible.The reasons I need it to work in coverbase_mc are for a) the overall look of the project b)I have some other buttons in that location that need to work from there.
I am trying to do up the framework for a flash project which has a transistion fadein and fadeout whenever it loads a new content but faces no result. How is this done? I have created fade in and fadeout as movieclips. Is there any script that I can use in my fadein movie clip that tell the root frame to jump to another frame?
View 3 RepliesI'm loading a movie in externally. The external movie has a button to unload itself from the main movie. It loads into _root.calContainer. The button is called xButton. This is the script that's not working:
_this.xButton.onRelease = function() {
_global.calContainer.unloadMovie;
}
I've also tried. _root.calContainer to no avail.
My problem is this - I have a parent flash movie of size 900x800. I have a button inside this parent that then loads an external swf (size 300x200) into an empty mc in the parent.My problem is that when the external swf loads, it resizes the parent movie (or repositions it depending on whether I am using IE or Firefox).I can't seem to work out why or how it's happening, and it happens whether I use the standard Flash embedding or the swfobject method for my HTML page that the movie is embedded in.The actionscript code in the parent is very basic:
Code:
but1.onRelease = function() {
_root.createEmptyMovieClip("mp3_player", getNextHighestDepth());
[code]......
I have a swf movie that loads to my main scene using a preload. I have a button found on the main scene. When that button is pressed I would like to use the GotoAndPlay command to play a specific frame in that movie. How do I do this. my swf is called inter_mc.swf. I created a function for the button but somehow Im thinking I need to designate the swf in the goto code. This isn't working but it is what I have so far.
[Code]...
I have a class controlling all my targets, I want to play a death scene for each target when they get shot. My targets involve several nested movie clips, I want to put the death scene on the second level of my targets nested clipsWhat code do I use to tell flash to go to the second level in my targets and play there?Here is my class code in it's entirety. I have highlighted the part thats currently playing my targets.
package {import flash.display.MovieClip;import flash.events.Event;import flash.events.MouseEvent;import flash.media.Sound;
public class SquaresClass extends MovieClip {function SquaresClass()
[code].....
I have an avatar that's made up of several child movie clip sink points such as head, arm, pants, etc. I'm trying to be able to swap out items, such as a new hat, new gun, etc dynamically based on the user's selection.
I'm able to modify a regular movie clip in AS3, but I've now moved to having a avatar that's composed of several labeled animations such as "walk" "idle" "jump", etc. The problem is, once I modify the avatar, and do a gotoAndStop("walk"), the avatar reloads all the original assets that were created when the avatar was rigged up.
I need to make it so when the movie clip that is in frame 1 of scene 1 is done it plays frame 2 of my scene 1. How do I do this Im making a cartoon where a characters mouth which is the movie clip which is moving and when it is done moving i want it to go to and plays frame 2 on scene one. Its to late to do everything on the timeline, and I cant just copy the movie clip, i could but I want to just be able to do this go to and play on scene one from the movie clip instead of doing all my work all over again
View 3 Replies