-
As2 code not working in as3
The following code
listVariables(_root);
function listVariables(mc:MovieClip): Void
{whatever.......
}
works flawlessly in a as2 file but gives me the error 1046 saying sth like"not valid ...: Void",but if i change void to "string", it tells me there is noresult.Any ideas?
-
Yes, learn a bit about as3. It is not as2, and you shouldn't expect as2 code to work.
-
Now that I'm not on my phone, I can give you some more specifics.
_root is now root. It is typed as DisplayObject, so if you want to use it as a MovieClip, you have to cast it as such.
Void should not be capitalized.
If you do declare that a function has a non-void return type, it must return something of the declared type.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|