PDA

View Full Version : lost script functionality


luke
03-18-2002, 09:05 PM
Greets everyone :)

I've been gone for quite a while, but with the release of MX, I get to focus on flash for a while again! yay!

My question is this:
Has anyone else experienced last functionality in actionscript written in Flash 5 but published in Flash MX?

I had an fla that I made in 5, I made some graphic changes in MX, republished it & the actionscipt no longer works - even when published with flash5 compatability.

I re-opened it in 5 & published it again & it works fine.

Any ideas?

Cheers,
_luke

Nav
03-18-2002, 11:21 PM
There are some minor differences in which flash 5 and flash MX compare numbers... so if you're using Number any where you might need to add valueOf()

eg:

a=new Number(2);
b=new Number(2);

trace (a == b); //true in flash 5, false in flash 6
trace(a.valueOf()==b.valueOf());//true in both


Hope that helps...

Cheers
Nav

MixMatch
03-19-2002, 10:40 AM
and what would be the point of a change like that???

BTW, I've lost some script functionality also, but maybe saving the .fla as flash 5 or exporting for flash 5 would prevent this. Personally, I wouldn't mind re-writing everything, I like MX style a lot more :D

luke
03-19-2002, 06:10 PM
well, I still can't figure it out.

Here's the scenario:

I'm assigning some string variables in the first frame & then parsing them apart & reading them into some dynamic variable fields elswhere in the movie.

the symptoms:

when the movie is published, the text in the fields is not visible, but the fields are there. i.e. if the text field value is null, the script sets _visible to false, but these are not getting turned off, you just can't see them.

clicking on the button (which sits over the text field) result in the popping the correct window, so the correct part of the string is getting parsed & passed to javascript.

the code looks something like this:


1_fullstring = "1822743;this is display text"


it's parsed like this:


function parseMe(inString) {

delim = ";";
splitString = inString.split(delim);
outstring = splitString[1];

return outstring;
}


then


for (i=1; i <= 20; i++) {
newVar = eval(i + "_fullstring");
eval(i + "_title") = parseMe(newVar);
}


there are 20 titles to parse

I'd post the fla, but it's a bit to big. I know it's a long shot, but if anyone else has had this happen, let me know.

_luke

p.s. it's good to be back on the forum ;)

luke
03-19-2002, 06:21 PM
heh - after that big long post, I figued it out myself ;P

eval is depreciated in MX.

I changed

--------------------------------------------------------------------------------
for (i=1; i <= 20; i++) {
newVar = eval(i + "_fullstring");
eval(i + "_title") = parseMe(newVar);
}


to

--------------------------------------------------------------------------------
for (i=1; i <= 20; i++) {
newVar = this[i + "_fullstring"];
this[i + "_title"] = parseMe(newVar);
}


and it all worked fine.