ActionScript 2.0 :: Whats The Correct Syntax For Declaring A Variable Thats Name Changes According To A Different Variable

Dec 21, 2007

I'm trying to do something like this:

[Code]....

whats the correct syntax for declaring a variable thats name changes according to a different variable.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Correct Syntax For Declaring A Variable Within A Loop?

Mar 25, 2007

Whats the correct syntax for declaring a variable within a loop? Something like this:[code]

View 1 Replies

CS3 Declaring A Variable?

Dec 14, 2011

What I want to achieve is pretty basic: I have an input text with instance name (contact_date) and I want the information the user enter in this input field to be kept in a variable that I can reuse later on in my movie.

View 2 Replies

ActionScript 3.0 :: Use A Variable When Declaring It?

May 28, 2010

I have 26 buttons in my library named BUTNA, BUTNB, BUTNC, etc. all the way to BUTNZ.

I want the script to pick a random button from the library and place it on the stage.

I am probably doing this wrong, but I am lost.In my script, I need the variable btnp1 in place of BUTNZ in line 8.I don't know how to do this.[code]...

View 4 Replies

ActionScript 3.0 :: Declaring A Variable On A Sprite?

Sep 22, 2009

in as2 you used to be able to just declare a variable on a movieclip something line myMC.newvar= "something". this does not seem to work in as3 I get undefined property. Am I missing something on how to dynamically declare variables to sprites and movieclips?

View 6 Replies

ActionScript 3.0 :: Error When Declaring Variable

May 18, 2010

I'm trying to trigger a public var which is located in an external class but can't trigger them from my Main class.[url]...

View 2 Replies

Actionscript 3.0 :: Error While Declaring Same Variable Twice

Mar 13, 2009

I have several movieclips that I exported to actionscript from the library (c01,c02,c03,...)In the actions I have a conditional that checks a variable and depending on the variable provided I want to create a new instance of that movieclip. For example if cityY==1 then I want to create a new c01.

I tried with conditional and with a switch/case but I get an error declaring the newCity variable more than once.[code]...

View 1 Replies

ActionScript 2.0 :: What Is The Difference Between Declaring A Variable

Jul 14, 2008

What is the difference between declaring a variable like this: variable = 1; and declaring it like this: var variable:Number = 1? Why is it better to use the second way?

View 4 Replies

ActionScript 2.0 :: Declaring Strings And Numbers In A Variable

Jun 25, 2009

Im using a tween engine, and its syntax for use is as follows::

[Code].....

How can I write "_x",100,1,"easeout",0,callback as a string?? I have tried to put "these" around the text. The problem seems to be that "_x" and "easeout" which are effectively strings inside the string! -- but for the tween engine to work - I need to declare that.

View 2 Replies

IDE :: Declaring Dual Object/variable Type?

Oct 23, 2009

I'm trying to find information in how or if it it possible to declare a Variable Type that can accomodate 1 of 2 different Types In this particular case I'd like to set a Variable able to accept either Integrals or Strings I know i Can use a wildcard as below and it works, but it also allows for any other type to be added.

private var _destination:*;

My first Thought was something like this

private var _destination:String^int;
private var _destination:String|int;

Unfortunatly this does not work

View 4 Replies

ActionScript 2.0 :: Flash8 Declaring A Unique Variable In A Function

Mar 18, 2009

I'm trying to create a unique variable and reference to it with myRewind for some button functions.

I'm trying to create this rewind+variable as the unique identifier but it just seems to be using myRewind as the variable and overwriting it.

Code:

//Setup subsection rollovers
function createRollover(myContainer, rollName) {
btnName = rollName+"_btn";
mcName = rollName+"_mc";

[Code]....

View 2 Replies

ActionScript 3.0 :: Send A Value From One Of My Xml Nodes (<marker>) By Declaring It In A Function 'showData' As A Variable 'XMLMarker'?

Jul 30, 2009

I am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip...please see the 'PROBLEM' stated in the code below.

[Code]....

View 0 Replies

ActionScript 3.0 :: Way To Alter The Contents Of A DOT Syntax Variable?

Oct 14, 2011

I'm trying to build a little question/answer program in flash using XML data as the source of information.I'm trying to build it in such a way that I only have to alter the XML, not the .as files.So, for example, I have

ActionScript Code:
ui.question_txt.text = xmlData.question1.question;
ui.optionA_txt.text = xmlData.question1.optionA;

[code]....

View 1 Replies

ActionScript 2.0 :: Bracket Syntax Looping Through A Variable?

Oct 25, 2007

I'm trying to express this syntax:

Code:
container0.picture._alpha = 0;
by looping through a variable named "p", like this:

Code:
["container"+p]picture._alpha = 0;

But I get no result (and no error message).

View 8 Replies

ActionScript 3.0 :: Syntax Error #1065: Variable TCMText Is Not Defined

Jul 18, 2011

Alright here's my code :

[Code]...

After I run it gives me these two errors : Scene 1, Layer 'actions', Frame 1, Line 25 1084: Syntax error: expecting rightparen before colon. Scene 1, Layer 'actions', Frame 1, Line 27 1084: Syntax error: expecting rightparen before colon. Also in the output tab I get these errors : ReferenceError: Error #1065: Variable TLFTextField is not defined. ReferenceError: Error #1065: Variable TCMText is not defined. I've been trying to figure this out for about 30 minutes but wasn't able to.

View 3 Replies

ActionScript 2.0 :: Adding A Variable To A GetURL Line (correct Way To Code It)?

Jun 13, 2006

all I want to do is add a variable to a getURL line of code.EG:getURL("/index.asp", "_self");I need to add a variable (_root.myvariable) to the end of the link so that it goes to:index.asp?myvar=thevalueofmyvariable

View 3 Replies

ActionScript 3.0 :: Declaring A Variable In A Function: Either The Function Or The EventListener - Doesn't Work

Nov 27, 2009

I have a set of Cue Points in an FLV I'm playing. It's an interactive quiz, so the idea is that flash will change a variable, theAnswer, to a different letter depending on which question it is. The answer to question 1 is B, question 2 is D, etc. Either the cue point event listener isn't working, or else it is working and Flash isn't declaring the variables. 1120: Access of undefined property theAnswer. I literally can't find a single problem with my code. I have an almost identical Event Listener further down which works.

[Code]...

View 4 Replies

ActionScript 3.0 :: Function Returning Array And Declaring A Function With Event And Variable?

Jul 27, 2009

is it possible to declare function this way

ActionScript Code:
function startShake(e:MouseEvent, num1, num2):void

what i mean is it possible to send to the function not only en event but also a variable and a second question how can i access

ActionScript Code:
function stopShake(e:MouseEvent):Array

this array that function return.

View 1 Replies

Actionscript 3 :: Correct Way Of Making Variable Accessible To A Child Class / Object

Mar 4, 2011

When you initialize a new object, how can that class have access to a variable from the parent?In this case Blob needs to be able to access scale?[code]

View 2 Replies

ActionScript 2.0 :: Use "_root" When Declaring A Variable?

Feb 10, 2010

i want to access variables from within movie clips, and my question is, when declaring variables from the root, is it necessary to add the _root? e.g.:

Code: var _root.imgSource:String = "img001.jpg"; or would it be sufficient to declare the variable in the root timeline, then refer to it in child clips as _root.imgSource?

View 7 Replies

ActionScript 3.0 :: Declaring A Variable Inside A Function To Use Outside The Function?

May 5, 2011

I want to create a vector, then call a function that populates that vector with arrays. Fine. The only catch is the function itself will declare new array variables to put into the vector, but are these new array variables private to the function only?e.g. something like this

ActionScript Code:
public var vec:Vector.<Array> = new Vector.<Array>();
private function populateVec():void {

[code]....

Is this "kosher"? a was declared in the private function but added to something outside the function..?

View 4 Replies

ActionScript 2.0 :: F5 - "If The Variable Is Correct AND If It Is Dropped On The Target (g_target) THEN Play The Movie?

Nov 7, 2002

I have an if like this:

on (release) {
stopDrag ();
if (_root.go_blue._droptarget == "/g_target")[code]...

This works. I need to add "if (test = "one")", another drop sets this variable and the drop above should test for it. But I can't get the basics right! I'm a programmer who is new to Actionscript. What I want is:

"If the variable is correct AND if it is dropped on the target (g_target) THEN play the movie, ELSE go back to _x=130, _y=300."

The variable is being assigned correctly, I tested it with a Dynamic text box. The movie isn't running with my code!

View 1 Replies

ActionScript 2.0 :: Create A String Variable...and Then Use The Value Of That Variable To Declare Another Variable?

Jan 3, 2006

f you know PHP...then you know that you can create a string variable...and then use the value of that variable to declare another variable. like this:

PHP Code:

<?php$foo = "haha";$i{$foo} = "success";print $i{haha};?>

and it would display "success"...or like this:

PHP Code:

<?php$foo = "haha";$$foo = "success";print $haha;?>

and it would also display "success".

View 6 Replies

Actionscript 3 :: Declaring Variable In Loop Or Before Loop?

Nov 9, 2010

Should I declare the _mcContainer var before the loop or no? (performance increase?)

for(var i:uint = _startIndex; i <= _endIndex; ++i){
var _mcContainer:MovieClip = _mcParent["i_" + _position];
}

[Code]....

View 1 Replies

ActionScript 3.0 :: Correct Syntax For Referencing Array?

Sep 6, 2011

I have a number of XMLList objects:
 
_xml.group1..image[i]
_xml.group2..image[i]
_xml.group3..image[i]
_xml.group4..image[i]
_xml.group5..image[i]
 Im trying to reference each object thus:
_xml.group[myVariable]..image[i]
 
But it doesnt work. What's the correct syntax?

View 3 Replies

ActionScript 2.0 :: Correct Syntax For Passing 2 Values?

Apr 3, 2006

is this correct:

getURL("webform1.aspx?id=0&status=I",0,"Get");

I need to pass 2 values

value 1 is id
value 2 is status

View 2 Replies

ActionScript 3.0 :: Variable Take Away Another Variable Which Makes Answer1 Variable

May 15, 2011

i have a variable take away another variable which makes answer1 variable i then want answer1 to be to the power of another variable how can i do this in flash

View 5 Replies

ActionScript 3.0 :: Correct Syntax To AddChild() Using Array Index

Jul 27, 2009

I'm using addChild(new nmonster()) to populate an on stage MC from my Library.

Instead of specifying the Symbol, I want to add it using an Array reference, like addChild(new monsterArray[0]()). I've tried a number of variations, but AS3.0 is unforgiving.

View 4 Replies

ActionScript 2.0 :: CS3 On Variable="Correct" Go To Frame 147?

Feb 24, 2010

I have the following code which basically drags this circle around and if put on the right symbol "bow", then variable answer1="Correct" and this is displayed in a dynamic text field.

Now I also need to make it so if variable answer1="Correct", in other words if the circle was dragged to the right location, to go to frame 147 or just resume playing. I don't care about what happens to the dragged circle afterwards. I'm using the following code:

[Code]...

View 2 Replies

ActionScript 2.0 :: Variable + Variable = Variable. Sort Of?

Aug 29, 2007

Code:
var fruit1:String = "apples";
var fruit2:String = "oranges";
var fruit3:String = "grapes";[code]....

I need the variable fruit1, but for reasons I don't have time to get into, I don't know how to parse these two variables to make a parseable variable.

View 1 Replies







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