Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
amphibianZ #1
pass variable to custom function not working MX
I have an app that I built in Flash 5 that I want to output in Flash MX (not
2004, though) but part of my code, which works fine as Flash 5 swf, breaks in
Flash 6 swf. I am loading text from an external text file, and then passing the
text contents of each variable to a function (to strip line breaks). Following
is the code... does anyone know how to rewrite this so that it will work in
Flash 6? The contents of the variable are not getting passed, and eval does not
work on left side of expression...
Thanks in advance for help.
-S
// content, correct, Q1, Q2, Q3, etc are all variable loaded from external
text file. I am trying to pass contents of variables, which is why I need to
eval them. This worked in Flash 5, but not in Flash MX if I publish as Flash
Player 6 file.
temp = stripLineBreak("content");
temp = stripLineBreak("correct");
for (i=1; i<=10; i++){
z="Q"+i
temp = stripLineBreak(z);
}
function stripLineBreak(x) {
tempArray = new Array();
tempArray = eval(x).split("\r");
eval(x) = tempArray.join("");
tempArray.splice(0,tempArray.length);
tempArray = eval(x).split("\n");
eval(x) = tempArray.join("");
tempArray.splice(0,tempArray.length);
}
amphibianZ Guest
-
The variable won't pass
The problem I am having is with setting a variable which would hold an id and it would be used on multiple pages. The variable should change when... -
how to pass variable in TitleWindow
hi all , can we pass variable in TitleWindow ??? where i put my variable??? mx.managers.PopUpManager.createPopUp(_root, inVoice,true,... -
Login needs to pass variable
The profile form CFINCLUDEs the login page in the header. If I attempt to view the profile.cfm?userID=XX I am switched to the login form as... -
How to pass a variable to .t file
Can someone help me understand how does one pass variable to a Perl test script from the calling program? Is such a mechanism available? To... -
[PHP] Still can't pass variable through url
<?php $year=1999; $month=march; echo "<a href=\"http://www.thingamajigger.com/index.php?year=$year&month=$month\" ?> -
Peter Blumenthal #2
Re: pass variable to custom function not working MX
I can't test this because I don't have your data or .FLA, but this could do
it:
temp = stripLineBreak(this.content);
temp = stripLineBreak(this.correct);
for (i=1; i<=10; i++) {
z = this["Q"+i];
temp = stripLineBreak(z);
}
function stripLineBreak(x) {
tempArray = new Array();
tempArray = x.split("\r");
x = tempArray.join("");
tempArray.splice(0, tempArray.length);
tempArray = x.split("\n");
x = tempArray.join("");
tempArray.splice(0, tempArray.length);
}
hth
}`¬P
--
---------------------------------------
[url]http://www.phageinteractive.com[/url]
PhageInteractive Ltd.
remove mm_ to mail
---------------------------------------
'I wish we lived in a world where it was possible to be religious and think
at the same time.' - Jonh Graves
Peter Blumenthal Guest



Reply With Quote

