diff --git a/.gitignore b/.gitignore index da97ff7..fedd318 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swf +*.swc diff --git a/03d1-datagrid/DataGridExample.mxml b/03d1-datagrid/DataGridExample.mxml index c7df993..e69a051 100644 --- a/03d1-datagrid/DataGridExample.mxml +++ b/03d1-datagrid/DataGridExample.mxml @@ -13,11 +13,13 @@ import mx.rpc.events.FaultEvent; import mx.controls.Alert; + import RequestParams; + [Bindable] private var photoFeed:ArrayCollection; private function requestPhotos():void { - var params:Object = new Object(); + var params:RequestParams = new RequestParams(); params.format = 'rss_200_enc'; params.tags = searchTerms.text; photoService.send(params); diff --git a/Makefile b/Makefile index 71d449b..c28c014 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,11 @@ # http://learn.adobe.com/wiki/display/Flex/Getting+Started -# sets mxmlc to just the basename "mxmlc" +# sets mxmlc and compc to their respective basenames # if not overridden in command line like so: # make MXMLC=/path/to/my/mxmlc MXMLC ?= mxmlc +COMPC ?= compc # define all target swf paths (which don't yet exist if @@ -14,16 +15,29 @@ MXMLC ?= mxmlc SWFS = $(patsubst %.mxml,%.swf,$(wildcard [0-9]*-*/*.mxml)) +# define all target swc paths (same as with swf paths above) +SWCS = $(patsubst %.as,%.swc,$(wildcard comps/*.as)) + + # define an implicit build rule for any file matching %.swf, # using the $< (input) and $@ (output) automatic variables %.swf : %.mxml - $(MXMLC) $< -warnings -output $@ + $(MXMLC) $< -warnings -l+=./comps -output $@ + + +# define an implicit build rule for any file matching %.swc, +# using the $< (input) and $@ (output) automatic variables +# just like with the %.swf implicit rule above +%.swc : %.as + _CLS=$$(echo $< | sed 's@.*/\(.*\)\..*$$@\1@') && \ + $(COMPC) -sp ./comps -output $@ -include-classes $$_CLS -# build all expected swf files -all: $(SWFS) +# build all expected swf and swc files +all: $(SWCS) $(SWFS) # remove all swf files in the tree clean: - find -name \*.swf -exec rm {} \; + find -name \*.swf -exec rm {} \; ; \ + find -name \*.swc -exec rm {} \; diff --git a/comps/RequestParams.as b/comps/RequestParams.as new file mode 100644 index 0000000..d6ccb46 --- /dev/null +++ b/comps/RequestParams.as @@ -0,0 +1,8 @@ +package +{ + public class RequestParams + { + public var format:String; + public var tags:String; + } +}