If you are looking for a HelloWorld, see the bottom of this email.  Here's the quick(?) skizzy on the various technologies.
 
Don't have time?  Read to the ######### to skip the background.
 
Flash Player 8.5 is engineered to work with the improved ActionScript 3 language, and have pimp new features.
 
ActionScript 3 is a clean-up of ActionScript 2, a stricter adherence to ECMA (depending on who you talk to), and organized around the new package organization structure with additional constructs added in.
 
Can you create applications alone with those 2 technologies?  Yes.  Would I personally want to?  Hell no.  If you paid me too?  Nope, because I'd inform you that you are over-paying.
 
Flex Framework 2 is the creation of a set of compoents and framework classes to do all the things needed to create applications.  Your buttons, and dropdowns and datagrids, your data classes that expose server operations in a clean and easy to use API.  Your modality, focus management, binding, etc.
 
The same reason you use the Flex Framework 2 to create applications instead of pure ActionScript 3 is the same reason you use Rails for Ruby, ActionStep for C, Cake for PHP... common problems, tasks, and needs are solved by well written and proven application component frameworks.  Re-inventing the wheel, while cool from a developer's standpoint, is not cost-effective business.
 
On the flip-side, there are many who will never use the Flex 2 framework.  For example, I currently cannot use it's pre-decessor, the v2 component framework for Flash 7 on my cell phone; I have to resort to pure ActionScript 2 and modified-Flash Player 7 technology.  I have no choice, the CPU and RAM requirements of the phone force me to do so.  Naturally, 2 things happen; the scope of my work is greatly limited, and I still make at least a lean set, enough to get me to an acceptable level (buttons, labels, image loaders, etc.).
 
Now, Flex is unique in that mxmlc, the commandline compiler, actually knows about things like MXML as well as ActionScript files, and compile both into a SWF.  This is further expanded upon because the mxmlc and the Flex Framework were built in tandem, allowing certain compilation features and framework features to be mutually exclusive in benefit.  Therefore, while there is no reason someone couldn't port the ActionStep framework to ActionScript (they are actually...), Flex Framework has an advantage out of the starting gate because it takes advantage of some of the new features mxmlc has in regards to creating SWF's.
 
Bottom line, while you can do this:
 
var a:Sprite = new Sprite();
addChild(a);
a.addEventListener(Event.CLICK, onPress);
var g:Graphics = graphics;
a.beginFill(0x000000);
a.lineTo(100, 0);
a.lineTo(100, 22);
a.lineTo(0, 22);
a.lineTo(0, 0);
a.endFill();
 
...using the framework, you can do this instead:
 
<mx:Button click="onPress" />
 
Beyond the portability of the code, let-alone readability, it's approachability from those with an HTML background, it has many other benefits not so easily visible.
- built-in focus management
- already looks like a button
- has an optional label
- has rounded corners looking more like a button than a box
- is in the MX namespace, allowing other buttons to be differentiated
- has rollover states
 
... I could go on all night.
 
Yes, there is more overhead, but it is negligible, ecspecially with the speed improvements made in Flash Player 8.5.  At this point in the software industry, there is little point to do these things in code when months of development consisting of dozens of developers, qa, managers, etc. has already been done for you.. and it's free I might add.
 
...unless of course you are developing for a phone, set-top box, XBox, or some other low-resource environ, where I'd concur it is a wise decision to abandon the framework.  Of course, we aren't there yet.
 
 
#########
Bottom line, if you create a Flex project, you have to use Flex components (at least at the forefront) as shown here:
 
 
 
 
----- Original Message -----
From: Mark Wales
Sent: Saturday, February 18, 2006 12:14 AM
Subject: [flexcoders] Actionscript-based Applications with Flex 2

 

I am interested in writing an “all Actionscript” application (i.e. using the Actionscript project option within the Eclipse-based Flex Builder) that combines both Flex-based and traditional Flash-based components.

 

For example, I want to define a Canvas on one side of the screen and populate it with the traditional Flex-based components then create things like DisplayObjects, Sprites, whatever on the other side – while having events from both “sides” intermingled (for lack of a better word) using events and listeners. I am fine going with a strictly “Flash 8.5” diet (that is the future after all, right?).

 

Everything I read seems to imply that these must be in different SWFs and that there is a fair bit of gymnastics involved in achieving even nominal interoperation between the two paradigms.

 

Am I missing something? Are there any “simple” examples out there to illustrate how this might work? (Preferably ones that don’t require CF like the FileUpload example on the Macromedia site, don’t try to get fancy with MovieClips and animation, etc.)

 

The ideal scenario would be an application where, on the Flex “side” I could pick “square” from a pull-down list of a few standard shapes, press a button, and something vaguely resembling that description would appear using flash components. Then, when that component was clicked/moved, perhaps it could make the name of the event that fired show up in a Flex label. Effectively the “Hello World” of the new and improved Actionscript. Does anyone have anything like that?

 

-Mark




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to