ActionScript 2.0 :: CS3 Jumping To Frame Based On The Value In A Text Box?

Feb 23, 2011

I have a maths-based movie on which a number of points are allocated depending on the answers given to a series of multiple choice questions.

At the end of it, a person will score somewhere between 1 and 10 points depending on the answers they gave.

I have got to the stage where the system keeps track of the cumulative score, and at the conclusion, I have a text field on stage, which has an instance name of "results". When the person enters the frame, the results field displays the total number of points scored.

That is ok, but what I actually would like to happen is that the movie jumps to a different frame based on that figure, so that if they score 2, it would take them to the frame labelled "two" and if they score 9, it takes them to frame "nine"

Is there a way of effectively saying:

On frame enter
if results.text = 1 go to "one";
if results.text = 2 go to "two"
etc etc

I'm guessing that I need to use the:

_root.onEnterFrame = function(){
};

how to describe the bit in the middle...?

View 4 Replies


Similar Posts:


Frame Jumping - Click On Button 1 > Plays Frames 10 - 15 > Goes To Frame 20?

Oct 11, 2010

I have 5 different buttons for the navigation on my flash website.The first page is on frame one.When you click on any of the 5 buttons I want it to play frames 10 - 15 before moving to which ever frame the button 1-5 corresponds to. So:

Click on button 1 > plays frames 10 - 15 > Goes to frame 20
Click on button 2 > plays frames 10 - 15 > Goes to frame 30
Click on button 3 > plays frames 10 - 15 > Goes to frame 40 etc

How do I make this work?

View 3 Replies

IDE :: Jumping To A Frame Using XML

May 10, 2009

I'm adapting this iTunes coverflow style gallery for my own purpose [URL] Basically, the locations of the artwork and the URLs for when you click on a picture are stored in an XML file. Is it possible to adapt the AS or XML so that instead of opening a URL, clicking on a cover jumps to a particular frame on the timeline? Basically what I want to do is have the first and last items acting as previous and next buttons to go to a different frame on the timeline. I guess what i need to do is get the actionscript to do whatever is within and replacing that with the action I want it to perform?

View 2 Replies

ActionScript 1/2 :: Jumping From One Frame To Another?

May 4, 2010

I have a piece of code in AS3 but it doesn't work with AS2:
 
stop();
function login(event:MouseEvent):void
{
this.gotoAndPlay("first_page");

[Code]....
 
But I still have a problem. I have stops in each key frame but when I play the movie it shows directly the first_page section skipping all other frames before it.

View 4 Replies

Professional :: Tween Before Jumping To Frame?

Jun 25, 2011

I am wanting to fade out of a frame and then fade into another, and the way i was thinking of doing this was to code a tween to alpha 0 and then use the code:
 
home_btn.addEventListener(MouseEvent.CLICK, startMovieHome);
function startMovieHome(e:MouseEvent):void
{

[Code]....
 
I dont know how to ask it to tween and then go to the label "home" once the tween is complete..

View 1 Replies

ActionScript 3.0 :: Jumping To Frame And Line?

Jul 5, 2011

ok so i know you can use gotoAndPlay to jump to a different frame but how do you jump to a curtain line of code in that frame

View 7 Replies

ActionScript 3.0 :: Frame Jumping On MOUSE_OVER?

Nov 11, 2011

What I created was just a test but I can't seem to get it working. What I did was create a very small rectangle at frame 1. Created a tween and then at frame 100 made it a very large rectangle.

Then in my code I wanted the user to MOUSE_OVER something and the rectangle to ease to the length it was at frame 30. However I keep getting this error message:

ArgumentError: Error #2109: Frame label frame 30 not found in scene Scene 1.
at flash.display::MovieClip/gotoAndStop()
at Untitled_fla::MainTimeline/test()

Here is my code:

[CODE]
stop();
circle_mc.addEventListener(MouseEvent.MOUSE_OVER, test, false, 0, true);
circle_mc.addEventListener(MouseEvent.MOUSE_OUT, test2, false, 0, true);

[Code].....

View 5 Replies

ActionScript 2.0 :: Jumping To Next Frame After Video Is Complete?

Jul 7, 2010

I have a video (that im calling from my harddrive) that i would love to play once through,then jump onto the next frame (where theres another video that continues from the end of the first). Why can i not use the following code to jump?

on(complete){
gotoAndStop(5);
}

View 1 Replies

ActionScript 1/2 :: Pausing The Movieclip And Jumping To Frame 2 On The Timeline?

Mar 24, 2011

I tried to get this right but it just won't work for me. It's probably something very simple. I have a video in a movieclip on my timeline. On the first frame, I have the stop(); command. I want to be able to hit the SPACEBAR: which results in pausing the movieclip and jumping to frame 2 on the timeline.

View 8 Replies

ActionScript 3.0 :: External SWF - Jumping To Frame Of Main Timeline

Aug 10, 2011

I have an external swf (is is an intro, nade in aftereffects)..and it loads in the main timeline of the site with a preloader. Everything is ok, but, when the intro in done plating. It stops and I want do see de site. I mean from the last frame of the external swf, I want to jump to the second frame of the main timeline.

Here is the script:
stop();
var req:URLRequest = new URLRequest("intro.swf");
var loader:Loader = new Loader();
function fileLoaded(event:Event):void{
addChild(loader);
[Code] .....

View 2 Replies

ActionScript 2.0 :: Jumping To A Frame *inside* A Loading Swiff?

Feb 1, 2008

I have this code on the home page of a site:

_root.createEmptyMovieClip("loadExternalSwiffs_mc" , 2);
loadExternalSwiffs_mc._x = 0;
loadExternalSwiffs_mc._y = 103;
_root.loadExternalSwiffs_mc.loadMovie("introSplash Page.swf")

The "introSplashPage.swf" it loads initially has buttons on it that swap in one or another swiff in its place, for instance, "mediaPage. swf"

This works OK, but in the case of "mediaPage.swf" I'd prefer that the button take the viewer directly to a labeled frame *inside* the swiff. I can't figure out how to do that.

Online, I saw tantalizing code that used...

on (press) to get to the new swiff and then...

on(release){
_level2.gotoAndStop(10);
}

to get to a specific, numbered frame. But I couldn't get it to work, either going to my my frame number or, when modified, to my label.

View 2 Replies

ActionScript 2.0 :: Pausing The Movieclip And Jumping To Frame 2 On The Timeline?

Mar 24, 2011

I tried to get this right but it just won't work for me. It's probably something very simple. I have a video in a movieclip on my timeline. On the first frame, I have the stop(); command. I want to be able to hit the SPACEBAR: which results in pausing the movieclip and jumping to frame 2 on the timeline.

View 4 Replies

ActionScript 1/2 :: Jumping From Main Timeline To A Specific Frame Of A MovieClip?

Apr 6, 2010

The situation is as follows:I'm using Action Script 2.0 --- I'm obligated to in the course I'm attending.I have a main timeline that has 3 frames. On the 2nd frame I have a movieclip named mc_nbr. On the 3rd frame I have a button "voltar" that when pressed I want it to "Go and Stop/Play" at frame 3 of the movieclip (that is embedded on frame 2 of the main timeline).

I used the folowing code for the button btn_voltar:
on (press)
{

[code]......

View 2 Replies

ActionScript 2.0 :: On(release): Displaying A Movieclip -> Waiting -> Jumping To Frame

Oct 8, 2011

DISCLAIMER I've just started to learn flash to fulfill a class assigment. This problem probably has a very easy answer, but I can't find it and now I'm getting close to my deadline.

PROLOGUE The title describes what actions I'm trying to put in a button. I'm making a quiz. Each keyframe has a pic and 4 buttons. The correct answer should show a green V onscreen; the wrong answer should show a red X. After one second, it jumps to a new question in a new keyframe. I've made the X and V as both 12-frame movieclips and 1-frame graphics on the library, but can't seem to make them show up correctly.

1st issue: showing the movie clip/graphic. The movieclip/graphic should appear in the center of the stage *after* you press the button. Currently, the clip is there from the start; can't find a way to make it start invisible, then visible when I click the button. 2nd issue: waiting 1 second before going to next frame.I've tried using setInterval, but failed. Maybe the best way is to use a command that waits for the movieclip to play before making the jump?

[Code]...

View 6 Replies

ActionScript 2.0 :: Hit The SPACEBAR: Which Results In Pausing The Movieclip And Jumping To Frame 2 On The Timeline

Mar 24, 2011

I have a video in a movieclip on my timeline. On the first frame, I have the stop(); command. I want to be able to hit the SPACEBAR: which results in pausing the movieclip and jumping to frame 2 on the timeline.

View 1 Replies

ActionScript 3.0 :: Create A Holder And Use AddChild To Play Them Instead Of Jumping To The Frame Labels?

Feb 3, 2009

I'm basically creating a huge slideshow presentation for a live show. I decided to put everything into 1 huge fla/swf so that it is more manageable in the future.With AS3, I have made it so that when the user presses the right arrow key, it will seek out the requested frame label and play the next slide.This works well.However,some of the frames need to be played again in later slides.So I would prefer to reuse those frames again, instead of copying and pasting them 10 times.When I do that though,I have no way of switching to the next slide, as I've already set the nextframetoplay variable in my class.

Does anyone have a better way of doing this? Should I perhaps create the screens and just create a holder and use addChild to play them instead of jumping to the frame labels?

View 10 Replies

ActionScript 3.0 :: Tweens - Get The Previous Image / Piece Of Work To Fade Out Before Jumping To The Selected Key Frame

Oct 19, 2009

I curenttly making a simple online portfolio using flash (as3). Each piece of work i'm displaying resides within a mc on the main time line, and within that each piece of my work lives in its own keyframe, so the site has a basic 'mc.gotoandstop("label")' navigation. I can get my images to fade in using a AS tween, but I want to get the previous image/piece of work to fade out before jumping to the selected key frame and fading in the selected work. Currently, the innards of my button function reads something like:

tween (fadeout)
gotoandstop
tween (fade in)

but this clearly not the right way to go about it? Is there a way of putting slight delay after the fade out tween in the function? To let it fully fade out before fading in the new work?

View 3 Replies

Professional :: UIScrollbar Drag N Drop - Keeps Jumping - Text Field

May 13, 2010

I'm cruising through the Classroom in a Book series for ActionScript 3.0 and I'm having problems with the uiscrollbar attaching to a text field. I've used them before, but this time when I drag it over to the text field it keeps jumpimg to the outside of the box instead of attaching and I can't seem to get in inside the box unless I manually change the X and Y settings and force it where I want it to be. Even then it doesn't work correctly.

View 2 Replies

ActionScript 3.0 :: Pass Text From An Input Text In Frame 1 To A Dynamic Text Field In Frame 10

Jul 24, 2009

I'm trying to pass text from an input text in frame 1 to a dynamic text field in frame 10. Thus when the user enters text and clicks the submit button it takes them to frame 10 and shows them what they typed. It's not working but I'm not getting any errors. Here's the link:

[Code]...

View 3 Replies

Input Text Field On Frame 1 And Enter Text In It Then I Have A Button That Say Sends To Frame 2?

May 12, 2009

If I have an input text field on frame 1 and I enter text in it then I have a button that say sends me to frame 2. On frame 2 I have a button which sends me back to frame 1. Why when I got back to frame 1 is my text not shown?Why does an input text field go blank when leaving the frame? How can I make it so when i enter text on frame 1 and then go to frame 2 and then back to frame 1 the text i entered is still there?

View 7 Replies

ActionScript 2.0 :: Frame Based Mouse Is Down

Nov 16, 2008

how to run a code every frame that the mouse button is held down. Also Ineed it to be frame based.

View 4 Replies

Keep My Text From "jumping"?

Feb 7, 2009

I'm currently working on making flash "buttons". Each of the buttons is tweened when clicked (they slightly shrink then go back to normal size). Here is my dilemma. The buttons each have a label that is a dynamic text field. Since the labels are dynamic, I have to make each text field muli-line since I don't know how long the label is going to be. When I click on a button, sometimes my text label will go from 2 lines of text, to one line of text (because the width of the button changes for a split second with the tween). You can see what I mean here, http://www.flupload.com/FlashTest/Test.html click on the button and the text "This is long text...." Will go from originally being on 2 lines, to briefly displaying as 1 line, then back to it's original two lines. Is there a way I can prevent the text from doing this? Keep in mind that I can't set the text field to only a single line since the text is dynamic and I'm not sure how long the label will be.

View 2 Replies

ActionScript 2.0 :: Go To Specific Frame Based On URL Address?

Mar 8, 2009

I need to have the ability to go to a specific frame in a timeline based on what the web address is. I basically want to play an intro for my index page only and skip to frame 30 for all other pages. Example [URL]

View 1 Replies

Switching Frame Based On Another One Inside MovieClip

Apr 6, 2009

I am using Flash MX 2004, aka Flash 7, and Actionscript 1. What I have is a movie clip that plays on frame one. Its a variation of loading screen. What I want to do is make it so that when the movie clip is on its last frame (frame 100), then it switches to frame 2. NOT frame 2 of the movie clip, but frame 2 of the overall project.

Code:
if (_root.loader._currentframe == 100) {
_root.gotoAndPlay(2);
}
(movie clip is called loader)

I have also tried naming frame 2 "finishedLoading" and just "2", but it still will not go.What happens is, when the movie clip animation is finished and on frame 100, it just sits there. I had to put a stop(); in frame 1 so that the animation could play, but it stays stopped. This was all done after I tried the logical approach where inside of the movie clip on frame 100 of the movie clip, I made an "Actions" layer and on frame 100 keyframe, I put:

Code:
gotoAndPlay(2);
I also tried
Code:
gotoAndPlay("finishedLoading");
and
Code:
gotoAndPlay("2");

I have even resorted to the last resort. I put tried to make a variable so that when the movie clip is on frame 100, that "var finishedLoading" would be set to true, and then:
Code:
if (finishedLoading == true) {
//
}
Inside of the comment would be gotoAndPlay(x);

View 1 Replies

ActionScript 2.0 :: MovieClip To Go To Certain Frame Based On Variable

Jun 17, 2011

I am building a very long and detailed flash training program. I need to get a MovieClip to goto a certain frame based on the value of a variable that is defined on a keyPress.

Here is the code:
fscommand("trapallkeys", "true");
trace(nmhho);//show the value every time this frame loads
if (nmhho == 1){
Nav_Mode_Hdng_Hold_Override.gotoAndPlay(2);
}else if (nmhho == 0){
Nav_Mode_Hdng_Hold_Override.gotoAndPlay(1);
[Code] .....

The MovieClip in question is "Nav_Mode_Hdng_Hold_Override" "nmhho" is a number variable that is already defined and set to 0 initially, on keyPress of 9 it changes to 1, and when u press it again it changes back to 0, the problem is that when the page loads the "IF" statement at the beginning does not tell the movieclip to go to the proper frame.

View 1 Replies

ActionScript 2.0 :: Goto Frame Based On Variable?

Apr 8, 2011

The website I am currently making is quite dark so before the user enters the website I want them to drag a slider until text onscreen is a suitable brightness then when they click enter to continue into the site I need the background mc to go to a frame relative to where the slider was.

[Code]...

View 0 Replies

ActionScript 2.0 :: Change A MC's Frame Based On Variable?

Jan 14, 2012

I have a very weird idea, but i can't make it work.

Theres a Movie Clip, called "bar"

And there's a variable called "Points"

Whenever we get 2 points, the MC called "bar" is moves 1 frame.

To summarize: Whenever variable "points" increase by 2, "bar" MC's frame increase by 1.

View 4 Replies

ActionScript 3.0 :: Going To A Frame Based On The Current Time?

Nov 19, 2010

I have a flash file of a snowman doing various activities. He's doing 7 different things (all individual movie clips) and I place each of the movie clips on the first 7 frames, I placed a stop action on each one.Here is the code I used

var myDate = new Date();
var localHours = this.myDate.getHours();
if (this.localHours>=6 || this.localHours<=18)

[code]......

View 12 Replies

ActionScript 3.0 :: Change Dynamic Text Color Based On Input Text

Aug 29, 2011

I have an input text box (txtInput) and a dynamic text box (dynTxt). I want the dynamic text to stay black but highlight a segment of that text in yellow depending on certain characters.

[Code]....

View 4 Replies

ActionScript 2.0 :: Enlarging Dynamic Text Box Based On Text Length?

Jul 29, 2004

Is there a way to set up a dynamic text box to increase in size (height) based on the length of text loaded into it?

View 2 Replies







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