ActionScript 2.0 :: Referring To Variable LoadVar Dynamically?

Mar 31, 2004

I am reading a file with certain user defined variables like &x=30&y=50&z=100

Lets the variable is caught in a function as argument myVar

now depending on the variable the user passes I need to fetch the value. ie if the user passes x i need to read the value of x. how the user has named his/her variables.

What i need to do it get the value of that variable by using loadVar.

this.myVar; As such it gives me undefined. There is text present in 'this' myVar represents 'x' I have tried eval(this.myVar) as well as this.eval(myVar) but in vain

View 5 Replies


Similar Posts:


ActionScript 2.0 :: Refering To Variable LoadVar Dynamically?

Mar 31, 2004

I am reading a file with certain user defined variables like &x=30&y=50&z=100Lets the variable is caught in a function as argument myVarnow depending on the variable the user passes I need to fetch the value. ie if the user passes x i need to read the value of x.lso keep in mind i dont havehow the user has named his/her variables.What i need to do it get the value of that variable by using loadVar.this.myVar;As such it gives me undefined. There is text present in 'this' myVar represents 'x'I have tried eval(this.myVar) as well as this.eval(myVar) but in vain

View 5 Replies

ActionScript 2.0 :: Loadvar And Scope Variable?

Jul 1, 2004

I add this actionscript code on the first frame. Variables are loaded but . The question is below the code.

var myArray1=new Array()
var myArray2=new Array()
var myArray3=new Array()
function showContent() {

[Code]...

View 2 Replies

ActionScript 3.0 :: Dynamically Naming/referring To Movieclips?

Feb 15, 2010

I am going to have a button that when you click on it it creates a movieclip and adds a certain child to it (In this case, its linkage is set as "Rifle"). Each time you click on the button I need to give the new movieclip a different instance name then the last, such as "Riflemen1", "RifleMen2" etc.. I will need to be able to refer to each movieclip seperatly in my code, such as for example:

You spawn three Riflemen.. You click on one of them, which selects it, you then click on an "Attack" button which makes only him start firing (in my case gotoAndStop(2)), you then decide you want the third one to attack and so forth..

View 1 Replies

ActionScript 3.0 :: Using And Referring To Dynamically Created Instances?

May 26, 2010

I'm creating a DDR style game. The 'moving graphics' are being randomly and dynamically created with the default instance name (instance28, instance 30...) I want to be able to refer to these different elements according to another movie clip I press (in this case, they look like piano keys).

So, if a 'C' moving graphic is created, I want the C movie_clip with a listener attached to check the 'C' moving graphic.

[Code]...

View 2 Replies

ActionScript 2.0 :: Referring To A Variable

Apr 17, 2003

say i have this code: blah = "123 + i" so blah is a variable right? so how would i refer to this variable? i want to be able to do: _root.blah.onPress = function () but this won't work beause you need an instance name instead, so how would you do this? thx, i hope you understood what i was saying

View 9 Replies

ActionScript 3.0 :: Referring To Dynamically Created Movie Clips?

Jan 21, 2010

There are five dynamically created movie clips inside my flash movie. Is there any way that I could refer to these from action script code?

View 4 Replies

ActionScript 3.0 :: Referring To Instance With Variable?

Jul 23, 2009

I'm trying to access an instance by using a variable but when I try to manipulate a property to the instance (by referring to it with a variable) it only recognizes it as a string... for instance... (pun intended??)
public var prevbutton:String = "btn1";
trace(["page"+prevbutton]);
// which traces - pagebtn1
trace(pagebtn1);
// which traces the instance class - [object btn1pageclass]
I want to call the instance by using a variable... how do I do this?

View 11 Replies

ActionScript 3.0 :: Referring To A Variable Within A Class?

Feb 5, 2009

I have found a tutorial which shows me how to create a class. It also shows me how to construct an object in the main code. What I want to do is to access a variable from the object that I made. Heres the code...This is the link to the tutorial:http:[url]....

Code:
package
{
public class Car [code]....

Then I use this code to construct the object, which in this case is a car (the code is in my main flash file):

Code:
var mycar:Car = new Car("Porche", 3.2, 4, "Normal doors");

I understand all of the code, but how do I reference a variable like the engine? I have tried lots of things like "trace(this[mycar] .engine)", "trace(mycar.engine) but nothing seems so work. I just get error messages of property undefined.

View 4 Replies

Flex :: Referring A Component Id Throw A Variable?

Sep 7, 2009

I'm developing a flex application and I want to access a component by using it's id.
I know I must use .property of the component. The problem is I have the component Id in a String var and now I don't know how to access to it's properties.

View 2 Replies

ActionScript 2.0 :: Loadvar And Scope Variable - Array Seems Set To Null Or Out Of Scope

Jul 1, 2004

I add this actionscript code on the first frame. Variables are loaded but. The question is below the code.

[Code]...

View 2 Replies

Javascript :: Dynamically Assign Variable From HTML To AS3 Variable

Sep 12, 2011

I have an HTML button that I need to dynamically assign to an AS3 variable when clicked (in order to load an .mp3). I am using externalInterface.call to collect javascript variables - I am just unsure how to change these dynamically when a button is clicked.

View 2 Replies

ActionScript 3.0 :: How Does AS3 LoadVar

Jun 26, 2009

I have a aspx login page with C# to let member login with username and password. After login, it gets memberId and a sessionID.How does the aspx page or C# code pass those 2 variables to flash client? In AS3, how does it get those 2 variables?

View 2 Replies

ActionScript 2.0 :: LoadVar From A Php File?

Aug 6, 2004

when i try to loadVar from a php file, it works on my flash program loading off from my site not locally.. but when i upload it and test it fails in loading..

View 4 Replies

ActionScript 2.0 :: Change Url Using Loadvar?

Nov 15, 2004

I want to change the url of the buttons of my swf movie using an external documment like txt or xml. Everybody says : use loadVars.

View 12 Replies

ActionScript 2.0 :: How To Change Url Using Loadvar

Nov 15, 2004

Maybe this is simple but I have troubles trying to do it. I want to change the url of the buttons of my swf movie using an external documment like txt or xml. Everybody says : use loadVars. How?

View 12 Replies

ActionScript 2.0 :: Adhere A Variable To A Variable, Dynamically?

Sep 19, 2009

I have 14 buttons, and each one declares a variable; example:

[code]...

On the next frame I have another 14 buttons, and on Release I want to create a new variable with the content of _root.competencia; example:

[code]...

Instead Flash tells me this: Left side of assignment operator must be variable or property.Its what Im trying to do possible? Hope somebody can help me, has been 2 days, and I cant understand what is going on, I have tried a lot of ways without positive results, I know I have a long way to go to learn actionscript, Im to new in this!

View 2 Replies

ActionScript 2.0 :: Special Letters Using LoadVar?

Feb 20, 2003

how to get loadVar to read special characters like � and � when using it to read from a textfile??

View 5 Replies

ActionScript 2.0 :: LoadVar From An Externally Loaded Swf

Sep 5, 2005

i have a swf that is a email form. it works great if you just load this swf on to the server. but i have another swf that loads the email form swf into it. all of it shows up and seems to function except that it doesnt actually send the email. im guessing the problem is that the code on the send button isnt working with the new pathway. I cant figure out the path. heres the code that works in the email form

[Code]...

View 3 Replies

ActionScript 2.0 :: LoadVar.send Same Window?

Dec 11, 2007

I want to use loadvars.send but I would rather it didn't open the target page in a new tab, but to act like a normal page would...

View 1 Replies

ActionScript 2.0 :: JPEG File Verification Using LoadVar

Nov 7, 2004

I'm building an array of JPEG files from an XML file. I need a way to verify that the file exists on the server as it build the array. If it's not there I want to substitute another file name in it's place: default.jpg. Using loadVars I came up with this code.... which won't work:

[Code]...

I posted this on the FLASH forum but the only answer I got was that it can't be done and I should use a server-side script. Flash should be able to tell if a load failed or not..yes.

View 6 Replies

ActionScript 2.0 :: LoadVar - Read Variables Of A .php Page Into Flash

Dec 2, 2004

im just wondering for the best way to read variables of a .php page into flash

[Code]...

but that dident work either the real problem is, i guess that i need it to read in the variable array[0,0]=1 just like that and not use sumthingrather=(myVars.varname) because there will be a hell of alot of variables, and the variable ammounts will switch and i cant do a sumthingrather=(myVars.varname)

View 1 Replies

ActionScript 2.0 :: Load Som External Text Width LoadVar

Sep 26, 2007

I'm trying to load som external text width loadVars. everything's working just fine with the example below, but i want to loop out da ****...

var loadText:LoadVars = new LoadVars();
loadText.onLoad = function(success) {
if (success) {[code].....

View 5 Replies

ActionScript 3.0 :: Change Variable Value Dynamically?

Apr 13, 2011

[code]....

need a way to change from tile0 to tile1 through variable [code]....

View 3 Replies

ActionScript 3.0 :: Loading Variable Dynamically Through XML

Jul 22, 2009

How to add a child to the stage dynamically? I can get a child to add to the stage but not using dynamic variables. Is it possible?
Example:
var firstRoundWinner:String = "Redsquare";
var mc:MovieClip = new firstRoundWinner();
// want it to say = new RedsquareaddChild(mc);
With Redsquare as one of my movieclips and the linkage is working. I can add it if I hard code it. But I want to load the variable dynamically through xml.

View 1 Replies

Flex :: Dynamically Embed Variable In It?

Dec 14, 2011

My requirement is not to dynamically embed fonts in Flex, but to dynamically embed variable in Flex.[code]...

View 3 Replies

As3 :: Flash - Dynamically Name A Variable On An Object?

Feb 11, 2012

So, if I need to give a custom variable name to an object how would I do that?

For instance, if I have a gameID that is 12345 and its rating is 3 I want to save a variable called gameRatings_12345 thats value is 3 in my shared local object.

//share object
protected var mySavedData:SharedObject = SharedObject.getLocal("mySavedData");

I have the game id in a string

var gameID:String = "12345";

Then when I try to assign the value like this...

mySavedData.data.gameRatings_gameID = 3

I think it's literally reading it as "mySavedData.data.gameRatings_gameID" instead of "mySavedData.data.gameRatings_12345"

How can I give the variable a custom name?

View 2 Replies

ActionScript 2.0 :: Change Variable Name Dynamically?

Jan 8, 2010

how can i change variable name dynamically

ActionScript Code:
i=2
vari + "i" = 7 //these don't work
//i need to trace these code
trace(vari2)

i allways get error. i've tried the bracket none worked for me like these quotation

View 1 Replies

ActionScript 2.0 :: Change The Variable Dynamically?

Aug 23, 2004

how do i change this variable dynamically?

[URL]

View 6 Replies

ActionScript 2.0 :: Creating A New XML Variable Dynamically

Dec 19, 2006

Is there a way to create a new XML object dynamically? i need to do this because i don't know how many xmls there will be.[code]

View 12 Replies







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