Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








How Do I GotoAndPlay(frame); Depending On A Variable From Php?


Ok, I have set the variable in my page using <param name="flashvars" value="menustate=<?php $pagename; ?>"> which works perfectly fine when I use a dynamic textbox in flash with the var name menustate.

But I need to send a MC to frame 2 if 'menustate = 2'. Anyhow, I just want to know how to control a MC with an external var. I can't use loadVars () because this var is coming from any page, not just one.

Thanks,




KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 04-28-2004, 10:30 PM


View Complete Forum Thread with Replies

Sponsored Links:

How Do I GotoAndPlay(frame); Depending On A Variable From Php?
Ok, I have set the variable in my page using <param name="flashvars" value="menustate=<?php $pagename; ?>"> which works perfectly fine when I use a dynamic textbox in flash with the var name menustate.

But I need to send a MC to frame 2 if 'menustate = 2'. Anyhow, I just want to know how to control a MC with an external var. I can't use loadVars () because this var is coming from any page, not just one.

Thanks,

View Replies !    View Related
Jumping To Frame Depending On Value Of Variable
I want pass some variables to a FlashMovie and then jump to the framenumber which is stored in the variable.

View Replies !    View Related
How To Get A Movieclip To Change Frame Depending On A Variable?
Hi, I'm a steady user of flash (the animation and graphics side) but I hardly ever get on with the evil actionscript.
What I want to do is create a button, which changes the number of a variable (ex. you click it and it ads + 1 to the number)(more or less got that sorted), and if the variable is worth a certain value (variable = 5) a movieclip changes it's frame to a different one.
I've been trying to get it right for a while but it doesn't want to. I'm not sure if I have to use the _root.variable or what. I welcome any help =[
Sorry for the dumb question.
I use Macromedia Flash Professional 8 and Actionscript 1, by the by.

View Replies !    View Related
GotoAndPlay Frame Label Variable
I am trying to develop a navigation interface with AS3 that interfaces with three different movie clips.

MovieClip 1 = menuMc (this is the menu interface with movieClip buttons)
MovieClip 2 = tabSlider (this is the content holder that tweens in after a click)
MovieClip2 = imgBgHolder (this hold's my images)

What I am trying to accomplish is after a button is clicked, a variable imgBg is set that can be called when "imgBgHolder" plays and hits a frame with gotoAndPlay("imgBg");. There are six buttons using the same var imgBg in case that makes a difference!

Can anyone give some advise as to why the movieClip will not gotoAndPlay the set variable?

Thanks very much


Code:
menuMc.history.addEventListener(MouseEvent.ROLL_OVER, historyOver);
function historyOver(event:MouseEvent):void{
menuMc.history.gotoAndPlay("in");
menuMc.history.buttonMode = true;
}

menuMc.history.addEventListener(MouseEvent.ROLL_OUT, historyOut);
function historyOut(event:MouseEvent):void{
menuMc.history.gotoAndPlay("out");
}
menuMc.history.addEventListener(MouseEvent.CLICK, historyClick);
function historyClick(event:MouseEvent):void{
var imgBg:String = "historyImg";
tabSlider.gotoAndStop("home");
tabSlider.tabSliderContent.gotoAndStop("history");
menuMc.history.buttonMode = true;
imgBgHolder.play();
}

View Replies !    View Related
Using A Variable As A Frame Label Inside A GotoAndPlay()
Hello, and thanks for you help in advance,

I have gotoAndPlay(_level0.step), but _level0.step refers to a frame label, not a frame number. what's the syntax for that. Right now if _level0.step = 2 is going to frame 2 rather than label 2, which is what it is supposed to do.

How can I do this.

Thanks

View Replies !    View Related
Pass Variable To GotoAndPlay Frame Number
Hi, I'm just beginning in actionscript so I might be looking at this the wrong way!!
I have created a simple slider that gives me a variable depending on where the slider is positioned i.e. the percentage.
I then have a simple movieclip 100 frames long where a red square turns into a blue square (shape tweened then converted to key frames).
I want this movieclip to jump to whatever frame corresponds to the percentage of the slider i.e. 20% would be frame 20
100% would be frame 100 etc.
I can't work out how to assign the percentage variable as a frame number in the gotoAndPlay (or gotoAndStop).
Help!!
Thanks

View Replies !    View Related
GotoAndPlay A Frame Label Where The Frame Label Is A Variable
gotoAndPlay a frame label where the frame label is a variable


I found a cool dynamic menu that works off of arrays and have been able to modify/customize the array. Once you click on the button it sets a variable name the variable is “_root.select”

I would like to the root time line to gotoAndPlay a frame label that I have that would be the variable name


Lets say in my array I have the following
Jim
Dave
Sally
Karen

And the user selects Dave the variable “_root.select” would be Dave
I would then like the root timeline to gotoAndPlay the frame label Dave
This would fall under the Function below

nc.onRelease = function() {
// Function to get submenu actions needs to go here
var my_str:String = new String(this);
_root.select = my_str.slice(18);
_root.gotoAndPlay (what goes here)

Any Help would be appreciated

Mark

View Replies !    View Related
Make Button Go To Certain Frame Depending On What Frame Movie Is On?
I want to be able to tell a button to go to a certain frame depending on what frame the movie is on. In this flash file, I have a piece of paper moving to the top of the screen, two pieces of tape coming to tape it up, and then writing on the paper. I want to make it that if someone has already clicked on a link, and the paper and everything is on the top of the page, that the next link they click on, just goes to the frame where the writing for the page begins, and not have the paper and tape again and vice versa...

I hope this makes sense...

View Replies !    View Related
Go To A Key Frame Depending On The Month
Hello,

I am making a little calender thingy for a website I am working on and want it to automaticaly be on the current month when it loads up (I have a keyframe per month). I have been fiddling around with action script for this to no avail. Can anyone please help me?

View Replies !    View Related
Go To Frame Depending On Time?
How do I set up my document so that depending on a certain Day(number and dayname) and month an image will rotate

for example:
if the day was the first of the month one of my 3 images will rotate 10 degrees
if the date was wednesday, my second image will rotate 30 degrees
and if the month was April my third image will rotate 50 degrees

What would be the easiest way to set this up?

Thanks,
Nate

View Replies !    View Related
Change Location Depending On Variable?
Hello,

I have a 3 buttons in my movie:

Button1
Button2
Button3

If I pass a variable into my movie such as Button2=False then I do not want button2 to show for that user and would like for Button3 to shift up, like:

Button1
Button3

*I know how to put the button into a movie clip to make visable or not visable, but How would I shift Button3 up?

Thanks

View Replies !    View Related
[F8] Using A For Loop To Set A Variable Depending On MC Position
here's my question. not actually sure if i'm going about this quite the right way, but this is as far as i've got. i have a gallery of thumbnails already on the stage, each has an instance name 'w1' .. to 'w10'. they are inside of a 'strips' movieclip that i have tweening when i press on buttons. all working fine. now i want to set a variable depending on which movieclip is in the center of the viewing panel, thus the current movieclip. this is what i have:


Code:
function webSetup(){
for(var i=1; i <= 10 ;i++){
if(_root.btmNav.nav.strips["w"+i]._x == 120){
_root.currentThumb = "w"+i;
}
}
trace(_root.currentThumb);
}


and webSetup is called on the completion of each tween caused by the fwd/back buttons. this is currently returning 'w1' for each movieclip, regardless of which is in the center. my brain doesn't quite know what went wrong. i'm hoping there's a better way of doing it... can anyone help?
thanks!

emma.

View Replies !    View Related
How To Call A Variable With A Number On The End That Is Different Depending On Btn
ok i have buttons the buttons have incrementing labels then they all have descriptions and i want to make the description visible only when the button is rolled over and only that description so all the descriptions are desc0 desc1 desc2 how can i call that variable name with another variable attached to the end of it eg.

desc"i"._visible = true;

i would be the button label which would change every time you click the button i already have this part working i just need to know how to set the properties of a variable like i described above

this is the code i use to create the desc
Code:
var thmdesc = attachMovie("description","desc"+[i],getNextHighestDepth(),{_x:xtext, _y:ytext, _width:309, _height:30, label: i});
this is the code for the buttons
Code:
var thmbut = attachMovie("btn","btn"+[i],getNextHighestDepth(),{_x:btnx, _y:btny, _width:100, _height:20, label:i});
i increments

View Replies !    View Related
As3: Load Two Videos Depending On A Variable
Hi,

I have a video with different possible endings so i splitted the video:

First part:
-intro.flv

Second part:
-end1.flv
-end2.flv
-end3.flv...

I need to play the second part when the first one is finished (the user can't notice that he is playing two videos). I'll setup a variable to choose which second part is played (intro.flv + end1.flv or intro.flv + end2.flv...).

My question is:

- How can i play the first and second part continued? intro.flv+end1.flv
- Can i preload the second part when the first one is running?
- Which component / class / player do you recommend me? flvplayback, jw player?

Any guide it will be welcome. thanks!

View Replies !    View Related
Control MC Frame Depending On _ymouse
I have a MC (instance name : "navigation1"). Depending on where the _ymouse is needs to control whether it goes to nextFrame() or prevFrame(). It should only change between frame 1 and frame 20 (no loops) I cannot for the life of me figure out how one would do it but I have seen it done. Can anyone please help?

View Replies !    View Related
Subject:_ Play A MC, Depending What Frame Your On
I need a script to do the following: -

When the mouse is clicked, check the frame number,
if frame is 10 then play "test1" ,
if frame is 20, then play "test 2",
if frame is 30, then do nothing.

I have tried the code, but got stuck: -

on (release) {
if frame = 10{
_root.test1.play();
_root.gotoAndPlay(40);
}
if frame = 30{
_root.test2.play();
_root.gotoAndPlay(40);
}
if frame = 40{
Do nothing
}
}

Does anybody have a solution?

Thanks!

View Replies !    View Related
Buttons Activating MCs Depending On What Frame#s They're At
Hello all. It appeared that in here messages have capacities, so here are the 3 sequential messages...

I'm quite a newbie in flash AS though I'm trying hard to improve.
So here's my problem:

In a scene...

I have 2 MC instances, namely MCinstance1 and MCinstance2. On top of each of these, I have 2 invisible buttons, namely Button1 and Button2 on a separate layer. Finally I have 2 animations (MC instances) for each button named respectively, anim1 and anim2.

Now,

Both of the instances are at their first frames which have "stop" actions.

I want to achieve these under the circumstances below:

At the beginning, when you click on Button1, MCinstance1 (under that) has the code:


ActionScript Code:
on (release) {
    tellTarget ("MCinstance1") {
        gotoAndStop(22);
    }
}

And still at the beginning, if you click on Button2, MCinstance2 has the code:


ActionScript Code:
on (release) {
    tellTarget ("MCinstance2") {
        gotoAndStop(22);
    }
}

View Replies !    View Related
Changing Frame Depending On The Page
Hi,

I'm still a noob with Flash sadly (well, with everything except CSS to be honest lol) so bear with me...

I'm making a flash navigation which does a small animation then changes the banner (which is part of the flash) when you click on a button.

I was wondering if it's possible to get the .swf to load a certain frame (ie load a different banner) depending on what page I'm on or maybe by a variable that is set in the page (as I may need the same banner for different pages)? I'm keeping it as one .swf so I don't have to do them all separately.

So if anyone could give me a bit of guidance I'd be chuffed.

Cheers

View Replies !    View Related
Display Variable Text Depending On Score
Hiyas,

I've got a simple quiz, in which the score sits in a variable and displays the score as you go along. This all works fine!

However, I'd like to change the text at the end of a quiz, depending on what score a person got.

I'm thinking something along the lines of...

If the score is higher or equal to 8 but less than 12 (8, 9, 10, 11), display "Captain".
If the score is higher or equal to 12 but less than 15 (12, 13, 14), display "Corporal".
And so forth.
Finally, if it's equal to 15, display "General".

Sorry, I'm really tired!

View Replies !    View Related
Variable Movie Height Depending On Content
Hi - I'm creating a Flash MX site, that is hooked up to a database, which spits out various bits of content.

Is it possible to set the Movie width as a fixed amount, but the height of the movie to scale depending on the amnount of the content that is applied to a dynamic text field or other element.

Say movie width 770px, but height would be in relation to an instance name???????

Please advise, as I really do not want to use a fixed size movie with scrollable elements.

Thanks

View Replies !    View Related
[CS3] Goto And Play Depending On Variable Passed
Ok,

so i have my movie which has a form and i've successfully managed to pass a query string from a webpage to my movie which i want to display if there is an error.

Trouble is, there is a lengthy movie clip at the beginning of my form and if there is an error with the form, it's a nightmare to have the user sit through the movie each time to fill out the form correctly.

Basically what i want to say in my actionscript is:

If there is a variable passed through query string
gotoAndPlay frame labelled 'register'

I have tried the following which defines the actual value of the query string:

if (formError=="woteva") {
gotoAndPlay(register);
}

but this didn't work.

Any ideas?

Thanks in advance!

View Replies !    View Related
Function That Executes Depending On Variable Speed
hi all

I want to run a function a number of times. The amount of times it gets run should depend on a variable value. The higher the value, the more often it should run, the less the value, the less time it gets executed(if the value of the variable is 0 it shouldn't run at all) what I'm doing is making a game and the faster the user accelerates the faster objects should appear on the stage. Then the slower the user goes the less objects should appear. Ideally if the function could read it's value directly from my vy value that would be great. Anyone got an idea how I would go about this?


my code sofar:

Code:
var vy:Number = 0;
var speed:Number = .05;
var friction:Number = 0.99;

function accelerator() // gets called by an onEnterframe
{
if(Key.isDown(Key.UP))
{
vy += speed; // velocity is increased by speed
if(vy >= maxSpeed) //this little if just limits speed max
{
vy = maxSpeed;
//trace("maxspeed achieved");
}
} else if (vy <= 0.001) // this little if just prevent to much math
{
vy = 0;
}
else { vy *= friction; } if the user takes hand off friction gets applied

}
ok so that's what I've got so far. Obviously I've tried to do this on my own but since I've gotten not very far at all I've decided to not include the code seeing as it will probably just confuse you(or make you laugh)

Any ideas?

View Replies !    View Related
Starting Movie On Certain Frame Depending On Page It Is On?
Hello all,

I have a small problem. I'm creating a site with a create flash header/menu, however the menu has submenus and should display a different frame on each page it is placed on.

I.e. on site1.php the movie should display frame 10 and the links while on site2.php it should display the frame 20 and buttons from that spot in the flash movie.

I thought about givng each page a variable and in the flashfile use actionsscript to find the correct spot to disply -

if (variable == page1) {
gotoAndStop(10);
}

But I'm no flash expert and I don't know if it is possible to use variables from outside of the flash movie itself and if so how do I do it??

Any advice is highly appreciated.

Tino
Tino

View Replies !    View Related
GotoAndPlay(frame) Messing Up If Frame Is The Current Frame
I have a bug with my buttons and I am trying to figure out how to fix them. I have about 5 different buttons that will take me to different places on my website (http://www.usu.edu/drc)(don't judge me on design, I am not the greatest web designer)

Anyway, if I click on the students button it will load the students swf and take me to that frame in my mc. If I am already in the students frame, it loads the next frame in my mc instead doing nothing, which is what I want it to do. Anybody know why this is?

Now to fix the problem. I am fairly new to AS and was hardcoding my frames, but as I add frames and move things around, I have to go in and change the frame numbers, hello frame labels. Well, I now have the different frames labeled but I need to check if _currentFrame is equal to my frame label. I don't know how to do this.

What I was thinking is something like this:

if(_currentFrame.name == "students"){ don't do anything }

I don't know if this would work or if this is even the right syntax. Anybody have an idea on this one? Thanks for the help.

Jason

View Replies !    View Related
Displaying Animation When Movie Paused Depending On Frame
i am trying to display an animation when mouse is clicked (please see attached) anyone got any ideas basically if the use clicks mouse and gets 2 for 1 offer i want it to display a 2 for 1 animation

regards,

nick

View Replies !    View Related
Movie Clip Frame Depending On Mouse X Position
Hello
Well im not new too flash but this one is really stumping me.
What i want help with is a movie clip that will go to a certain frame depending on the position of the mouse's x position on the stage.

Thanks in advance guys

View Replies !    View Related
Trying To Script Nav To Lead Different Places Depending On Current Frame
I'm trying to get my nav bar (a movie clip) to lead to different places, depending on what frame the main timeline is on. I'm pretty bad at actionscripting, but it seems there should be some kind of "if_currentframe=1) gotoAndPlay (xframe)" . Obviously thats not code, i realize, but it seems there should be something using that kind of vocabulary, no?

Also, anyone recommend any good books on understanding actionscript better?

Thanks!

Holden

View Replies !    View Related
How To Goto Frame Depending On Flash Player Version.
hello, can some one tell me how to script in action script to detect what flash player a user has then goto and stop at a specific frame depending on the version.

Bassically i want to detect the flash player with actionscript, if it is version 8 and above then goto and stop on frame 2 or if below version 8 then goto and stop on frame 3

your input on this would be very grateful. Thanks

View Replies !    View Related
Resize Flash Size Depending On Wich Frame
Title says it all.
Depending on wich frame the user is, I want to resize the flash so he don't get a scroll bar when he don't have to.

Any solution to bypass this is welcome !
Thx guys :-)

View Replies !    View Related
Button Linking To Multiple URLs Depending On Frame
In essence: How do I make a button, depending on frame, connect to different URLs?

I am trying to create a small banner for a webpage. The banner will cycle through a number of images (each one has its own frame). I have placed an invisible button over it, covering the entire image, so when the image is clicked anywhere it goes to the code, with this code:

uno_btn.addEventListener(MouseEvent.CLICK, buttonClickHandler);
function buttonClickHandler (event:MouseEvent):void {
navigateToURL (new URLRequest ("

View Replies !    View Related
How To Change Color Of Dynamic Text Depending On Variable? Help Needed
I want to change the color of a dynamic text box depending on the variable's value.

For example, I have a dynamic text variable named "status1" which has a value that is loaded from a text file. If the value is "Yes" of status1, then I want to the color of status to be GREEN, if the value is "No", then I want to color to be RED.

Here is what I have right now (though it doesn't seem to work):

loadVariablesNum("data.txt", 0);
//THIS IS THE DATA INPUT FILE
if (status1 == "no") {
_root.status1.color = green;
}

Thanks.

View Replies !    View Related
Want Button To Send Info To Specific Php Script Depending On A Variable
So I have a form with a few fields that are mandatory, for which I'd like an error message (EmailStatus) to pop up if they are blank when the submit button is pressed. If all of the fields are filled in, the user can select to subscribe(wanna=1) or unsubscribe(wanna=0). When the submit button is pressed, I want it to check that all of the fields have been entered (if no: spit out the error message), and then check the subscribe or unsubscribe value, and send the info to the appropriate script (the script for subscribe is partAscript.php; unsubscribe is remove.php). Below is the code I have made for my submit button which does not work. Please help!



on (release) {
if (!enterEmail.length || enterEmail.indexOf("@") == -1 || enterEmail.indexOf(".") == -1) {
EmailStatus = "Please enter an E-mail address";
} else if (!FirstName.length) {
EmailStatus = "Please enter your first name.";
} else if (!enterPhoneA.length) {
EmailStatus = "Please enter your telephone number.";
} else if (!enterPhoneB.length) {
EmailStatus = "Please enter your telephone number.";
}else if (!LastName.length) {
EmailStatus = "Please enter your last name.";
} else if (!enterCity.length) {
EmailStatus = "Please enter the city in which you live.";
}
if (wanna=1) {
loadVariablesNum ("partAscript.php", 0, "POST");
EmailStatus = "Sending form";
output = "I would like to enter";
} else {
loadVariablesNum ("remove.php", 0, "POST");
EmailStatus = "Sending form";
output = "I would like to be removed";

}
}



Thanks in advance for any help.

View Replies !    View Related
[CS3] GotoAndPlay Exeption (example: If MC1 Frame 30 Is Loaded, Play MC2 Frame 5)
Hi, for a long time i've been struggling to achieve this effect, that is an action script that would allow me to make an exeption. i playes with variables and stuff but i never got it right:/

i have a button, and i have an action assigned to it:

menubutton2.onRelease = function():Void {

content2.gotoAndPlay(2);

IF content3 is on frame 10, i want it to play content3 frame 15,
IF content3 is on frame 1, i dont want it to do anything with content3

};

If only AS could be that easy....

if anyone could help me with this one i would feel relieved... thanks in advance

View Replies !    View Related
GotoAndPlay X-frame Of MC When Another MC Reaches Y-frame
Hi,

how can I gotoAndPlay x-frame of MC when another MC reaches y-frame?

Thanks for help!

View Replies !    View Related
GotoAndPlay X-frame Of MC When Another MC Reaches Y-frame
Hi,

how can I gotoAndPlay x-frame of MC when another MC reaches y-frame?

Thanks for help!

View Replies !    View Related
GotoAndPlay ('Variable')
hey there,
another question about variables..

I want a target to play a certain frame which is randomed:

tellTarget ("/targetname") {
gotoAndPlay ('randomNumber')
}

but this does not work!

Can anyone help me out?

View Replies !    View Related
GotoAndPlay( Variable )
Hey,

I have a movieclip named 'screengrabs' in which the first frame is empty and the other frames all contain a screengrab. So now I want to jump to a certain framenumber, but the framenumber has to be a varible...

As far as I understand I have to use gotoAndPlay and the select 'Expression' in the droplist for 'type' and then put an expression in the 'Frame' field. I've tried both a number and a name which I've also assigned to the keyframes in the mc 'screengrabs' but it doesn't work.

This is the code that I have:

frame = "sc_" +(cur_active + 1);
tellTarget ("_root.screengrabs") {
gotoAndPlay (frame);
}

cur_active is a number and I have named the keyframes 'sc_2', 'sc_3' etc.

I have also tried something like:

frame = cur_active + 1;
tellTarget ("_root.screengrabs") {
gotoAndPlay (frame);
}

But that doesn't work either

Any thoughts??

Thanks, Pascal

View Replies !    View Related
GotoAndPlay Variable
How do I make a gotoAndPlay variable?

Eg. if I set the variable:

thumbnail = "part1";

how do I get the gotoAndPlay command to go to "part1"? I've already tried using the expression:

gotoAndPlay (part1);

but that doesn't work.

Thanks in advance,
:: ampdeck

View Replies !    View Related
GotoAndPlay (variable)
I'm trying to set a variable and then have a movie clip gotoAndPlay a frame with a label of the variable value. Something like this:

on (rollOver) {
set ("nextframe", "frame_name");
tellTarget ("/movie_clip") {
gotoAndPlay (nextframe);
}
}

but nothing happens. I can't tell if the variable is not getting set, or if the gotoAndPlay doesn't recognize the variable, or what... any ideas?

View Replies !    View Related
GotoAndPlay W/ Variable
I am trying to play a MC from a dropdown menu button based on a variable. Why doesn't this play?

In _root, I have:
loadMovieNum ("bgsoundloop.swf", 1);
var played;
var clip;
played = "no";
clip = "clip0";

In dropdown menu clip, I have this code on the button
[(checks if any MC has played yet, if so, it finishes the clip, then it plays the current clip(from the last frame of the clip)] :

on (release) {
if (_root.clip == "clip1") {
continue;
} else if (_root.played == "yes") {
_root.clip.gotoAndPlay("end");
} else {
_root.clip1.gotoAndPlay("play");
}
}
on (release) {
_root.played = "yes";
_root.clip = "clip1";
}

This code is in the last frame of each clip (clip1, clip2, etc.):
_root.clip.gotoAndPlay("play");

I have struggled to get this far....please help a drowning man!

View Replies !    View Related
GotoAndPlay......variable
HI,

I have a variable (f_n0) which contains an integer.

Im trying to get a button to jump to a particular frame number in the previous scene by by using:

on (release) {
gotoAndStop("previous_scene_name", f_no);
}

but its doing my head in as it is not working....

Is there a way around this? I have seen some earlier post re: this problem, but im not sure if they were ever resolved..

Arigato...

View Replies !    View Related
Variable Use In GotoAndPlay();
I need a bit of advice, I have a function, that is evaluating variables and based on the variables, tells it where to go in the move. The issue I am having is how do I assign the MC name for the gotoAndPlay command based on the variables.

code:
function menuEval();{
if (currentSection==newSection);{

} else
_parent.(I need this to be the variable currentSection).gotoAndPlay("rollout");
_parent.(I need this to be the variable newSection).gotoAndPlay("rollover");
currentSection= newSection;
}
}


Can I do it just by putting the variable name in the gotoAndPlay statement? ie

code:
else
_parent.currentSection.gotoAndPlay("rollout");
_parent.newSection.gotoAndPlay("rollover");
currentSection= newSection;


Or is there a better way to do this? Thank you in advance for the help.

View Replies !    View Related
Using A Variable With GotoAndPlay
I'm trying to use a variable with gotoAndPlay. The object is to avoid animating multiple transitions, so when a user clicks on a button, it sets a variable (the name of the desired scene) and then goes to the next frame in the current scene and finishes the animation. Then on the last frame of the animation, I want to tell it to go to the scene defined in the variable.

The problem I'm having is that the scene name in the gotoAndPlay command is required to be in quotes, but if I put it in quotes, that tells it to go to a scene named my variable rather than a scene named the value in my variable.

It is set up like this. Variable is called "trans" and I set it to sc3, the name of my third scene.

Frame 1 actions:
var trans;
stop();

Button action:
on (press) {
trans = "sc3";
}
on (release) {
gotoAndPlay(2);
}

Frame 5 action
gotoAndPlay(trans, 1);

I've also tried this for Frame 5:
trans();

Any suggestions on how to do this would be much appreciated.
Thanks,
Doc

View Replies !    View Related
Variable And GotoAndPlay
I get a variable test from a php-script. The script gives test=1 back. In my flashfile is a dynamic text which prints this, but...
I'm also using an actionscript that has to detect this 1 and stays in a loop (frame 1, frame 2, frame 1, ...) until the 1 is detected, then it has to go to frame 3. But it doesn't detect the 1 although it is printed in the dynamic textarea with variable test. How to solve this?

on frame 2:
if(test=="1")
{gotoAndPlay(3);}
else
{gotoAndPlay(1);}

View Replies !    View Related
GotoAndPlay(variable) ? Is This Possible?
I'm just trying to learn actionscript and I'm running into a problem. I am trying to define a variable to be (24- _currentframe) of a MC. Then I want the animation to gotoAndPlay(theabovementionedvariable)

is this possible? do i need to write it another way? as far as i can tell, the gotoAndPlay command needs a frame number, not a variable in it.

any help is much appreciated!

thanks in advance.

nstokes

View Replies !    View Related
How To GotoAndPlay (variable) ?
I'm testing something out for a site, so I created a simple flash movie.

I have 2 scenes, 'scene 1' and 'scene 2'. And I have a movie clip called 'nav'.

In 'scene 1' I placed the nav movie clip, and on the frame I put this code:

stop();
var frame = "green";

then, a gaphic symbol in the nav has this code:

on (release) {
_root.gotoAndPlay("start");
}

where start is a frame label in 'scene 2'.

so when the user presses the button it goes to the 'start' frame (which is the first frame) in 'scene 2' and plays until it reaches a frame with this action:

stop();
gotoAndPlay(_root.frame);

at which point it should jump to the frame labeled 'green', but this code does not work. Does anyone know the correct way to code this????

I know you can do it with numbers, but I'm trying to do it with strings so its easier to navigate through timelines.

View Replies !    View Related
Help Variable Gotoandplay
i have got a veriable called greenreload and it goes up by 1 everytime a gun fires, when the variable goes to 2, i want it to gotoandplay the frame whicih is labeled third,

but nothing happerns when the variable gets to 2

heres the script

if (_root.greenreload == 2){
with (lasergun.greenlasergun.greenreloadbar){
gotoAndplay ("third");
}
}

can someone please help.

jason

View Replies !    View Related
[F8] GotoAndPlay (Variable), Is It Possible?
can i write

gotoAndPlay (Variable);

where the variable tells the code the name of the frame lable?

(does this make sense?)

View Replies !    View Related
Variable.gotoAndPlay(); How To Do It?
I'm trying to get this kind of script to work
_root.enemy[_global.variable].gotoAndPlay(8);
but it doesn't

This is inside a different MC(MC1) and I want another MC(MC2) to gotoandplay() when this frame is played on the MC1.
I need a variable there too because the engine names the MC2s enemy[variable].

View Replies !    View Related
Variable With GotoAndPlay
Hello

I have a variable that I've called "apples" and I want to use that to start a mc and I don't know how to do it. How can I get "apples" in to gotoAndPlay. I've tried with gotoAndPlay ("apples"); but it doesn't work. Can anyone help me?

Anders

View Replies !    View Related
GotoAndPlay(variable); ?
Is there such thing? Because I've tried it, and it does not work.
I have something like:

_root.memory = _currentframe();

and somewhere else have

gotoAndPlay(_root.memory);

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved