tests: Add a test for child events using the same timeline structure as the structure test.
This commit is contained in:
parent
11d7fe5107
commit
3707ef7fec
|
@ -0,0 +1,10 @@
|
|||
package {
|
||||
import flash.display.MovieClip
|
||||
|
||||
public class DownButtonShape extends EventWatcher {
|
||||
public function DownButtonShape() {
|
||||
trace("//Constructed DownButtonShape (", this.name, ")!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package {
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
|
||||
public class EventWatcher extends MovieClip {
|
||||
public function EventWatcher() {
|
||||
super();
|
||||
this.setup();
|
||||
}
|
||||
|
||||
function trace_event(event: Event) {
|
||||
trace(this.name + ":" + event);
|
||||
}
|
||||
|
||||
public function setup() {
|
||||
this.addEventListener(Event.ENTER_FRAME, this.trace_event);
|
||||
this.addEventListener(Event.EXIT_FRAME, this.trace_event);
|
||||
this.addEventListener(Event.ADDED, this.trace_event);
|
||||
this.addEventListener(Event.ADDED_TO_STAGE, this.trace_event);
|
||||
this.addEventListener(Event.FRAME_CONSTRUCTED, this.trace_event);
|
||||
this.addEventListener(Event.REMOVED, this.trace_event);
|
||||
this.addEventListener(Event.REMOVED_FROM_STAGE, this.trace_event);
|
||||
this.addEventListener(Event.RENDER, this.trace_event);
|
||||
}
|
||||
|
||||
public function destroy() {
|
||||
this.removeEventListener(Event.ENTER_FRAME, this.trace_event);
|
||||
this.removeEventListener(Event.EXIT_FRAME, this.trace_event);
|
||||
this.removeEventListener(Event.ADDED, this.trace_event);
|
||||
this.removeEventListener(Event.ADDED_TO_STAGE, this.trace_event);
|
||||
this.removeEventListener(Event.FRAME_CONSTRUCTED, this.trace_event);
|
||||
this.removeEventListener(Event.REMOVED, this.trace_event);
|
||||
this.removeEventListener(Event.REMOVED_FROM_STAGE, this.trace_event);
|
||||
this.removeEventListener(Event.RENDER, this.trace_event);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package {
|
||||
import flash.display.MovieClip
|
||||
|
||||
public class HitButtonShape extends EventWatcher {
|
||||
public function HitButtonShape() {
|
||||
trace("//Constructed HitButtonShape (", this.name, ")!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package {
|
||||
import flash.display.MovieClip
|
||||
|
||||
public class OverButtonShape extends EventWatcher {
|
||||
public function OverButtonShape() {
|
||||
trace("//Constructed OverButtonShape (", this.name, ")!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package {
|
||||
import flash.display.MovieClip
|
||||
|
||||
public class UpButtonShape extends EventWatcher {
|
||||
public function UpButtonShape() {
|
||||
trace("//Constructed UpButtonShape (", this.name, ")!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
//Constructed UpButtonShape ( instance2 )!
|
||||
//Constructed OverButtonShape ( instance4 )!
|
||||
//Constructed DownButtonShape ( instance6 )!
|
||||
instance2:[Event type="added" bubbles=true cancelable=false eventPhase=2]
|
||||
instance2:[Event type="addedToStage" bubbles=false cancelable=false eventPhase=2]
|
||||
instance2:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
instance4:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
instance6:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
//Up Button Shape frame 1
|
||||
//Over Button Shape frame 1
|
||||
//Down Button Shape frame 1
|
||||
instance2:[Event type="exitFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance4:[Event type="exitFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance6:[Event type="exitFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance2:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
instance4:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
instance6:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
//MainTimeline frame 1
|
||||
instance2:[Event type="exitFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance4:[Event type="exitFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance6:[Event type="exitFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance2:[Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance4:[Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance6:[Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
instance2:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
instance4:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
instance6:[Event type="frameConstructed" bubbles=false cancelable=false eventPhase=2]
|
||||
//MainTimeline frame 2
|
||||
//Up Button Shape Frame 2
|
||||
//Down Button Shape Frame 2
|
||||
//Over Button Shape Frame 2
|
Binary file not shown.
Binary file not shown.
|
@ -573,6 +573,7 @@ swf_tests! {
|
|||
(as3_stage_properties, "avm2/stage_properties", 1),
|
||||
(as3_closures, "avm2/closures", 1),
|
||||
(as3_simplebutton_structure, "avm2/simplebutton_structure", 2),
|
||||
(as3_simplebutton_childevents, "avm2/simplebutton_childevents", 2),
|
||||
}
|
||||
|
||||
// TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough.
|
||||
|
|
Loading…
Reference in New Issue