what does that in ActionScript 3 - apache-flex

Hi Does any one tell me what is [Event(name="change", type="flash.events.Event")] this?
I'm using ActionScript 3.0 in Adobe Flash IDE.

In Flash Builder, the metadata is used for ASDocs and code hinting. It means that the component/class which has that data may dispatch an event named "Change" which has class type of "flash.events.Event".
It could be considered a developer helper. It isn't required, but it makes things a bit easier for other developers using your class.
More info on Metadata.
I couldn't find any metadata tag documentation on Flash Pro or AS3. But, here is a blog post that covers some stuff.

Related

Class Diagram from mxml - flex file

So i am building an application on flex for a client and he asked me if i can provide him with a class diagram. I was wondering if there is a simple way to do it with a program (like visio or something) as done in java. Thanx
Grant Skinner's gModeler might be of interest.
Cited from the gModeler site:
gModeler is a free online UML diagramming and documentation tool,
targetted at developers working with ECMA 262 languages such as
FlashMX's Actionscript, and Javascript. In addition to it's
diagramming capabilities, it exports HTML documentation, FlashMX XML
documentation (for the Action Panel and Reference Panel) and stub code
(class code).

Is Adobe Flex all XML-based?

I am trying to develop an Android application and I heard that for someone with less-than-superior java skills, AIR/Flex might be a good place to start.
I am noticing that all I see in Flash Builder is MXML-based. Is this how all of the code in Flex written? Via XML?
It depends what you mean by "XML". MXML can contain chunks of ActionScript code both in blocks between <script> tags and right in line in attributes to controls tags, such as
<s:button click="someObject.DoSomething()">
This ActionScript embedded in MXML file is the pattern largely presented in the Flex in a Week series noted by #www-flextras-com.
But you can also have full, dedicated ActionScript files, both directly associated with .mxml objects and all by themselves. This "Code-Behind" design pattern is very much like the XAML design + C# code-behind combination in Windows Presentation Foundation applications.
An good introduction with a viewable example of strict code-behind in Flex :
Article
Browseable source code
Flex is a declarative, tag-based way of writing rich applications. Under the hood it is all ActionScript, though, so it is very easy to marry ActionScript code into a Flex application (as you often must do).
When I have coded with Flex, I use it as a declarative language. I use the tags to build out Views and data-driven containers. Then I write ActionScript classes to do all the imperative control logic. The relationship is similar to the one between JSP and Java, or (sort of) HTML and JavaScript.
In a nutshell though, yes, you can write whole Flex applications with its XML-like syntax and resort to ActionScript just to glue bits and pieces together, write small handler functions, etc.
This guy is a Flex genius and wrote a great book on it: http://dougmccune.com/blog/
HTH!
Flex is a mix of MXML and ActionScript. MXML is indeed XML based; but ActionScript is an ECMA compliant language. Conceptually similar to JavaScript.
I suggest you start by reading through the Flex docs to give you some background. The Flex in a Week tutorials come strongly recommended.

Displaying Actionscript Documentation in Eclipse

This is probably a very basic question, but how does one enable the actionscript documentation to appear properly in Eclipse? For example, if you hover over addChild, the ASDoc view brings up the class hierarchy with flash.display.DisplayObjectContainer.addChild(child:DisplayObject):DisplayObject, but does not give any of the details, descriptive text, parameters, etc. If I write my own documentation using the /** */ format, it does appear in there. What have I done wrong? :P
I'm using the Helios version of Eclipse with Flash Builder 4. Thanks!
If you are talking about something like following:
then, it is available in Flash Builder. You might want to try it.

Flex and Flash CS, how the integration is done?

Flex is good at produce code, whereas Flash is good at animation, how the integration is done? If I want to insert the animcation produced by flash, what's the recommend way to do the integration? Do I need to use SWFLoader?
It really depends on what you are doing. For most apps, you can simply have a Flash control embedded inside your Flex MXML design. You shouldn't need a book/tutorial for this, since it's just pointing the control's swf obj source to your swf - Adobe has lots of documentation on using the controls.

Getting Better at FlashDevelop

Hey guys, I have been programming with as3 for the past 4 months and Ive been getting rather good at it. I just recently decided to work with flashdevelop. I notice that there is alot of code that is availible in the flex sdk that isn't available in as3 with flash cs4. Like embedding of assets and such. I've been trying to find some up to date tutorials on how to embed things like xml and so far the tutorials are inaccurate or unclear about how to go about doing so. Ive been trying to find some good books that cover that and havnt been able to.
The books either cover as3 with flash or as and flex builder. Which is more towards working with the mxml. I havnt been able to find any books on how to work with as3 and flex sdk. Which show examples like embedding of xml and so on. I was just curious does anyone know of any good books that cover EVERYTHING there is to know about as3 and the flex sdk. Not so much on flex builder and mxml.
In a sense, I just want to get better with working with as3 projects with flashdevelop. And it would be great if there was books that covered that. Cause lets just face it, We developers sometimes just get sick of searching the web for bits of pieces of things. and its just great to have that one good book that references everything.
If no one know's of any good books then I guess website can do. but they cant be
http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/
or
http://mattmakesgames.com/blog/2009/06/embedding-xml-in-as3.html
The first one wasn't too bad, they just wasn't clear on how to tap into the nodes, second one was just wrong about how parse the xml. atleast for me he was. I did it line by line and got errors. I just need to get better at flash develop.
Thanks guys!!
Ok, so it seems like when you refer to the "Flex SDK" you are actually mean the MXMLC (the Flex compiler), and not the SDK (although the compiler is part of the SDK).
Both Flash Builder (Flex Builder) and FlashDevelop use MXMLC to compile your SWFs. An exception is that in FlashDevelop if "No Output" is checked in your project settings, then it will tell Flash (Authoring) to compile your SWF. Flash uses its own compiler.
Using the MXMLC compiler, does not mean you must use the Flex framework. It can compile pure AS3 projects too.
Ask youself - Do you need to "embed" the XML document? Can't you just load it in at runtime?
Here is a great run through of MXMLC by Senocular. It's a little dated, but it all should still work, and will give you a greater understanding of what is actually going on. It is a little long, so you could print it out, staple it together, so it feels like a book :) Here is another quicker guide to MXMLC from Erik Johnson.
I think you just have to find a good workflow that works for you. Usually I create all my assets in Flash, then publish them out to a SWC. Then I have a Pure AS3 FlashDevelop project that imports the SWC (right click the SWC in FlashDevelop and click "Add to Library"). I then just use AS3 to chuck the graphics around and do all the magic. Read this post for more info.
You can embed almost anything you want in your swf
FlashDevelop's own wiki has also some good workflow tutorials for all three compiling options (i.e. Compile using Flash, Compile using Flex SDK and create assets using Flash, and Compile using Flex SDK only).
http://www.flashdevelop.org/wikidocs/index.php?title=AS3

Resources