Check the attached example how to access the stage, it took about 5 lines ;) The document class can always be used for the Root class, because any other class can also be accessed without the document class.
Printable View
Check the attached example how to access the stage, it took about 5 lines ;) The document class can always be used for the Root class, because any other class can also be accessed without the document class.
Ok,
although the present class Root allows to place objects on stage, it does not allow to do anything with them, because the reference object belongs to the class Stage. To circumvent this, we have to change the script and reference to a MovieClip object. In the modified class the reference is to a Movieclip and it now allows properties and methods (gotoAndStop(), for example) of the MovieClip class.
PHP Code:package
{
import flash.display.MovieClip;
import flash.display.Sprite;
public class Root extends MovieClip
{
public static var _root:Sprite;
public function Root ()
{
_root = this;
}
}
}
For the ReferenceError, make sure you have Torpedo and Control classes to public. They're internal, not public by default.Quote:
Originally Posted by J-Rad
Great example mod. While I think AS3 is going to take some (lots) of time to really become a standard that everyone can use to it's full potential, it will certianly shorten development time and increase the flexability of flash - to say the least ;)
i have this problem too.
===========================
Card games is my nature,
Can you tell me the game for me?
Reveal your future, www.tarotcard-psychic.com/]tarot reading[/url]
www.tarotcard-psychic.com
What do you think about google technologies? do you think they're going to add support fot new features?
========================
video applications,
there're people who say
they can see visions
with tarot reading
www.tarotcard-psychic.com
i would like to stream that :)
I think yes, it is that much better. I was scared at first,
thinking that all the work I had done would be scrapped, etc.
The thing is... all that code still works. Now I can play. All the
the little time savers that AS1 and AS2 allow, also allow for the
possibility of SILENT run-time errors. Errors aren't a thing that many
flash coders are used to using because AS 1 & 2 don't really scold
you for making them. Errors are a tool. You can even manually throw
them to let you respond to unexpected user interaction. It's better
to know before you publish, right?
Also, I have to stick up for Flex. Focusing on code and treating Flash
produced swf's as images == less headache; It's a lot different,
though. Like if VB.Net was cool .
I used the older one b4 and i think its a little bit easier