Skip to main content
Participant
May 21, 2008
Question

What is wrong with this code please?

  • May 21, 2008
  • 1 reply
  • 245 views
Please I need help I dont know what else to try.

before converting to As 2.0 from as 1.0 and fp 6 this code laoded an image just fine

see code:



if (_root.templatedir ne "") {
loadMovie(_root.templatedir add "/" add _root.category add "/" add _root.theme add ".swf", "loadmoviebottom");
} else {
if (_root.templatedir1 ne "") {
loadMovie(_root.templatedir1 add "/" add _root.category add "/" add _root.theme add ".swf", "loadmoviebottom");
} else {
loadMovie(theme add ".swf", "loadmoviebottom");
}
}





after converting to as 2.0 and fp 8 and 9 the code wont load anymore

see code:


if (_root.templatedir != "") {
loadMovie(_root.templatedir + "/" + _root.category + "/" + _root.theme + ".swf", "loadmoviebottom");
} else {
if (_root.templatedir1 != "") {
loadMovie(_root.templatedir1 + "/" + _root.category + "/" + _root.theme + ".swf", "loadmoviebottom");
} else {
loadMovie(theme + ".swf", "loadmoviebottom");
}
}

I've experimrnted with both "==" operator and 'ne" and nothing happens.

the only way that I can get the images to load i if I publish in flash player 6.

please what is wrong with this code
This topic has been closed for replies.

1 reply

Inspiring
May 21, 2008
duneglow,

> if (_root.templatedir ne "") {
> loadMovie(_root.templatedir add "/" add _root.category add "/" add
> _root.theme add ".swf", "loadmoviebottom");

Flash Player 8 dropped support for the (very old) "add" string
concatenator. Replace all those "add"s with plus signs (+) and that may do
it. While you're at it, I recommend you also replace "ne" (not equal) with
the more modern != operator. (Just look up "Operators" in the Help panel
... it's not an especially long read, and really useful.)

There may be more, but those are the absolute basics.


David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design."