CS4 Calling A Frame In A MovieClip With A Button?
May 14, 2009
I've been reading over numerous tutorials and guides as well as the Language Reference for ActionScript 3.0 but cannot quite seem to find anything to learn what I need (which I guess is because everything I have read assumes you would already know how to do this sort of thing).On my stage I have one button (mybtn) and one MovieClip. Within the MovieClip I have numerous other MovieClips (the different parts of a character, leg, arm, head, etc).
One of those MovieClips, lets call it "upper_left_arm" (within the other MovieClip "character") is comprised of two Keyframes, frame 1 and frame 2. There is also a second layer with AS in it, which just has "stop()" in it so it doesn't endlessly play.When I click the button on my stage I want to change the playhead to frame 2 and then stop within the "upper_left_arm" MovieClip.I gather that I almost certainly need to use gotoAndStop.However, most information I have found concerning buttons, AS3 and the gotoAndStop command relate to "scenes" which as far as I can tell are nothing to do with what I want.
Code:
stop();mybtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
upper_left_arm.gotoAndStop(2);
}
The "(2)" is the part I think I have horribly wrong, I've tried various other things after "upper_left_arm.gotoAndStop" with no success. In fact, the MovieClip "upper_left_arm" now loops round merrily despite the "stop()" in the AS in that MovieClip itself .
View 2 Replies
Similar Posts:
Oct 18, 2011
I'm having a problem where I have a button on the main timeline that when clicked needs to gotoAndStop first on frame 3, where there is a movieclip, that i want it to gotoAndStop on frame 30 (of that movieclip). Any ideas?
I can't have it just gotoAndStop on frame 3 and then have the code to gotoAndStop on frame 30 either because I need to be able to have the moviecliped called like this a number of different times.
View 2 Replies
May 27, 2009
i have created array of button and i want to call a frame according to the order or number of that button when it is clicked.
like
if i click 1st button it call a frame 1 of symbol named A
if i click 2nd button it call a frame 2 of symbol named A
if i click 3st button it call a frame 3 of symbol named A
[code]....
View 2 Replies
Dec 28, 2004
I am in a second scene... and am trying to call a frame label in an mc in scene 2 is there a such thing as...
on(release) {
_thisScene.mymc.gotoAndStop("framelabel");
}
this scene?
View 5 Replies
Mar 22, 2005
I was wondering if there's a way where you call out specific frame after attaching a movie clip.
View 4 Replies
Mar 4, 2010
I have an instance of a movie clip that runs and after it runs I want it to call a frame to gotoAndStop back on the main timeline (stage). What is the code for that? When the animation ends, I am simply giving it a stop(); and then I want it to go to the next frame on the main timeline. I think this used to be _root in AS2.
View 1 Replies
Apr 28, 2010
Anyone knows if there's a way of calling an specific frame or movieclip from a loaded xml file? I have some xml text loaded to my flash site and i want to have a link in this text that when clicked loads a comment form that is in a different frame in the timeline. I've been looking and googling and i havent found any solution to this.
View 1 Replies
Feb 16, 2010
How can I get a button inside a movieclip link to a frame in another movieclip on the scene? I tried this code:
function gotoCenter(event:MouseEvent):void {
MovieClip(root).centermc.gotoAndPlay(2);
}
skruetest.addEventListener(MouseEvent.CLICK, gotoCenter);
..where "skruetest" is the button, "centermc" is the movieclip where I want to go to frame 2. I don�t get errors with this code, but nothing happens when I click the button. What can I do?
View 4 Replies
Sep 8, 2010
Have a blank stage with 3 movie clips as buttons. When I click them I'm using this code
[Code]...
this triggers the click of the button to return to the main timeline and stop on a specific frame. My issue is that if I click the button a second time, it goes to a blank (or different ) frame, a third click will return it to the proper frame. I'm doing this as some users I work with are mouse clickers, now this is ok if I use a button symbol, but I want them as movieclips. What script can i use to ensure that every click makes the mc operate the exact same (goto specific slide with no randomness)?
View 1 Replies
Oct 17, 2010
finishing my portfolio website and i've ran into a tiny problem. All my buttons are all in one layer and the whole website takes 4 frames. Within each frame is a movie clip that holds all the content for that page i.e. images and text.The problem: If I navigate to the projects page and am browsing through the content and I want to reload back to the first frame of the projects page (via the projects page button) then the button doesn't reload, I think this is because the button is a part of the main timeline and not part of the movieclip.The question: What code do I need insert into the button to get it to go to frame one of my movieclip.Here's what simple button code am using atm:
Code:
on (release) {
gotoAndStop("Main",6);
[code].....
View 9 Replies
Feb 18, 2009
I put a mcBtn in the end game frame, put this code in the frame:
mcBtn.buttonMode = true;
mcBtn.addEventListener(MouseEvent.CLICK, playGame);
function playGame(e:Event):void {
play:(1);
}
The object is to go to frame 1 when you press mcBtn. When I click it, Nothing.
View 2 Replies
Mar 22, 2010
hi i am having trouble getting my buttons to work right in flash cs4. is it possible to have a button gotoandplay a frame inside a different movieclip? if so how?
View 2 Replies
Apr 8, 2010
I am using the radio button component in Flash with a continue button. When the user clicks their option in the radio button and then clicks continue, I want it to go to a movieClips Specific frame. Here is the breakdown and the script I have so far is below.
The radio group os named RadioButtonGroup The instance names for each of the three options are noviceButton,intermediateButton,expertButton My continue button has an instance name of continueButton and my movie clip I am trying to target has an instance name of level_mc here is my code so far:
[Code].....
the problem starts with my varFrame line-I don't know how to get it to go to the movieClip and gotoAndStop at a specific frame, based on which radio button was clicked and after the continue button is clicked.
View 23 Replies
Jul 9, 2009
How do you target a certain frame number/name from outside of that specific movieclip?
Code:
whoweare.addEventListener(MouseEvent.CLICK, whoweareClick);
function whoweareClick(event:MouseEvent):void{
gotoAndPlay("whoweare");
}
I'm assuming it's something with the gotoAndPlay function... but I've tried numerous things with that and nothing is working.
View 3 Replies
May 12, 2011
Basically I have a movie clip that comes up on the stage and plays to frame 230. I have placed a stop(); inside the movieClip on frame 230. I would like to have a continue button come up outside the movieClip on the stage when that movieClip reaches 230.I was hoping this would work but I am having trouble. This code is on the stage level outside the movieClip.Both the continue button and the movieClip are on the stage.
if (movieClip.currentFrame == 230){
continueBtn.visible = true;
} else {
[code].....
View 1 Replies
Jan 13, 2004
What I am trying to do is get a button to make a movieclip go to a specific frame. I have a movieclip that plays a set of frames up to the 100th frame, and then I tell it to go back to and play frame 1 again. However, at about 105, I have another set of frames that I want to play at the push of a button. How would I go about doing this?
View 1 Replies
Feb 5, 2010
In AS2 I need code for a button, on the main timeline, to go to a frame in a mc off the main time line. I have attached a picture of the time lines in case I have not articulated my needs well.
View 5 Replies
Dec 16, 2011
I have several website pages set up on different frames inside the content (which is a movieclip) of the home page - which is on frame 1 of the main timeline. The content movieclip name is contentMc.
My About page is at frame 10. There is a button on this page (called btnAbout_contactpg) that I want to make jump to my Contact page (frame 50) - all of which is nested under the main contentMc movieclip.
This is the pathway on my contentMc (where all of my pages are located), just in case that doesn't make sense: [URL]
I have looked at several different instructions online, but none of them seem to work.
EDIT:
I am also trying to get a button on my gallery page to load an external image, but it is not recognizing where the button is either:
btnGallery_1.addEventListener (MouseEvent.CLICK, showPic1);
function showPic1 (e:MouseEvent) {
var target:Object=e.target;
var parent=target.parent;
my_loader.load(new URLRequest("image-0.jpg"));
}
View 1 Replies
Mar 19, 2005
I've got a button that tells a movie clip to play its animation (goto and play frame 2), but I only want it to play that frame if the current frame is frame 1 - meaning that I don't want people to be able to keep clicking the button while the clip is playing and have the clip restart.
I'm guessing it would be something like:
If ( current frame is frame 1 ) { goto and play frame 2 }
But I can't seem to get it to work.
View 1 Replies
Sep 10, 2009
A movie clip called "Symbol_4" contains all of the navigation and frames of my movie.inside of Symbol_4 is a MC called "bottom scroller" which contains "imgbar" which contains "bar" which has a bunch of buttons in it.I want those buttons to link to different frames in the main "Symbol_4" MC.
I've tried putting code on a button like this
Quote:
on (release) {
tellTarget (this._parent._parent._parent) {
}
[code]....
There are no errors in any of this code, but nothing seems to work?!
View 2 Replies
Sep 27, 2011
What I want to do is have one movieclip that has many frames and turn that into a button and then make different instances of the button and have those instances display a certain frame of the underlying movieclip.
View 17 Replies
Sep 11, 2010
I wanted to create a portfolio in flash, so I designed the layout in photoshop, with different webpages in different groups. So groups i created: home, about, porfolio, contact, affiliates, topbar, menu.I use Creative Suite 3 or CS3I then imported the groups into flash as movieclips, using the import to stage function. here is the image of the main scene in the flash. (SEE IMAGE 1st thumbnail)I created a new layer on top of all the layers and used labels at equal intervals to differentiate between pages.here's the image depicting the same.(SEE IMAGE 2nd thumbnail)Now in the home movie clip, i made all the text layers as movie clips to make button animations and assigned sounds and actions to them i.e. rollver, rollout andclick events. here's the swf.(PM ME FOR SWF)I want to know the code or method to load the frame labelled ''about'' in the main scene when i click on the movieclip button 'about' which is in the movieclip 'home'. Here's the code i tried for the first 'about' button, but it returns error "1120: Access of undefined property event."
code:
ActionScript Code:
var OverSound:roll_over = new roll_over();
[code].....
View 0 Replies
Aug 27, 2005
What im trying to do is play a movie clip between frames. So say we have two menus, when you are on menu 1 and you click the button for menu 2, a short movie clip plays and then you stop on menu 2. I realise I can do this by putting the movie clip on the main scene timeline, but is there anyway i can put it on the button? I think the action script would be something along the lines of "On release play MovieClip and goto frame X" As i said i want the movie to play as an almost filmic transition between menus, with a fade up and then out (Have got that bit sussed using the alpha controls)
View 3 Replies
Dec 2, 2010
I have a button (bttn1) which when clicked plays a movieclip (bounce), but I would like it to play from frame 1 then stop on a desired frame(say frame 10), so when a second button is clicked (bttn2) it plays from frame 10.
View 7 Replies
May 11, 2011
ive made a simple game for a uni project, when you get game over a movieclip comes up and inside the movie clip there is a button to restart the game. how to i code the button inside the movieclip to gotoAndPlay to frame 1 on the main timeline?
[Code]...
View 4 Replies
Apr 21, 2009
I have created a movie clip button but am stuck with the actionscript. I have created the rollover and rollout for this movie clip button but i want it to do 2 things after this i want it to go and stop on the first frame of a movieclip which has my content on it called portfoliogallery_mc (which is also the same instance name for it) when you then click the button i want it to go and play frame 11 of that movie clip portfolio gallery_mc. Here is my current actionscript i HAVE Flash 8 on my comp that i am currently using. Please note my actions are on a layer called actions and not on the movieclip button itself. nxtimagetwo_mc (is the movie clip button/instance of mc)
[Code]...
View 5 Replies
Jan 14, 2012
For some reason, the same code works now, without any problem at all. I don't know what happened, or why, but I no longer have this problem Here's the original post: To put simply, I created a MovieClip, put it with addChild() to stage, and when I tried to call this piece of code:
[Code]...
View 2 Replies
Mar 21, 2007
I'm trying to do somthing like this:
class Timer extends MovieClip
{
// constructor
[code].....
View 3 Replies
Sep 26, 2009
I have a button that uses the Load Graphic Behavior for bringing a SWF, but i want the SWF to come in a specific frame instead than starting at frame 1. For examplel; i click the button, the behavior of Load Graphic brings my SWF to stage but i want to start at frame 50, not at frame 1. How can i do that?After i use the Load Graphic Behavior i try using a gotostop frame, but doesn't work.
View 13 Replies
May 20, 2010
i got an AS3 3d gallery that calls external swf animations...
However these animations loop...and on the last frame i need the gallery to appear again.. Is there a way (either AS2 or AS3) to put a code on the main timeline at the last frame that calls my swf gallery back? It doesn't have to load inside the swf...it just needs to appear as soon as the other one ends..
View 2 Replies