View Full Version : Linkage in AS2.0 vs 3.0
when link a movieclip using linkage in an as 2.0 movie, it doesn't fill in anything in the field for "class"
Yet in AS 3.0 it automatically fills in:
flash.display.MovieClip
under "class"
AS 2 likes "_root"
punstc
05-31-2008, 04:57 AM
AS3 basically revolves around classes, and OOP, every time you set up a linkage in AS3 flash is actually righting a class file for you. the flash.display.MovieClip is the inheritance for what your creating. its basically saying this has all the properties of the MovieClip class. That is why it will have a time line and all that, you could easily say flash.display.Sprite there, and it will automatically be changed to an instance of a Sprite in flash, even if you said movie clip when creating your symbol.
hope that explains what you were stating.
Medyman
05-31-2008, 04:25 PM
when link a movieclip using linkage in an as 2.0 movie, it doesn't fill in anything in the field for "class"
Yet in AS 3.0 it automatically fills in:
flash.display.MovieClip
under "class"
AS 2 likes "_root"
The _root depth shouldn't be used in AS2 or AS3. For your basic 1 level Flash project, it'll work. But as soon as you start getting into multi-level applications (.swf inside of .swf), it's gets horribly complicated.
Plus, if you're switching to AS3, it's good habit to get away from it.
75samsonite
05-31-2008, 08:48 PM
If you want to learn how flash buttons and links work in actionscript 3.0, this video explains perfectly. It's pretty straight forward:
http://www.howvids.com/Computer/ActionScript_30_Communicating_with_Buttons_and_Linking-Flash.ad2
I use event listeners allot and I never needed to use:
import.flash.events.MOUSE_EVENT
and my code runs fine.
before my code, why is it used in this example?
and what is the benefit?
Medyman
06-01-2008, 04:27 AM
The author of that tutorial is wrong in this aspect. It seems (based on other tutorials on his site), that he's more of a timeline-based Flash user than an ActionScript-er.
The flash.event class package does not need to be explicitly imported when you're coding within the Flash IDE. If you were creating an OOP application, and had external AS files which were referenced, then you would need to explicitly import the flash.events into that AS file. The same applies for the flash.display package.
this is good to know since after I make the first version of my project, then I plan on changing it around to suit external .as files so as to break up the job into components and share it with other people.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.