简体   繁体   中英

Extending Sprite Using Flex?

I have done all of my Flash applications up until now with the Flash IDE (although I rarely use the timelines, since I prefer to do everything in code) or in FlexBuilder as Flex applications. Are apps that just extend Sprite (used in the FlexBuilder IDE, for instance) a viable way of doing an application, or are they just for HelloWorlds? Under what conditions would you not bother to use the Flash IDE? Can MXML files be used with apps that just extend Sprite?

Note: I'm not asking when to use Flex vs. Flash. I am also not asking whether the Flash IDE or the FlexBuilder IDE is better for editing ActionScript files.

Edit: What I mean by "can MXML files be used with apps that just extend Sprite?" I am referring to whether you can use MXML markup in an Actionscript 3.0 file in Flexbuilder 3. I'm pretty sure you cannot do this.

Are apps that just extend Sprite (used in the FlexBuilder IDE, for instance) a viable way of doing an application, or are they just for HelloWorlds?

In Flex you have the option of extending the Sprite class or implementing the IUIComponent class. There are differences though.

Under what conditions would you not bother to use the Flash IDE?

Do you need dataservices? In that case, I am not too sure how easy it is to work with the Flash IDE.

Can MXML files be used with apps that just extend Sprite?

Not too sure what you mean by apps . However, AS3 components work just fine with MXML. Sprites will have to be wrapped up in some sort of a IUIComponent if you are using it with MXML. MXML is syntactic sugar. It is compiled into AS3 and as such may not be as efficient if you were to code them up.

This blogpost may be of interest to you.

I think the simple answer is "YES". I have built multiple sites and apps in pure AS3 that "just extend Sprite" in FlexBuilder.

I like to code, so I don't use the flash IDE for anything. That said, I see how much faster my Flash buddies can build some things, so I suggest building small, individual effects in Flash and then importing the .swc file into FlexBuilder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM