diff --git a/Makefile b/Makefile index 8a8fbc6..16b8106 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,13 @@ # make MXMLC=/path/to/my/mxmlc MXMLC ?= mxmlc COMPC ?= compc + ifdef DEBUG MXMLC_FLAGS ?= -warnings -strict -debug -keep-generated-actionscript else MXMLC_FLAGS ?= -warnings -strict endif +MXMLC_FLAGS += -l+=$(HOME)/.local/share/flexunit # define all dependency mxml paths and their swf path targets diff --git a/custom-03g1-debugging/Debugging.mxml b/custom-03g1-debugging/Debugging.mxml new file mode 100644 index 0000000..5d65140 --- /dev/null +++ b/custom-03g1-debugging/Debugging.mxml @@ -0,0 +1,5 @@ + + diff --git a/custom-03g1-debugging/me/DebuggingApp.as b/custom-03g1-debugging/me/DebuggingApp.as new file mode 100644 index 0000000..2dc84a4 --- /dev/null +++ b/custom-03g1-debugging/me/DebuggingApp.as @@ -0,0 +1,36 @@ +package me +{ + import mx.core.Application; + import mx.controls.Alert; + import mx.controls.Button; + + import flash.events.Event; + import flash.events.MouseEvent; + + public class DebuggingApp extends Application + { + public var clickButton:Button; + + public function DebuggingApp():void + { + this.addEventListener("creationComplete", initApp); + clickButton = new Button(); + clickButton.label = "Click Me"; + clickButton.addEventListener("click", showAlert); + this.addChild(clickButton); + } + + public function showAlert(event:MouseEvent):void + { + Alert.show('Hello from Flex'); + trace("Clickety Click! -> " + event); + } + + public function initApp(event:Event):void + { + trace("Hello from Flex Debugging!"); + var myVar:Number = 9; + trace("The value of myVar is " + myVar); + } + } +} diff --git a/custom-03g1-debugging/me/tests/TestDebugging.as b/custom-03g1-debugging/me/tests/TestDebugging.as new file mode 100644 index 0000000..d9ccf94 --- /dev/null +++ b/custom-03g1-debugging/me/tests/TestDebugging.as @@ -0,0 +1,27 @@ +package me.tests +{ + import me.Debugging; + + import mx.core.Application; + import org.flexunit.listeners.UIListener; + import org.flexunit.runner.TestRunnerBase; + import org.flexunit.runner.FlexUnitCore; + + public class TestDebugging extends Application + { + public var uiListener:TestRunnerBase; + private var core:FlexUnitCore; + + public function TestDebugging():void + { + this.addEventListener("creationComplete", runMe); + } + + public function runMe():void + { + core = new FlexUnitCore(); + core.addListener(new UIListener(uiListener)); + core.run(Debugging); + } + } +} diff --git a/targets.mk b/targets.mk index 23e0f80..a685d2d 100644 --- a/targets.mk +++ b/targets.mk @@ -199,3 +199,7 @@ custom-03d4-tilelist/TileListExample.swf: custom-03d4-tilelist/TileListExample.m $(MXMLC) custom-03d4-tilelist/TileListExample.mxml $(MXMLC_FLAGS) -l+=custom-03d4-tilelist -o custom-03d4-tilelist/TileListExample.swf +custom-03g1-debugging/Debugging.swf: custom-03g1-debugging/Debugging.mxml custom-03g1-debugging/me/DebuggingApp.as custom-03g1-debugging/me/tests/TestDebugging.as + $(MXMLC) custom-03g1-debugging/Debugging.mxml $(MXMLC_FLAGS) -l+=custom-03g1-debugging -o custom-03g1-debugging/Debugging.swf + +