Log in

View Full Version : Resolved import flash class question



evan
12-08-2008, 08:21 PM
I am reviewing examples of .as files with document classes as I learn to code outside the timeline.

Step by step I am finding examples seeing which each class does what.

I am not sure what "Event" does in plain english.



Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false)
Creates an Event object to pass as a parameter to event listeners.

can anyone translate?

I think that when I want to create an evennListener like this:

stage.removeEventListener(Event.ENTER_FRAME, onFrameLoop);

I need "Event" is that right?

BLiZZaRD
12-09-2008, 03:54 PM
Check out this article (http://www.actionscript.org/resources/articles/114/1/The-Flash-MX-Event-Model/Page1.html) on Event Handling. It's pretty informative.

evan
12-09-2008, 06:49 PM
As I learn more AS3 and use the document class or create a custom class
that needs to be imported into the .fla using OOP

I have to do this inside my package:


import flash.display.MovieClip;
import flash.events.Event;

So, in order to set set up a listener to "hear" an event as an -as poosed to mouse event or keyboard event I have to use EVENT

A keyboard event I import keyboardEvents like this:

import.flash.events.KeyboardEvent

When I code into the timneline I don't have to import these things

But when i code externally I need to import all flash classes that apply to what I'm doing. The trick is knowing what these things are and what they all do.

BLiZZaRD
12-09-2008, 07:16 PM
Correct.

Unless there was a question in there somewhere? :D