ActionScript 2.0 :: [MX2004] Img_n Variable To Be Equal To A Text Value?
Mar 8, 2005
I need the img_n variable below to be equal to a text value when hover_n equals different intergers.
img_n = ("i"+hover_n+"_caption");
For example, if hover_n=23, then img_n = i23_caption;
Is there a text equivalent to eval() or something that can return this value?
View 4 Replies
Similar Posts:
Jul 26, 2004
I have a preloader. On one frame of the preloader is the code:
i++
loadtext = i;
emptyMC = "holder"+i
allimages._visible = false;
allimages.createEmptyMovieClip("holder"+i, i);
allimages[emptyMC].loadMovie("weddingsintro"+i+".jpg");
Everything works fine, but the dynamic textfield with the var name loadtext is blank. If i set loadtext = i+"loaded" then it just displays "loaded". I know the variable "i" has a value since the rest of the preloader works.
View 4 Replies
Jul 26, 2004
I have a preloader. On one frame of the preloader is the code:[code]Everything works fine, but the dynamic textfield with the var name loadtext is blank. If i set loadtext = i+"loaded" then it just displays "loaded". I know the variable "i" has a value since the rest of the preloader works. Anyone know whats wrong?
View 4 Replies
Apr 21, 2009
Is there a way to write an "ANY" conditional statement? For example, I want to write an IF statement that if the user presses ANY of 10 specified keys, I want to execute the same bit of code.However, the only ways I know to accomplish this is by
1) writing a switch statement, which seems unwieldy because I'll have 10 separate cases which all duplicate the same [code]...
Is there a better/faster/more efficient way to check if a variable is equal to ANY of a set of values?
View 5 Replies
Feb 3, 2004
[Code]...
My dynamic text box is set to: _root.selectedcolor but instead of displaying "Rose" it displays"_root.fabric01_chip10_name" Basically I need to get the literal value to equal an expression- how do I do this????? I've done this before, but it's slipping my mind.
View 6 Replies
Sep 2, 2004
Can I make a variable equal two movieclips? Like:
nav1 = _root.nav.nav1 & _root.map.map1;
And then run a function that would control both? Like:
function closeout() {
nav1.gotoAndStop(3);
}
View 6 Replies
Jan 14, 2009
In the attached CS4 file I have attempted to have a button evaluate whether a variable (textbox) is equal to a number. If so, I want another textbox to say "correct" or trace "correct" either way. However, it doesnt appear to be evaluating the variable. I receive the "correct" trace everytime the button is released.
I tried to upload the file but it is too large. The code in the button is as follows:
on (release){
if (phoneNumber == "911");
trace ("correct");
}
I have a textbox entitled numbers, in which the user presses buttons and the number is added to the textbox. The same textbox has a variable assigned to it entitled phonenumber. When the talk button is pressed the code above should check the variable to see if it == 911. However no matter what I enter into the textbox, the trace always pops up and says correct.
View 2 Replies
Jul 12, 2009
any way to target a specific instance name based on what a variable is equal to? would be ALOT better than having to write the function 36+ times..
View 19 Replies
Oct 2, 2005
I've done a search and can't seem to find the right actionscript to add to a movieclip to make it appear as though it was just floating in place. Nothing complicated just a small random floating action where it's almost as though the letter is just sitting there in 0 gravity. Just slight enough movement to give it a little bit of interest.
I could make keyframes in a movieclip that would do this, but I'd like it to be a little bit more random than that. Plus, actionscripting the effect would lowere the file size.
View 1 Replies
Feb 5, 2005
i have an swf called movie1, on the main stage of movie1 i have a mc that is named xpos,inside xpos i have a dynamic text box and it's value is asigned to the Var=clipX.to get the value of clipX i used this code in the actions of xpos like this:
Code:
onClipEvent(enterFrame) {
clipX = (_root.object._x);
[code].....
View 3 Replies
Feb 5, 2005
i have an swf called movie1, on the main stage of movie1 i have a mc that is named xpos, inside xpos i have a dynamic text box and it's value is asigned to the Var=clipX. to get the value of clipX i used this code in the actions of xpos like this:
Code:
onClipEvent(enterFrame) {
clipX = (_root.object._x);
}
everything is fine and it works when i play movie1
[Code]...
View 3 Replies
Jun 24, 2010
I've been making something using sockets, and I've run into a problem. The outstanding data from the socket is loaded into a string, like so:
[Code]....
To check if a sentence started with PING, I wouldn't be able to, because it will only acknowledge the first line (even though I can append all of it to a text box fine). I also tried testing scenarios with strings containing multiple lines, but found that by making a string equal to multiple lined text, it produces this error:"1094: Syntax error: A string literal must be terminated before the line break.", and I checked, I didn't miss out any speech marks.
View 7 Replies
Aug 24, 2006
Is there a way to set the width of a text field equal to the width of the text in it?
View 1 Replies
Aug 27, 2010
The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:
class Student{
var id:int;
var name:String;[code]....
I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.
View 2 Replies
Oct 27, 2009
do i set the text field "grandTotal" on the stage to equal gT
var expenseTotal:Number;
var incomeTotal:Number;
var gT:Number;
[code].....
View 4 Replies
May 25, 2010
How do I reference the variable pointed to by the variable text but pointed to by more than one function?Say I have:
engine_level = 5;
tank_level = 3;
v_name = 'engine';
[code].....
View 4 Replies
Jan 5, 2012
How do I reference the variable pointed to by the variable text?
Say I have:
engine_level = 5;
v_name = 'engine';
pb_name = v_name + '_p_button'; // so pb_name = 'engine_p_button';
level = v_name + '_level'; // so level = 'engine_level';
[Code]......
View 2 Replies
Sep 8, 2003
I want to load an external variable called name from a text file into a local variable in flash called my_str...here's what I have:
var loadText = new loadVars();
loadText.onLoad = function(success) {
if (success) {
[Code]....
I need to have the variable my_str available outside the function..
View 3 Replies
May 29, 2009
I'm trying to make something that will show up in a dynac text field something like this:"[variable1] text text text [varibale2] text text text"I've linked the dynamic text field to a variable "resu" and set it to:var resu = variable1 + "text text text text" + variable2 + "text text text"The only problem is that when I make the variables random, they don't change
View 1 Replies
Feb 9, 2009
what does 9.2 x 100 equal to? it equals to 920. in actionscript 2 ,it shows the right result while on the other hand, actionscript 3 shows 919.9999 .
View 6 Replies
Dec 10, 2010
is it possible to make a comma (,) to equal (.) in as3?
example:
now i write
2.31 + 4 = 6.31
so it's possible to write
2,31 + 4 = 6,31
View 6 Replies
Feb 21, 2005
i've started to make like a quiz in flash with 218 questions in it! i've made it so the computer will show X amount of random questions.i've already got the code on the buttons so it will jump to a random question, but i'm having trouble with limiting the number of questions asked.
i've got an inputbox so the user can chose how many questions they do and the buttons add 1 each time thier pressed to a different variable.
i've got this code, but it never seems to stop asking questions
on (release) {
score = score+0;
page = page+1
if( (page == pagemax) )
GotoAndStop(220)
if( (page != pagemax) )
myVariable = random(219); //creates a random number between 0 and 5
if (myVariable < 2){ //checks to see if it's value is zero
myVariable = 2; //set it to 1 if it is zero
}
gotoAndStop(myVariable); //goes to and plays the frame.
}
View 14 Replies
Jan 31, 2010
I have a couple of mc's that are added to the stage after one another.I want them to have equal space between them.Here i the code snippet with the problem, below is the full code.
Code:
for each (var link:XML in settingsXML.links.link) {
i++;
newsItem = new NewsItem();
newsItem.menuLabel.text = link.@name;
[code]....
View 2 Replies
Nov 23, 2011
I've seen similar threads but couldn't find one with the exact same issue. I've a PDF / Word document with arabic copy when I try pasting that text in flash all the joined letters start appearing as individual letters.I've tried the dynamic text box solution in which you create a dynamic text box and assign the text to its variable that doesn't work. But strangely when you write arabic in dynamic text box (with out assigning the text to the variable) and double click to select the text box and its content the text starts appearing fine .. but when published its again all individual letter.
View 1 Replies
May 21, 2011
Alright so lets say I have a number of movieclips or text fields or something with instance names test1, test2, test3 and so forth. Now say I want to fill these text fields with text that I have in an array and I want to do this with a loop, how do I do this? What I'm really asking is if there is a way to use a variable in an instance name if you catch my drift.
[Code]...
View 1 Replies
Nov 6, 2009
There's a movieclip, lets call it myMovieClip. Inside this movieclip there is a dynamic text box, lets call this one myText. Now to change the text within this text box that is embedded in a movieclip, it's simply:
[Code]....
However, what if there is a variable, called myVariable that stores the instance name of the text box. With only one text box I know it's pointless, but for the sake of example, lets leave it simple. So, suddenly the code looks like:
[Code]....
View 2 Replies
Nov 29, 2009
I have a class that loads data from a text file and puts it into an array called tdv.importedTxtArray (public var).In a separate class i have written [code]The infoArray does not then contain the imported text however because tdv.importedTxtArray is not given its popper contents until about 1/2 a second after the tdvLoader class executes (i.e: when Event.COMPLETE is run and the array is populated with strings from the external text file). Subsequently in the code above infoArray is set to a blank array.How can i get the code in my separate class to ''wait' until tdv.importedTxtArray is properly populated before accessing it.
View 2 Replies
May 18, 2005
i can't get flash to show, and in a dynamic text box which loads text via a variable from a .txt file on a server.
View 2 Replies
Feb 1, 2009
I have the attached .fla file that was created in MX2004 but I only have CS4 to work with. Is there a way to convert this so I can use it?
View 2 Replies
Oct 4, 2010
I have a test field that I've created dynamically. If I add text to it by writing: myField.text = "some text" the text appears, but if I add text using a variable I don't see anything. If I trace the text field's text trace("text = " myField.text) I get the right value.
View 6 Replies