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




Naming Properties Using Variable Expressions



In a class I am trying to have a function create new properties that have variable, number-indexed, names.

Let's say my object is called 'Book'. And so I want to run a for-loop to assign to it a series of new properties along with a value for each, e.g.

book.chapter1 = "the beginning"
book.chapter2 = "the next day"
book.chapter3 = "the middle"
book.chapter4 = ...etc.

I used--naively--the set function in the loop to give the properties variable names evaluated from expressions, and that doesn't work--i guess it works only for variables and not properties.

Also had problems using trace. How do I trace the value of each property within the loop? Using trace(eval("book.chapter"+i)) won't work...

Here is the code i have if u need to see it:
---
dynamic[<<guess this is not nec.??] class Multi_array extends Object[<<nec.??] {

private var mybook:Object;
private var temp:String;

public function set_me_up() {

mybook = new Object();
for (i=0; i< cat_titlesX.length; i++) {
temp = _root.chapter_name_array[i]
set("mybook.chapter"+i, temp);
trace("mybook.chapter" +i+ "= " + eval("mybook.chapter"+i));
}
}
}
---



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 06-02-2005, 01:34 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Variable Expressions
Hello, I am trying to load a variable to a new level, however the level the variable is loaded to is determined by more variables, and I am currently having trouple using variables in a expression. The code below is, so far, the only way that I do not get error warnings, however it does not load the variable as I would like. Any help I could recieve would be greatly appreciated.

_root.Blank1.contentClip["group"+groupNum]["infoBox"+i].groupNum2 = "groupNum";

~Steve~

Quickie On Variable Expressions
hi...

just a quick question, when im defining a variable as a web address should it be as an expression? for instance...

mail = "http://www.hypnoticmedia.co.uk/codebook/mail.php";

Variable Naming
I'm using loadVars in AS2 Flash 8 and PHP returns this string

success=false&error_message=xxx

The success variable traces fine but error_message is always undefined. Is it because the underscore is not allowed?

Naming An Object With A Variable
I have a square that is broken into four equal parts. The function that I have makes it so that they scale relative to each other in that when quadrant a gets bigger the quadrants below (c,d) decrease in height and the quadrants to the right(b,c) decrease in width. I have this working really well but I want to have multiples of this same efect throughout the page. I just want to set the name as "a"plus the variable "i" so I can just set the function up

a(i)._xscale= x;
a(i)._yscale= y;
b(i)._xscale=200*(1-(x/200));
b(i)._yscale=y;
etc...
But I don't know how to name a mc with a variable.
I hope this is clear. Anyway thanks for the help in advance.

Variable Naming Problem
Hi there. I have a problem people. I want to name a variable(question) according to the variable in a for statement.

eg.

for(var i=1;i<=4;i++){
var question;

}

However, I want the variable,question, to have a number at the back of it. Eg. question1, question2, question 3 etc. The number must follow the value of i. Eg. if i=1, the variable is question1, if i=2, the variable is question2 etc. Is there easier way of doing this without using the if statement?

Dynamic Variable Naming
I'm instantiating objects in a for loop. The quantity instantiated varies depending on external content. I need to name each new object:


ActionScript Code:
for (var i:Number = 0; i < categoryArray.length; i++) {
    var currCategory:String = categoryArray[i].categoryName;
    var toBeCreatedOnTheFly:MenuBuilder = new MenuBuilder(menuHolder_mc.sectionMenu, currCategory, 20, 20, 10, false);
}

I want toBeCreatedOnTheFly to be dynamically named so that it's called currCategory + "Menu". Thus, if there are five turns through the loop, I'll have variables called catMenu, dogMenu, bearMenu, owlMenu and whaleMenu or whatever.

Is this possible? Or how else might I be doing this?

Custom Variable Naming?
Hello, I'm trying to generate multiple variables with a loop, but I'm not sure how to do it. Here's the code I have so far:


Code:
var i:Number = 0;
for (i = 0; i < 3; i++) {
var ["target"+i]:Number = i
}

trace(target0)
trace(target1)
trace(target2)
What's the correct way to code this? Thanks!

Naming Variable During Runtime
Can anyone tell me how I can name an actionscript variable during runtime using a textbox?

Variable Naming Conventions
I write this as a reply to the locked sticky on varible naming.
As is stated in the sticky in flash you use _txt for example to name variables,
I have almost no actionscript experience so i don't know if this is used,
but in other program languages mosty the hungarian naming convention is used.
I wonder if this is never used in flash because it's an easy way of naming your variables.
The principle is that you just add a 1, 2 or sometimes even 3 letters befor your name.
eg.
sString
arrArray
mcMovieClip
etc.

Best Regards,
Raf

Variable Naming Conventions
I write this as a reply to the locked sticky on varible naming.
As is stated in the sticky in flash you use _txt for example to name variables,
I have almost no actionscript experience so i don't know if this is used,
but in other program languages mosty the hungarian naming convention is used.
I wonder if this is never used in flash because it's an easy way of naming your variables.
The principle is that you just add a 1, 2 or sometimes even 3 letters befor your name.
eg.
sString
arrArray
mcMovieClip
etc.

Best Regards,
Raf

Help On Dynamic Variable Naming
Hi,

I have a php script that echos out variables of the form:

newsVars.name1 = alpha
newsVars.name2 = beta
newsVars.name3 = gamma
newsVars.name4 = delta

and I have retrieved them in flash but I want to rename them so that:

newsVars.name1 = _global.name1
newsVars.name2 = _global.name2
newsVars.name3 = _global.name3 .... etc

I want to do this automatically and so that it stops after the last value, i.e. in the example above it will stop after newsVars.name4. I realise that there is a loop function involved somewhere but I can't get it to work.

I have had a good look around forums etc and haven't been able to find anything that helps. There is something about arrays but I don't want to use them.

Cheers,

Zor

Dynamic Variable Naming
ok...heres my code:

for (g=1; g<=this.num_pic; g++) {
var pic+"1"= new Array();
fl = eval("this.pic"+g);
files = fl.split(",");
c = files.length-1;
picname=files[0];

}

I'm trying to rename the variable up there "pic1" and make it an array, but dynamically increment and make new variables in the loop. Obviously this code does not work and I don't know how to accomplish this. Any help would be GREATLY appreciated,

Dymanic Variable Naming
Last edited by Jakob : 2003-03-07 at 06:51.
























How do I create variable-names by using a for-loop? I know this code works i JAVA
for(int i=0; i<10; i++)
{
String "number"+i=i;
}

but it doesn't work in ActionScript.

Can somebody please help me?

Variable Naming Problem
Hi there. I have a problem people. I want to name a variable(question) according to the variable in a for statement.

eg.

for(var i=1;i<=4;i++){
var question;

}

However, I want the variable,question, to have a number at the back of it. Eg. question1, question2, question 3 etc. The number must follow the value of i. Eg. if i=1, the variable is question1, if i=2, the variable is question2 etc. Is there easier way of doing this without using the if statement?

Load Swf-file By Naming A Variable?
i have the following situation:
i have a swf file that want to - on button release - load another.swf-file in level 2. is it possible to load not an swf-file with a fix name but one, whose name gets defined by a variable the user selescts earlier, example:

> user selects variable named "color" earlier e.g. green
> now he clicks the "load movie" button and i want the movie green.swf to be loaded. i also have other colors and sfw-files but only want to use one button to load them, depending on the users choice?

how can ib define a variable inside a "load-movie" script?

tahnx for your great help!

martin from germany

Variable Naming And Calling Thingy
Q: Let's pretend I am working with 20 variables, and they all continuously undergo the same manipulation, over & over again.
It would be convenient if they were names - var1, var2, var3, etc.....
Then you quite easily create a loop such as:

for(i=1;i<21;i++){
eval('var'+i) = 'whatever';
}

Easy.

but...

What if it is of utmost importance, to NOT name variables in such a way. Such as - myName, myEmail, myPhone, etc.....

I tried to shove variable names into an array, but it didn't work....or I wrote it wrong.

I need the convenience of creating small loops of code.

Thanks

Simple Variable Naming Question
Is it possible do dynamically create and assign variable names using as like this for example:

name1
name2
name3

I am think about something like this which of course doesn't work:


Code:
for (var i:int=1; i<4; i++){
var "name"+i.toString():String = new String();
}
?

thanks

Variable Naming Based On Data
Hi guys,

Anyone know how you would do something like this...


ActionScript Code:
for (var i; i < 3; i++) {
var btn[i] = new Button();
this.addChild(btn[i]);
}

Idea is that it would create 3 Button objects (from an external Class) assigned to variables btn0, btn1, btn2 and add them to the display list.

How does one go about naming variables in a loop like this?

Would it actually be better to push Buttons into an array in instances like this?

Cheers!
Will

Simple Variable Naming Question
Is it possible do dynamically create and assign variable names using as like this for example:

name1
name2
name3

I am think about something like this which of course doesn't work:


Code:
for (var i:int=1; i<4; i++){
var "name"+i.toString():String = new String();
}
?

thanks

Naming A Variable After The For Loop Statement?
hello guys, i really hope someone can help me with this. i cannot figure this out.

I use a for loop to duplicate a few times a movie clip that i created just before. They are assigned a name each monkey1, monkey2, etc...

but then i want to move those create frame but dynamically since they will vary and i can't write out the discrete names everytime; so it means i have to use a variable of some kind but i cannot call those movieclips back somehow.

The code sample is below, it is mainly the last 3 lines that are the issue. Thanks a lot. Cheers.


Code:

bgPatternGeneration();

function bgPatternGeneration(){
loadLocation2.createEmptyMovieClip("pattern", this.getNextHighestDepth());

loadLocation2.pattern.createEmptyMovieClip("macaque", this.getNextHighestDepth());

//this.createEmptyMovieClip("rectangle_mc", 10);
//rectangle_mc._x = 100;
//rectangle_mc._y = 100;

barNumbers=9;
barW=Math.ceil(Stage.width/barNumbers);
drawRectangle(loadLocation2.pattern.macaque, barW, 100, 0x000000, 100);
function drawRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, fillColor:Number, fillAlpha:Number):Void {
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(0, 0);
lineTo(boxWidth, 0);
lineTo(boxWidth, boxHeight);
lineTo(0, boxHeight);
lineTo(0, 0);
endFill();
}
}

var duplicate:MovieClip;
for(var i:Number=1; i<=barNumbers;i++) {
var newX:Number=((i-1)*barW);
duplicate = loadLocation2.pattern.macaque.duplicateMovieClip("monkey"+i, i, {_x:newX});
}
//removeMovieClip(loadLocation2.pattern.macaque);
loadLocation2.pattern._height=Stage.height;
};


trace(loadLocation2.pattern.monkey3);

k=2;

bouffon="loadLocation2.pattern.monkey"+k;
//the way below doesn't work either
//bouffon=loadLocation2.pattern.monkey[k];
trace(bouffon);
bouffon._y=188;

Naming An Array Using A Variable Or Expression
Okay Folks -

Long time lurker, first time poster.

I have a movie that loads a number of delimited strings from text files.

I use loadVariables to bring in, say, strings.txt. This file contains a number of delimited variables thusly:
strng1=foo1$foo2$foo3$foo$&
strng2=fie1$fie2$fie3$fie4&
etc...

The goal is to create and populate a multidimensional array using a for loop. Here is a snippet of code that doesn't work, but represents what I'm trying to accomplish:

for (i=0; i<myotherarray.length; i++) {
        j=0;
        str = "strng"+(i+1);
        strn= str.split("$");
        set(anarrayname, new Array(new Array(strn[j],strn[j+1],strn[j+2],strn[j+3],strn[j+4])));
}

So, when tested as written above, anarrayname[0][0] will return the literal value of str. Also, anarrayname[0] will return an array with the literal value of str as the first element and the rest undefined.

If I replace

strn= str.split("$");
with

strn= [str].split("$");

none of the array locations are populated.

Obviously, what I want if for str to be recognized as the name of a string, so that the .split will be performed on the correct string and populate the array. Just can't seem to make it happen.

HELP!!??!!

[as3] Dynamic Variable Instance Naming
I'm slowly transitioning from as2 to as3, and I am so used to creating dynamic movie clips this way :


Code:
for(i=0;i<10;i++){
this.createEmptyMovieClip("mcName"+i,this.getNextHighestDepth());
with(this["mcName"+i]){
beginFill(0x000000,i*10);
lineTo(0,20);
lineTo(20,20);
lineTo(20,0);
_x=i*25;
}
}
now that I'm using as3, I'm trying to make a few sprites to play around with but I cant seem to understand how to do this. I want each sprite to have a unique name so I can use them individually. I know this must be really basic, but I just can't find it or think of the right terms to do a search for it.

Flash Variable/movie Clip Naming?
When referring to Flash variables I noticed that developers use many different ways to assign names to custom variables. Some people use all uppercase (POWERAMOUNT_TXT), some use all lowercase (poweramount_txt) and others use some variants (PowerAmount_TXT, powerAmount_txt, etc.). Movie clips are sometimes referred to as PowerAmount_MC, powerAmount_MC, poweramount_mc, etc.

Being new to AS, I was wondering if anyone could recommend a good solid naming convention for custom variables and movie clips or perhaps point to an existing tutorial that covers this topic. I'd rather not pick up any bad habits since I'm just starting out in the world of AS.

Thanks!

Dynamic Variable Naming For Sound Object
Is it possible to dynamically name a variable? I'd like to create a new Sound Object on the fly, so that I can use the Sound.load() method multiple times. I would simply like to create and name the variable and add a number to the end of the name (i.e.; var "audio_1":Sound). I'm sure that this is possible. However, I can't seem to get it figured out.

AS 2.0 Variable Naming Hints [Coding Efficiency]
This short article is on variable naming in the new Actionscript 2.0 (and 1.0, I guess).

I like to bring some light to a little known fact about naming variables in 1.0:
You know how some variables will bring up a list of available functions and properties when you type a dot at the end of it?

For example:
ActionScript Code:
//syntactically wrong, but for the sake of examplemy_mc. // will bring up a list of functions available to that variable// whereas...myMC. // won't display anything  
What triggered the list of available functions for the first command was actually the suffix "_mc". The variable types in AS x.0 (for both versions 1 and 2) each has its own suffix to enable what is called Automatic Code Hinting. If you're anything like me, I don't like typing out some of Flash's really long function names like
ActionScript Code:
_mc.createEmptyMovieClip(...); //also case-sensitive, no less  
so this is where suffix-ing your variables comes in handy.

Like I mentioned, each data type (Array, Color, MovieClip, etc) has its own little tag along suffix that will enable the code hinting. They are as follows: (available for both AS 1.0 and 2.0, incomplete)Array: _array
Button: _btn
Color: _color
Date: _date
MovieClip: _mc
Sound: _sound
String: _str
TextField: _txt
TextFormat: _fmt
XML: _xml
XMLSocket: _xmlsocket
As you can see, the suffix for any given type is pretty obvious.
So how do we apply this? Well, given that list, you can now add those suffixes to your variable names (like my_array, preload_sound, etc) and a menu with every available function for that type will appear. So now you can see why, in the code above, my_mc triggers a menu and myMC does not. Use these suffixes to your advantage, whether for speed or reliability, it is your friend.

Now on to AS 2.0...
2.0 also offers those suffixes that were listed above as well as some new ones: (AS 2.0 only):Camera: _cam
ContextMenu: _cm (my next tutorial will be on this)
ContextMenuItem: _cmi
Error: _err
LoadVars: _lv
LocalConnection: _lc
Microphone: _mic
PrintJob: _pj
NetConnection: _nc
NetStream: _ns
SharedObject: _so
Video: _video
XMLNode: _xmlnode
Now there is another way to display code hints without the use of suffixes. It is implemented in AS2.0's new style of variable declaration:
ActionScript Code:
//Now instead of using _str to display the menu like:my_str.//You can have the same menu appear but name the variable whatever you like:var myString:String;myString. // pops-up menu with string functions  
Now if you haven't seen this syntax for variable declaration, don't

fear. It's quite simple, really:

var variable_name:Data Type

It's up to you whether you want to use var or not, it doesn't make a difference. But if you do, a menu of available data types appears when you type that colon used in the syntax (how nice of them ).

Well that's all I have for now. If you have any questions/corrections to this article, let me know.

Update

Quote:





Originally Posted by lostchild


(on a standard windows installation) look for the file :"c:program filesMacromediaFlash MX 2004enFirst RunActionsPanelAsCodeHints.xml"

in this xml file u can change the suffixes as u like. other stuff can be set with other xml files also. like u can add ur custom methods to appear in actions panel etc...
cheers ...




--thor

Naming A SharedObject By Reading A Variable From A Text File
Hello,

I've been trying for some hours now..and I cant get it to work.
I am loading a variable from a txt file, displaying it in a dynamic text field and the I want to save a Shared Object .sol file using that variable.
The text field displays the variable ok...and am using a method I got from the forum to read the file :


ActionScript Code:
on(release) {

var v:LoadVars = new LoadVars();
v.load( "calendar.txt" );
var loadedSoFar:Number = v.getBytesLoaded();
var loadedComplete = v.getBytesTotal();

v.onLoad = function( success:Boolean ):Void
{
    if( success )
    {
        populateTextBox( this.luna );
    }
    else
    {
        trace( "Error loading vars" );
    }
}


function populateTextBox( s:String ):Void
{
   
_root.lunatxt.text = s;

mySO = SharedObject.getLocal(s, "/" );
mSO.data.num = 123;
mySO.flush();
   
    }

}


I tried a lot of ways but I can't get it to save a shared object with that variable name.

10x

Variable Properties In Prototypes (MX)
I'm trying to figure out how to make a property being modified in a prototype a variable ... so that my prototype is flexible in which property its effecting.

for example ...

Code:
MovieClip.prototype.example = function (myProperty,myValue){
myProperty = myValue;
}
and then the call for the prototype

Code:
this.example ("this._xscale", 50);
}
nothing i've tried works ... how can I get the prototype to evaluate the "myProperty" variable to actually be the property ... am i making sense?

How Do I Change Properties Of A Variable?
Hey there

ok so here's my problem. I think(hope) the solution is simple but for the life of me I can't figure it out. So here goes:

I have a bunch of buttons(actually they are movieclips but they function as buttons) which have their animation for rollOvers and rollOut controlled by actionscript.

What happens is that as you mouse over the button it's alpha increases(making it brighter) and then as you roll off of it it's alpha decreases. Now this all works swimmingly. Have a look at www.eggfilms.co.za/newsite to see what I mean(click on directors)

So here is the problem: I want the button I clicked on to remain in full alpha to indicate that it is selected but when I move over the other buttons then their rollOver functions trigger the alpha to another value.

So I thought that a way around this was to pass a variable(the name of the movieclip instance in this case) when you click on a button which then gets read by a function which then again changes the alpha to 100%. This function would be in a hollow rectangle outside of the button area so it would be triggered if the user were to move his mouse down o the rest of the site.

so in my actions layer I have this:

var butSel:MovieClip;
then if I mouseover a button I have a function which gives the variable it's instance name.

butSel = this._name;

NOW here is the problem, when I try and use the butSel variable to change the properties of the selected movie it just flat out doesn't work.

I tried:

butSel.alphaTo(100,2,easeOutInCubic,.1);

which doesn't work

also tried

[butSel].alphaTo(100,2,easeOutInCubic,.1);

so basically I don't know how to pass a command to a variable.

Anyone know how I would do this?

Thanks

Syllogism

How Do I Use A Variable To Set Movie Clip Properties?
I'm building a simple contact page that allows users to select a city from a comboBox. I'd like to pass the selected comboBox data through a variable that controls a movie clip with the same name. (already on the stage)

locationListener.change = function (loc_obj:Object) {
var loc_mc = loc_obj.target.selectedItem.data;
loc_mc._visible = true;

So far this hasn't worked. I've tested hardcoding the movie clip instance name (Atlanta._visible = true) and it works, but I can't figure out why using the variable loc_mc won't trigger interaction with the movie clip.

Something simple, I assume. Thanks in advance for any help.





























Edited: 08/22/2007 at 11:34:40 AM by LDJ3

Creating Objects With Variable Number Of Properties
I am building an object with a variable number of properties. First the fixed properties:

obj=new Array();
obj.title="demonstration";
obj.text="objects with varying number of properties";

Now, depending on the data loaded, the number of properties change. In pseudocode:

obj.["item"+i]= "car";
obj.["item"+i+1]="SUV";

Also, how would I access the properties?

Thanks!

Dynamic LoadVars Properties [i.e. My_lv.{variable}]
Quote:




Resolution:
Figured it out. If you want to dynamically reference the property for the LoadVars object, you can use the bracket notation: my_lv[variable_name];

Therefore, dot notation and bracket notation are functionally equivalent.
my_lv.answer1 = "test";
is the same as
my_lv["answer1"] = "test";

Hey, Macromedia, add this to your Help file!




The goal is to use the LoadVars class to send:

answer1=blah
answer2=blah
answer3=blah
:
answer{n}=blah

to a server in a POST, where {n} is unknown.

The only way I know to send name value pairs via POST using LoadVars is using literal property names, like so: my_lv.answer1 = "some value";

I attempted the following, which didn't work:

PHP Code:



    property_name = "querySend.answer" + num;
    queryObj = eval(property_name); // variable variable
    queryObj = answers_ary[num];




Any steering in the right direction would be appreciated!

Passing Variable Names & MC Properties To Functions
I'm having trouble getting a function to understand the properties of an MC I'm passing to it. I'm using this...

Code:
function repelObj(repelTarget) {
this.onEnterFrame = function() {
var xdistance = repelTarget._x-this._x;
var ydistance = repelTarget._y-this._y;
distance = (xdistance*xdistance)+(ydistance*ydistance);
force = 9999999999/(distance*distance);
apply = force/distance;
movex = (xdistance*apply)+movex;
movey = (ydistance*apply)+movey;
repelTarget._x += movex;
repelTarget._y += movey;
}
What I'm passing to it is the _root path of the name of a duplicated MC. When I use trace(repelTarget) to tell me the name of the variable, it works fine, and I've double and triple checked that the MC exists on the stage, my having the MC trace its name when created. Yet when I tell it to trace (repelTarget._x), I get "undefined." Why can my function tell the MC's name, but not its properties?

EDIT: I think I've just figured out it has something to do with getting the relative path right, since the full MC instance name turned out to be something like _level10.etc.etc. Hope that helps.

Importing Variable Data Into Movie Clip Properties
Hello great knower of actionscript.

I was wondering how would i change the color property (or any other property for that matter) of a movie clip from an external csv or data file. In other words how do i import these variables into a movie clip's properties? thank you for your patience..

Expressions?
Could someone explain to me what an expression is? say for example, i have:

Code:
if (status == ready)
What would happen if i would make ready an expression?

Code:
if (status == "ready")
Could someone explain this concept to me? How would the computer know that ready is an expression or a variable or whatever?

Looking For Someone To Help Me With Expressions
I really need some help with Expressions. If someone could help me out and explain things like I was 10 years old it would really help.
Thanks
TheLostGuru

Wrinting EXPRESSIONS
When writing scripts sometimes (on easy scripts) I use the EXPERT MODE and on hard scripts I use the NORMAL MODE.

On NORMAL MODE when I try to use the dot syntax to write an EXPRESSION I have to click on plus button, then on objects, and any other option (ex: array) to open an expression box on my actionscripts panel.

Then I erase the array script and write, for example:

_x += distancia/4,9

which is an expression...

Is there a direct way I can write an expression (ON NORMAL MODE)like an action (ex: set variable)cos on variable I canīt use the += operator, only the = operator...

Have I made myself clear?

Concatenate To Expressions?
Hey,

How do I get an expression out of this:
txt.val1 = "txt"add c;

the result of this is a string (like "txt1"). I would like the variable to come out as an expression so it loads the variable txt1 into the textbox.(?)

thanks for the replies!

cYa, Ivo

Regular Expressions
Is it possible to use regular expression directly in Flash 5? I would like to do email validation using a regular expression like the following which I have done in typical asp pages:

function validEmail(email) {

var re = /^w+(-w+)*(.w+(-w+)*)*@w+(-w+)*(.w+(-w+)*)*(.w+)+$/;

if (re.test(email)) {
return true;
}
return false;
}


Thanks in advance for any help or suggestions you can give me.

Tell Me How To Stick Expressions
Hi

I have made some script with variables like this:

aube = 50;

Now i wanted to access the variable in different way for making script easier like this:

currentbutton = "au";
trace (curentbutton + "be");

But only aube appeared in output window not the number 50, what is wrong!!

Targeting With Expressions
Here's what I have:

welcome.removeMovieClip("new"+i-2);

How would I target this? For Example,
_root.movieclipA."new"+i-2 doesn't work because you can't use an expression in targeting, but in order to use removeMovieClip you must target the movie...Anybody know what to do? J_red

What Are Targets And Expressions?
trying to load an external swf, but it goes where it wants to in the movie. i'm using setproperty, but it has no effect, does expression, or target have anything to do with it? I have no idea what those mean

Expressions Inside A URL
hey all-

this is hopefully reeeaallly simple, just a syntax question.

using MX. i need to insert a variable inside a getURL command that already contains a javascript snip. here it is:

getURL(javascript:launchwin('this.myUrl' , 'newwindow' , 'toolbar=no,menubar=no,directories=no,scrollbars=y es,resizable=yes,fullscreen=no,height=400,width=55 0'));

everything's static in there except for the 'this.myURL' which is being pulled from an XML page. how do i format the line to both include the dynamic URL and the javascript?

Regular Expressions
Hi,
Has anyone come across an extension or similar offering regular expressions in Flash, or am I stuck with FSCommands and JavaScript?
Gaius

Testing Two Expressions
Hi,
what im trying to do it create a movie that generates a random number in each frame but the number has to be different from any other number thats come up.
In the first frame I just have a random number script thats assigned to the variable 'number1'.
In the second frame I have the following script :

number2 = ""
do{
number2 = random(100)
}while(number2==number1)

This works fine and never gives out the same number. However for the next frame it will need to test for two numbers so I thought I could use :

number3 = ""
do{
number3 = random(100)
}while((number3==number2) and (number3==number1))


However this doesnt work, am I not writing it correctly or what? or is there a better way to achieve this?

Thanks

Using Break In Expressions
Hey I was just wondering if I can ues a break function, I have he following code:

onClipEvent (enterFrame) {
_parent.itemlist = (Firstitemname[0]+Firstamount[1]);
}

I want the itemlist variable where this appears to make a break (return, enter, etc) after the Firstamount array part, but I only know how to do that within the quotes using
, I would REALLY appreciate help.
Flash MX Btw

Gotandplay() With Expressions?
i'm facing a problem.
when i write
on(release){
gotoandplay(x,y) //as x-scene name,y-frame label
//it says they must by in quoted string!? cant i use it with expressions?
}

parun

Expressions In MovieClips
I have an external swf file loaded in to the main movie and want to control the external movieclip's timeline from the main movie. I use framelabels but I also need to use expressions like (_currentFrame + 20) or similar, but I don't get it to work. Can anyone help me out?

Thanx a lot....

Expressions Tutorial?
Does anyone know where an expressions tutorial for Flash 5 is? I can find an expressions tutorial but it doesn't say what version it it is for.

Using Expressions In Flash
I know this sounds like a total noob question, but i'm somewhat new to actionscript. I would like to form values as expressions but I have not clue how to . I use Flash MX 2004. It is obviously different then the other versions, because I cannot click on some check box. Thanks for the help

Copyright Đ 2005-08 www.BigResource.com, All rights reserved