ActionScript 2.0 :: Write A GotoAndPlay With The Addition Of A Variable?

Nov 25, 2009

So I've defined my variable:_global.current = 1;And below i am accessing an MC called 'carousel_holder', which has an MC named 'bar' and inside this MC is a final MC named 'bar1'.So ive tested my path and can hard code it fine, so its not a paths issue but i think my syntax is incorrect:_root.carousel_holder+".bar"+current.gotoAndPlay(" start");

View 4 Replies


Similar Posts:


ActionScript 2.0 :: Write A If Statement That Will GotoAndPlay According To That Variable?

Sep 22, 2005

In my movie I load a swf to a movieclip with this code


PHP Code:

 _root.ImageViewer.loadMovie("deneme.swf"); 

Now can I do this? before calling the swf named deneme. When I press a button If I attain a number to a global variable with this code

PHP Code: on (release) {_global.myVar = 5;gotoAndPlay("CloseUpAnimation");} 

Can I read this variable from the swf which I load into my movie?If I can read how can I write a If Statement that will gotoAndPlay according to that variable?

PHP Code:[code]...

View 4 Replies

ActionScript 2.0 :: Write A Function That If Some Movie Clips Are In Some X And Y Value Then GotoAndPlay('end');?

Sep 6, 2007

I would like some help on writing a piece of code.I need to write a function that if some movie clips are in some x and y value, then gotoAndPlay('end');

Code:

function gotoEnd() {
if
(tv_mc._x = 41.8;
tv_mc._y = 157.3;)
then
gotoAndPlay('end');
}

View 5 Replies

ActionScript 3.0 :: Flash GotoAndPlay- Write The Code To Play The Movie After 1 Minute Of The Page Load?

Jul 14, 2011

How can I mention in the actionscript 3 that the movie clip on frame no. 10 should play after the webpage loads (or after 1 minute)? then stops? The code would be on Frame no. 1.

View 3 Replies

String Variable With GotoAndPlay?

Apr 8, 2009

I am trying to go about a "smarter" way of setting up multi paged full flash sites. This has got to be something very simple that i can't seem to put my finger on.

I'm trying to create a variable called 'currentScen' that i can declare off the start and change depending on what page the viewer goes to in the site.

I could put a bunch of 'if' statements saying that 'if the current page is this page then do this, if it's this page do this' etc. for each individual page but i thought there must be an easier way.

I am trying to get the following to work:

Code:

// declaring what the starting page is
var currentScen:String = "welcomeMovie";
//function fading in called page with animation used on the 'over' frame label
function animateOn(page:String) {

[Code].....

View 1 Replies

ActionScript 2.0 :: Using Variable In GotoAndPlay?

Sep 21, 2005

Im working on a flash menu right now and I wan to create a dynamic gotoAndPlay. but I need to insert a variable into the target path right now here is what Im doing.

Code:
MyVar="FirstMC";
_root.Nav.MyVar.gotoAndPlay("out");

and right now Flash doesn know what to do with it... I would like to make this variable global also which is nothing more than throwing the _global command before my variable right?

View 2 Replies

ActionScript 2.0 :: CS3 Using Variables Value In Variable.gotoAndPlay Instead Of Its Name?

Jul 19, 2009

for (var i=1; i<=arrayCount; i++){
var temp:String = "editremove_mc";
temp += i;

[code].....

View 2 Replies

ActionScript 2.0 :: On Release, Set Variable And Gotoandplay?

May 2, 2011

Haven't touched Flash in years... trying to do something simple, but it isn't working well. Guess I'm REALLY rusty. I have a flash video with 3 button. Initially, I set a variable (frame 2)

Code:
var x = 0; Then I have the 3 buttons. One of the buttons has the following code (the two other buttons have similar code, but set different variables)

[Code]...

View 4 Replies

ActionScript 2.0 :: Include A Variable In Gotoandplay();?

Feb 23, 2004

I try to include a variable in gotoandplay(); like:

on (press) {
gotoAndPlay(_root.strScene, 1);
}

it gives me an error and say it must be quted, i tryed everything and im sick of it and i will breack my pc

View 1 Replies

ActionScript 2.0 :: Using One Variable To Write To Another

Dec 3, 2011

I need to have one variable contain the name of another variable so I can write the actual value using either variable.

On my main timeline I have this code:
var globalvariable = "blank";
On a movieclip I have this code:
on (press) {
var testsend = name._root.globalvariable;
testsend = "IT WORKS!";
trace(_root.globalvariable);
}

I'd like the trace to read "IT WORKS!" but it's always "blank". The reason for this is that I have a controls options page where users can change their key binding for the various controls of a game. There is a list of the actions in the game with a field for the currently assigned keyboard shortcut. When they press that field, it's a button that pops up a keyboard graphic which has buttons on it for every key. Clicking one of those buttons should assign that keyboard equivalent to the corresponding field.

So I want to have something like this actually work:
Click the MoveFowards field and click "Spacebar" on the keyboard graphic and now _root.Moveforwards has a value of "Spacebar".
Click the Jump field and click "Spacebar" on the keyboard graphic and now _root.Jump has a value of "Spacebar".
Click the Shoot field and click "Spacebar" on the keyboard graphic and now _root.Shoot has a value of "Spacebar".
So I need to pass the name of the variable to the keyboard graphic so that it outputs to the correct global variable and writes its output to the correct field.

View 3 Replies

ActionScript 2.0 :: GotoAndPlay(frame); Depending On A Variable From Php?

Apr 28, 2004

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.

View 5 Replies

ActionScript 2.0 :: Coding GotoAndPlay Variable Enemie_life Drops

Mar 25, 2012

I have trouble with a script for my game project. I can't figure out what I'm doing wrong. This is the code I'm using:

[Code].....

Now, if the variable enemie_life drops to 0 (which I'm tracking with a dynamic text box) it just ignores frame 241 and continues with the second part of the code. There I have another problem: from my understanding (and the way I'd like it to be) it should give me a 3/1 chance to go to 126 and otherwise go to 181. The latter almost never happens. It seems more like a 100/1 chance (and I tried it often ...).

View 6 Replies

ActionScript 1/2 :: Write / Read An External Variable?

Jul 9, 2009

I currently have a flash video player and I want to add some code that will update a variable in an external .as or .txt file. I then want to be able to pull this variable into a different .swf when required.
 
My variable I want to create will be CurrentVideo and it needs to be a number e.g. _global.CurrentVideo = 2

View 1 Replies

ActionScript 3.0 :: Write A For Loop For These Variable Declarations?

Mar 28, 2010

I want to simplify my coding of the below code: 
 
var printImage1:MovieClip = new PrintImage1();var printImage2:MovieClip = new PrintImage2();var printImage3:MovieClip = new PrintImage3();var printImage4:MovieClip = new PrintImage4();var printImage5:MovieClip = new PrintImage5();var printImage6:MovieClip = new PrintImage6();
  
I tried everything I could think of but it still gives me compiling errors.

View 5 Replies

ActionScript 2.0 :: Variable Reaches 0 GotoAndPlay Frame 4 - Doesn't Work

Jul 12, 2009

When a variable reaches 0 gotoAndPlay frame 4

ActionScript Code:
//Variable Name: ammo
if(_root.ammo = 0;
_root.gotoAndPlay(4);

Doesn't work maybe?

View 1 Replies

ActionScript 2.0 :: Write To A Global Variable When In Specific Frame

Jan 27, 2009

When the value of _root.mc1._currentframe is 10 I want the value of _root.mc2._currentframe to be written (sent or changed) to a variable which I can use in mc1. So I want to be able to use this variable in different clips but I do not want it to be changed until the playhead in mc1 is in frame 10. However I do want the variable to be valid even if the playhead is not in frame 10.[code]

View 2 Replies

ActionScript 3.0 :: Flash - What's The Difference When Write A Temporary Variable

Nov 11, 2011

I would like to know what's the difference when I write a temporary variable like this (these are just examples): version1

[Code]...

What's wrong and right? Currently I write it like version 2 and I'm not sure if I should change it to version 1. I know most developers write like version 1 but I'm a little bit confused because I am totally unaware about version 1. If I use version 1 does that mean that my value is stored explicitly in a temporary variable that is cleared in every cycle?

View 3 Replies

ActionScript 3.0 :: Write A Function That Is Used By Multiple Buttons And Accepts A Variable?

Feb 11, 2009

i want to write a function that is used by multiple buttons and accepts a variable when it is called by a given listener..

ActionScript Code: this.fileBTN.addEventListener(MouseEvent.MOUSE_OVER, menuSet("fileMenu"));
function menuSet(what:String){
trace(what);//should trace back "fileMenu"
}

View 7 Replies

ActionScript 2.0 :: Goto And Play Scene - _root.gotoandplay And Even Scene1.gotoandplay Won't Work?

Nov 9, 2007

For 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]...

View 1 Replies

ActionScript 2.0 :: Addition Of Two Strings?

Mar 11, 2010

Here we go... i know, that i have to CAST them... but how? The idea is to add (adition) two strings...

a:String = "20";
b:String = "10";
c:String = a+b;

I get c=2010 and not 30 as i expected... i guess i have to cast, but how?

View 1 Replies

ActionScript 3.0 :: Addition Using Input Text Fld

Feb 17, 2011

i want to add two numbers, which has entered in two input text fields.[code]here if i entered 3 in one text field and 2 in another text field. the result is comming like 32. It should be "5".

View 4 Replies

ActionScript 3.0 :: Addition Of 2 Colors (hex Values)?

Jun 28, 2010

I am trying to figure out a way to add 2 colors (hex values) to generate a new color.I am not sure as to how this can be computed. Is the new color an average of the hex values of the 2 colors?

View 7 Replies

Actionscript 3 :: How To Do Flex Date Deduction And Addition

Jun 23, 2010

In flex, I am trying to do date deduction and addition, but couldn't find a way to do it.

e.g.: public var dateNow:Date=new Date();

How can I get the Date 3 months earlier than dateNow?

View 4 Replies

Flex :: Avoid The HorizontalScrollBar Addition To Container?

Aug 3, 2011

if container like VBox have autoScrollPolicy for both scrolls. if VerticalScrollBar is added, why the horizontalScrollBar automatically added.. is there any option to avoid the horizontalScrollBar addition to container.. without using horizontalScrollPolicy="off"

View 1 Replies

Actionscript :: Call A Function On Addition Of New Row In List And Not Afterwards

Feb 5, 2012

I have created an item renderer spark list in flex , but i want to call a function on addition of new row in list and not afterwards. I am getting a data object in rendered list in it i am getting the type of data to be displayed in list ie. either text or image. So on addition of new data in list i want a function to be called up in rendered list that checks the type of data received and then it will either create and add an image element or a text element. So the main problem is how i get a function called on addition of data. I have tried events like datachange and added but they keep on calling the function over and over again when we scroll the list but i want the function to be called once only on addition of data and not after wards. Below is the renderer list code , maybe you will get a better idea of what i am trying to do:

[Code]...

View 1 Replies

ActionScript 3.0 :: Number Addition On Data Change?

Aug 17, 2011

how can I add number to a current variable in actionscript. My variable has data coming though php(numeric data) so I want to create an if statement to say this:

If the data number(let's use 5) is equal to 5+any number then do something.

Should be pretty simple but I can't seem to figure it out right now, how can I say "any number" with code?

ActionScript Code:
if(myVar == myVar+1){
//do something;
}

Thing is the + number is uknown... so + 1 may not work cause the number may be higher than 1.

View 4 Replies

ActionScript 2.0 :: Dynamic Addition Of Images In Flash Using Xml?

May 7, 2007

how to put the images deynamically into flash-the complete procedure. what all is to be done in flash n xml n how to connect them properly.

View 1 Replies

ActionScript 2.0 :: Arithmetic Addition; Joining, Not Adding?

Oct 20, 2004

I am trying to add two variables, but my AS is joining them

volume1=function(answer1){
aa=wtft*12;
aaa=wtin;[code]....

There is more to this script, but I cut it down to this in order to focus on the error, which results in a joining aa and aaa. i.e. aa=36 aaa=4 results in a=364, where what I want would be a=40

View 5 Replies

ActionScript 2.0 :: Addition - Get Two Numbers To Add And Instead It Is Concatenating Them Together As A String?

Mar 29, 2005

has anyone had any problems with addition? I'm trying to get two numbers to add and instead it is concatenating them together as a string, however when I multiply, divide, or even subtract them it works fine.

View 10 Replies

Actionscript :: Read XML And Write On List Write?

Oct 25, 2011

I'm trying to read a XML file and output the values, but i'm getting a 1120: Access of undefined property URLRequest. error.

[Code]...

View 2 Replies







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