ActionScript 3.0 :: Defining A Variable As 2 Separate Things Depending On Other Variable?

May 4, 2011

I'm making a platform game where all of my level components (ground, background etc.) are within an array called 'levelArray' so I can move all the elements the same amount at the same time. I'm just starting to implement my second level, and I need to change 'levelArray' to contain different level elements. I've tried to put an 'if' statement to change the definition of the variable:

[Code]...

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Use String For Defining New Object In Variable?

Jan 22, 2010

How could I use string content to define new object in variable. Instead of[code]...

View 4 Replies

ActionScript 3.0 :: Defining Variable Types In Functions?

May 2, 2010

if defining variable types in function parameters gives any speed boost.

e.g

ActionScript Code:
function DoIt(param1,param2,param3):void
{

[Code]....

is there any performance difference between above functions. in theory compiler should be able to manage memory more efficiently when knowing what data to expect, but is it so in flash

View 3 Replies

ActionScript 2.0 :: Defining An Object With Variable Properties

Nov 15, 2003

I'm facing a problem with defining objects. What I need to accomplish is this:

[Code]....

View 8 Replies

ActionScript 2.0 :: Defining An Object With Variable Properties?

Nov 15, 2003

What I need to accomplish is this:

Code:
var cnms = this.cNames.split("|");
myDP = new Array({cnms[0]:"Chris", cnms[1]:"Priceless"}, {cnms[0]:"Nigel", cnms[1]:"Cheap"});

Obviously, this doesn't work, otherwise I wouldn't be typing this right now. How do I define an object with variable properties ? I've tried eval(), but it doesn't work either.

View 8 Replies

Actionscript 3 :: Defining Variable's Data Type While Assigning New?

Feb 23, 2010

i'm linked a MovieClip class object to my project, and i will programatically add it to the display list. is there a difference between defining the variable's data type and not doing so? neither produce a runtime error.[code]

View 1 Replies

ActionScript 2.0 :: Different Frame Numbers Depending On The Variable?

Mar 25, 2009

I am having problems with this if else statement. I have a variable (frame number 30) passing into my swf from another swf. This I know is working correctly.

But - I need to be able to direct to different frame numbers depending on the variable, this is working.

But when I place this code:

[Code]...

View 2 Replies

Professional :: Generate A Variable That Gets +1 Or -1 Depending On Clicks?

Sep 13, 2010

Is there a way to set up an unseen variable in flash sort of like keeping score?The best way I can describe it is from the BASIC language I used to use back in the day, where on a click you can make x=x+1, or x=x-3, or whatever depending on the button you click on.And then it would display the score (i.e. whatever is the current value of x) in the corner? give me a link or the actual code you would assign to a single button that will add or subtract to a displayed score in the corner.

View 10 Replies

ActionScript 3.0 :: Change A Textfiled Depending On A Variable?

May 11, 2011

I have several textfileds in a movie clip and I want to change text in a textfiled depending on which textfield you have clicked on. So if I have clicked on at textfiled named "text1" i want:

[Code]...

And then will text1 have the same text as "inputfield", but this dosen't seems to work only if you had a textfield called "textvariable" but that is not what I want. So any ideas how you can make this function?

View 6 Replies

ActionScript 3.0 :: Display Certain MovieClip Depending On Variable?

Feb 9, 2012

I have a project where I want to display a certain movieClip based upon what variable was set earlier. I have 5 different MovieClips that need to display depending on variables.

I have the variable set and working, but how can I script this to make it that if a certain variable say Var1 is set, then it chooses to display Var1_mc?

Can I just have it load the correct one, or do I just have it change the alpha setting of the correct one?

View 8 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 3.0 :: Load An Image Or Clip To Stage Depending A Variable?

Jun 11, 2010

Is it possbile to make 'bumblebee' a variable?
 
var mybee:bumblebee = new bumblebee();

View 5 Replies

ActionScript 2.0 :: If Else - Directing The Swf To Start On Different Frame Numbers Depending On The Variable

Mar 25, 2009

I am having problems with this if else statement. I have a variable (frame number 30) passing into my swf from another swf. This I know is working correctly.

[Code]...

(in case it was a string vs number issue.) it just stops - it does not go to frame 30. I need this because I need the file to stay on frame 1 if no variable is passed in. Am I doing something obvious wrong? Is there a better way to do this?

View 1 Replies

ActionScript 2.0 :: Pass Variable Through Separate Swf Files?

Feb 17, 2009

I have movie file named master.swf (main Movie)it loads main_banner.swfmain_banner.swf has few buttons. when you click on one master.swf go to frame and loads product.swf (till this part eavery thing works fine)Now this part is not workingwhen I click on a button in main_banner.swf I want to assign a variable with another movieclip name Eg: _global.pro = "products/perma_core_1.swf";when product.swf loads it should plays above said swf file (perma_core_1.swf) by using this action pro_ct.loadMovie(_global.product);

View 1 Replies

ActionScript 2.0 :: Pass A Variable In Between Separate Movies?

Jan 31, 2003

I have a main movie, and use the following code to call an external movie:

on (release) {

loadMovie ("http:url....);
}

Fine I've no problems with this, however once I am in portfolio.swf I want to be able to call an ASP file when I click on a button I.e if I click button 1, I get files records for ID 1 and if I click button 2, I get file record for ID 2. The button click happens in the main movie, have I can pass a variable in between seperate movies?

View 3 Replies

ActionScript 3.0 :: Rotate An Object (mc) Clockwise Or Anticlockwise Depending On The Value Of A Variable Called 'angle'?

Aug 31, 2009

Essentially I'm just trying to rotate an object (mc) clockwise or anticlockwise depending on the value of a variable called 'angle'.If 'angle' is positive it should go anticlockwise.If 'angle' is negative it should go clockwise.

Option 1

PHP Code:

if(angle > 0) {
mc.rotation += rotateIncrement;
}

[code]....

View 3 Replies

ActionScript 3.0 :: Super Simple Syntax To Do Different Things Depending On The Object Type

Mar 29, 2009

but i realize i do not know the syntax of what i want to do. So i have an event handler and i want to do different things depending on the object type. i could do

[Code]...

View 4 Replies

ActionScript 1/2 :: Defining Variables From A Separate Timeline?

Jan 17, 2011

I'm having a strange problem setting variables in movie clips from another (parent timeline). I run the following code from the parent movie clip to target child movie clips it contains.

setVars = function (clip, value) {
clip.val1 = value;
clip.val2 = 0;

[Code].....
 
I am trying to set variables in a movie clip targetted by the 'clip' argument in the setVars function but they are being traced as undefined. However, setting the function works fine. I have also tried manually defining the variables in the movie clip and am still unable to change them externally from the setVars Function.

View 3 Replies

ActionScript 3.0 :: Defining Functions In A Separate .as File?

May 5, 2010

I would like to know if this is actually possible in AS3. I'm not really fluent in Java-style programming, but very used to C++'s .cpp and .h file system. Right now my functions are defined where my class is defined, so as you can imagine, my classes look incredibly untidy and disorganized.

[Code]...

View 6 Replies

ActionScript 3.0 :: Passing Variable To A SWF On Separate HTML Pages?

Sep 3, 2009

i have a flash file created in AS3, let's call it file1.swf it contains a variable.. we will call this testVariable file1.swf is embedded inside file1.html file1.swf reaches a point where it needs to load a new swf file that we will call file2.swf file2.swf is done in AS2. file1.swf simply calls file2.swf by calling a new HTML file that embeds file2.swf

So file1.swf calls

var targetURL:URLRequest = new URLRequest("file2.html");
navigateToURL(targetURL, "_self");

I need file2.swf to have access to testVariable.

View 4 Replies

ActionScript 2.0 :: Refer To A Variable In A Class File Separate From The Other One?

Feb 24, 2010

Is it possible to refer to a variable in a class file separate from the one you are working in? Say Class1.as had a variable named "exampleVar", and in Class2.as you wanted to put something like "exampleVar++;". Is this possible and if so how would it be achieved?

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 2.0 :: Each Of The Tiny Things Separate Movieclips That Move With Relation To The Mouse?

Sep 19, 2008

Could anybody point me to the right direction on how to do the background for [URL]? Is each of the tiny things seperate movieclips that move with relation to the mouse? I want to understand how it works since it seems to work efficiently and doesn't have any slowdown.

View 1 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 2.0 :: Making A Normal LoadVars.load Load Url Depending On A Variable

Jun 7, 2005

Is there a way of making a normal loadVars.load load a url depending on a variable you set in the swf?

var reciever = new LoadVars();
loadurl = "test_onload_3.cfm?propertyID="+MY_VARIABLE_GOES_HERE;
reciever.load(loadurl);

so that I can set my variable and then load the variables with the propertyID that I choose in the swf??

View 4 Replies

ActionScript 2.0 :: Change A Songs Playback Speed Depending On A Speed Variable?

Jul 24, 2009

is there anyway to change a songs playback speed depending on a speed variable. heres the kicker tho im limited to using only as2.

View 2 Replies

ActionScript 2.0 :: String To _level (path) - Hide A MC Depending On The Path Variable?

Nov 24, 2004

Here's what i'm trying to do: Hide a MC depending on the path variable as:

[Code]...

Well that doesn't work, for some reason, i can't use a string as a multiple level path..

View 5 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

Javascript :: Pass The Variable So That The Resulting Line Of Code Doesn't Have The Quotes Around The Variable Value?

Oct 3, 2011

I'm trying to pass the contents of variable playnoyes to the long line of code below to decide whether or not to autoplay the flash movie, but doing it as I have below, the resultant line of code has the variable in quotes and therefore the code doesn't execute it as expected. My question is, how can I pass the variable so that the resulting line of code doesn't have the quotes around the variable value.

var playnoyes='true';
var testtext = "<script type='text/javascript'>AC_FL_RunContent ('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.[code]....

View 3 Replies

ActionScript 2.0 :: Flash8 Variable Set-up - 'if' Statement To Run From Variable When Playhead Encounters MovieClip

Aug 21, 2009

I want to declare a variable on the main timeline that can be called from anywhere in my movie. So, _global var should be the right approach. I want to declare a movie clip 'MC1' "open", or "closed" so that when it is revisited, my flash file knows the user has been there before and performs a different task from the one it does when 'MC1' was first encountered. So, i need a 'if' statement to run from the variable, when the playhead encounters the movieClip.

[Code]..

View 2 Replies







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