ActionScript 3.0 :: Moving Frames On MC With If Statment

Jul 22, 2009

Anyone want to tell me why this MC allways goes to frame 76 once clicked insted of checking the frame its on here is the code... function goQuestion(e:Event){ if(e.currentTarget.frame <=(60)){ e.currentTarget.gotoAndPlay(60)}else{ e.currentTarget.gotoAndPlay(76);}}

View 8 Replies


Similar Posts:


IDE :: How To Conditional Statment

Oct 26, 2009

So I'm not that familiar with using conditional statements yet, and I'm trying to get my head around it. I know what I need it to do, I'm just not sure of the correct syntax.I basically want a statement that says:

if( movieClip1 == frame 10)
{
then play movieClip2

[code].....

View 8 Replies

CS3 :: Create A Different Object Of The Same Variable Name With The Switch Statment?

Oct 20, 2009

I just started in as3 after a long break from flash and I have run into a slight problem and couldn't find any readily available solutions online so I thought I'd ask, I'm trying to do something like this:

Code:

switch(characters[ps[1]])
{
case 0:

[code]....

I want to create a different object of the same variable name with the switch statment but it gives me "1151: A conflict exists with definition player in namespace internal" which is of course because I'm redeclaring the variable. I'm not 100% sure it technically exists in the current scope though (but it must because I am getting this error.) I also tried a few ways of initializing as just MovieClip up topside and then just try and typecast it down here but as can be assumed that didn't work either.

Is there a way to get my intended effect or am I gonna have to make some like an above class containing all these other classes on it's various frames and just instantiate those?

View 3 Replies

ActionScript 2.0 :: Make For Loop In A If Conditional Statment?

Oct 20, 2005

is it possible to make a shortcut something like this. this one doesnt work, but I thought there could be a way to make it work

[Code]...

View 2 Replies

Moving An Object In Multiple Frames

Jun 12, 2010

I'm new to Flash and just started working on an animated short. In one of the sequences, I realized too late that an object was too far left in the frame and needed to be moved back. Is there a way to do that in all of the keyframes at once rather than doing it one at a time? The thing that needs to be moved is a .png file, not a symbol.

View 1 Replies

Moving Between Movie Clips And Frames Outside The MC?

Sep 24, 2009

I'm Making a catalog on Flash CS4 ActionScript 3.0and I don't know ho to move between movie clips using buttons and action script...In Scene 1 I have 2 framesIn frame 1 y have a movie clip (MC) and inside that movie clip I have 10 framesIn frame 10 of the MC, I want to put a button that will take me to frame 2 of my original timeline (NOT frame 2 of the MC)an some one tell me how's it done?or if it can't be done that way...then ...How do I go from frame 1 to frame 2 on my original timeline in Scene 1 after the movie clip in frame one is done?

View 5 Replies

IDE :: Moving Frames In Time With Audio?

Sep 12, 2009

I'm putting together book in Flash. The audio starts with frame 2 but the naritive continues on frame 3 and 4. I can code a "next" button like so:

Code:
on (release) {
gotoAndStop(3);

[code].....

View 1 Replies

ActionScript 3.0 :: Moving Back A Certain Number Of Frames?

Oct 8, 2010

I'm trying to go back a certain number of frames (let's say 20) after I hit the "Left" keyboard key.

PHP Code:
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;

[code].....

View 6 Replies

ActionScript 3.0 :: Button Disappearing When Moving Between Frames

Apr 12, 2011

I am trying to step from AS2 to AS3, not that easy.. I got to this point with a simple 3 frames movieclip. Frame 1 gives the option of loading 2 different external swf, frame 2 load directly a 3rd external swf, frame 3 nuttin happen. All works ok except when from frame2 i will go back to frame1, one of the 2 button (to load ext swf) disappear. The code i wrote down is prolly not the best.[code]...

View 0 Replies

ActionScript 3.0 :: Moving Forward Only After Certain Frames Viewed?

Jun 21, 2011

I have a Flash Movie that is using Actionscript 3.0 and I have a part of it, where the user has three choices of where to go. Once they go to one, it takes them to a certain frame, then returns to the choice frame. There are three choices here, and what I want to happen is have a button appear to move them past this section, only after they have viewed all three choices.

View 9 Replies

ActionScript 2.0 :: AttachMovie/createEmptyMoiveClip & Moving Between Frames?

Apr 6, 2006

Why is it when I attach a movie to the stage using the attachMovie function or create a movie clip dynamically using createEmptyMovieClip and the drawing API the movie clips stays visible when I change between frames.

Example Code � Frame 1

_root.attachMovie("mc","mc",2)
_root.createEmptyMovieClip("square",1)
stop();

[code]....

View 1 Replies

ActionScript 3.0 :: Require Visiting Certain Frames Before Moving Forward?

Sep 1, 2011

I have a site where I want to restrict the user from moving forward unless they have visited certain pages. So if you visit page 1, 2, & 3, then a button appears that lets you move forward. I have this working using buttons. See Example: boolean.zip

However what I need to have happen, is instead of having it check to see if you visited the page by clicking a button, I would like it to check if you visited a frame just be going to that frame. I am not sure how to do that.

View 2 Replies

ActionScript 3.0 :: Scroll Pane Component - Moving Between Frames

Feb 10, 2012

I am getting the following error message:
"TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.containers::ScrollPane/endDrag()"

The problem occurs when I like this: I click a button on the Main Frame which takes me to frame #2. I go back to the Main Frame and then come back to the frame #2. When I go to Frame #2. I get the error message. I suspect the problem is occurring because I am not emptying the "scrollPane_1" component on exit. In the code below scrollPane_1 is a scroll pane component. This is occurring on all pages that I have the scroll pane on. Also the scroll pane component is on stage and has an instance name of "scrollPane_1".

This is an Air for iOS file. Here's the code.
stop();
scrollPane_1.source= myText_1;
scrollPane_1.setSize(600,585);
bnt_home_1.addEventListener(MouseEvent.CLICK, bnt_Goto_home_1);
function bnt_Goto_home_1(event:MouseEvent):void {
[Code] .....

View 12 Replies

ActionScript 3.0 :: Playing Audio And Moving Frames In Time?

Sep 14, 2009

What I'm looking to happen is that on frame 2 I want audio track 1 to play and:

after 1 min 45s move to frame 3
after 1 min 51s move to frame 4
after 2 min 47s move to frame 5
after 3 min 15s move to frame 6

How would I code this or what would be the easiest way to do it??

View 6 Replies

ActionScript 3 :: Music Playing Repeatedly In Background While Moving Between Frames

Feb 13, 2011

I developed a website using flash with Actionscript 3. I included a music as a background for the website and the music will loaded when the site loaded. But the problem that when I click buttons to move between pages(frames) then go and click button_01 the music will play again so I will have music playing more than one time in the background and the sound_btn will not work any more so even I click sound_btn the music will not stop. The code I'm using is listed down. What I should modify to not allow the music play more than one time in the background while moving from one page(frame) to another.

stop();
//number that is redefined when the pause button is hit
var pausePoint:Number = 0.00;
//a true or false value that is used to check whether the sound is currently playing
var isPlaying:Boolean;
[Code] .....

View 1 Replies

ActionScript 3.0 :: Making Beat Em Up - Character Stop Moving If The Attack Is Pressed And Once It Is Released Start Moving Again?

Nov 2, 2010

im currently making an "AS3 beat em up" ala streets of rage or double dragon.Currently i have my character moving and a few animations done and i am trying to figure out how to make attacks work.I have some "basic" animation for his attack, but im not sure how to get it to work correctley.What happens is, if you press control (the attack button) whilst the character is walking he just keeps moving and is stopped on the attack frame.I want the character to stop moving if the attack is pressed and once it is released start moving again.

hero.gotoAndStop('still');
var left:Boolean = false;
var right:Boolean = false;[code].......

View 2 Replies

IDE :: Create A Preloader That Plays A Certain Amount Of Frames As It Loads The Rest Of The Frames

Nov 16, 2009

I want to create a preloader that plays a certain amount of frames as it loads the rest of the frames. So, I have labels on the frames basically and need a preloader to play the "loading" frames as it is loading the "content" frames. Does that make sense? I have no idea how to even start this one... p.s. I am using AS 2.0, but if it can be done in 3.0 easier, I can switch over its no biggie

View 4 Replies

ActionScript 3.0 :: Putting Multiple Instances Of The FlvPlayback Component In Different Frames And Using Buttons To Navigate To Frames

May 2, 2011

there seems to be no accepted method of playing multiple flv using buttons. My latest attempt has me putting multiple instances of the flvPlayback component in different frames and using buttons to navigate to those frames. It works but nothing anyone has posted anywhere will result in removing the flv when you go to a different frame and instance. This was simple in AS2. Load movie to a traget and each time you load a new movie the other one goes away. REALLY goes away.

View 7 Replies

ActionScript 2.0 :: Move Frames Within A Movie Clip With Buttons On Other Frames?

Nov 24, 2011

basically im making a quiz on my main timeline ive got my questions and answers and on the last frame i want it to say how many answers the user got right. ive made a movie clip on this last frame. in the movie clip ive got 11 frames with the posible totals so frame one would be 0/10 frame 2 would be 1/10 etc what i want to do is when the user clicks the correct answer on the other frames i want flash to make the frames within the movie clip to go 1 step forward.

View 2 Replies

ActionScript 1/2 :: Associate Buttons With A Moving Moving Clip?

Jan 30, 2012

what i have is a tween on a movie clip of a popcorn kernel on one layer and a tween on a button on another layer to follow the movie clip. i want to be able to roll over the kernel and make it "pop". i changed my over on the button to popped corn (this works) but i want it to stay popped for the rest of the tween.

View 11 Replies

ActionScript 2.0 :: Moving Scene By Moving A Mouse Over Them?

Apr 22, 2007

I want to know how i can moving my scene by moving a mouse over them.

to understand what i want exactly ckeck this link :- [URL]

View 1 Replies

Count Frames - Perform Action Every 12 Frames

Mar 26, 2009

I have a function that counts days and some other variables and displays the values via dynamic text.

[Code]...

I have to place the incrementCount(): function every 12 frames so that it increments the values. Seems like it would be easier to simply modify the script to count "every 12 frames" but I can't find anything that tells me how to "count frames" in flash. Seems to be this is probably basic but I've searched unsuccessfully....so how do you do this. How do I get my script to work so it's frame based so I don't have to put incrementCount() every 12 frames?

View 16 Replies

ActionScript 3.0 :: Have A Movieclip Of About 50 Frames And Navigate Between These 50 Frames?

Jan 7, 2010

Is it possible to have an movieclip of about 50 frames and navigate between these 50 frames? As if u put a marker on frame 10 and one at frame 30 and if u use a button it plays to frame 10 and stops and use another button to go from frame 10 to frame 30 and stop... and reverse if u use the earlier button.

View 5 Replies

ActionScript 3.0 :: "TweenEvent.MOTION_START" - Start Moving The Second Movie Clip At The Same Time When The 1st Starts Moving

Nov 28, 2010

I have some simple script that has 2 "movie clips". What I want to do is to start moving the second movie clip at the same time when the 1st starts moving. (both start moving at the same time) I tried the following script but it never works:

[Code]...

View 3 Replies

ActionScript 2.0 :: Loading Many Swf (30 Swf) In Frames (30 Frames)

Jan 8, 2010

I want to preload all of the voiceover swf files before a lesson starts so that they are instantly available when each frame / page that incorporates a voiceover is first visited.

View 4 Replies

Moving From One MovieClip To Another?

Mar 7, 2009

I have a main MovieClip in which I have several frame labels, each will eventually have different MovieClips associated with them. First time through I want to play an "intro" MovieClip, which I have placed on the stage at the begining of the main timeline, then at the end of the "intro" Clip, go to the first frame label and play that MovieClip.

The way I was going about it was placing this code in the last frame of the "intro" MovieClip:

Code:

MovieClip(parent).screen_mc.gotoAndPlay("home");

'screen_mc' is the instance name of the Main MovieClip.

[URL]

View 3 Replies

ActionScript 3.0 :: One Mc Moving Near Another Mc?

Nov 27, 2011

I'm stuck on the code for the following situation:A mc is costumed as the mouse cursor, 1. when we move the "cursor" near a character (mc), this character will gotoAndPlay frame2.2. If the "cursor" touches the character, this character will gotoAndPlay frame3.I've got the code working for #2, but not #1.

View 1 Replies

ActionScript 2.0 :: Moving Around And About?

Jan 9, 2007

Ok, this is my script:

while(village_holder.village.build.hit.hitTest(pt. getBounds(_root).xMin, pt._y, true)) {
pt._x++;
}

[code]....

View 2 Replies

IDE :: Moving Into One MC - Won't Function?

Aug 10, 2009

Assume the main time line is A. On A I've got movie clip Z also On A I've got movie clip B and inside B I've got a movie clip C (I need it to be this way because it soft of a TAB meanu). My problem is the actionscript written in C makes few objects called planet 1, planet 2, planet 3 on A function well. But when I move planet 1, planet 2, planet 3 to a movie clip (planets_mc) it wont function! How can I put planet 1,2 and 3 in to one mc and still make the actionscript in C work? I've used the _root. command in the script C.

View 2 Replies

ActionScript 3.0 :: Moving Two MCs Together?

Nov 10, 2009

However, I'm trying to do something new that I've not done before, and hasn't been covered in any of the tutorials I've gone through.

In general, I've got a spaceship shoot-em-up. I'm wanting to use a "tractor beam" to scoop up other items off the stage. I have it set up so that the t-beam is it's own MC, and class/.as. When a button is pressed it shows on the screen fine. However, I need it to move along with my ship.

Is there a way to do this currently, or do I need to redo the t-beam to be another layer on my ship class/MC and work it from there?

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved