ActionScript 3.0 :: Flex Builder W. Flash Library Items?
May 6, 2009
I have found a way! It's very complicated though... Hopefully someone has an idea on how to clean this up...
The workflow:
------------------
I'm using Flash to draw movieClips which are exported as one assets.swc file and then used in Flex for coding.
The scenario:
------------------
I've been working / thinking about this for the past 3 days.. it's driving me a little crazy. I've simplified my code down to 3 boxes that are drawn onto the screen. Each containing one background movieClip. The three boxes are three individual box clips in the Flash IDE library (different designs). But all three boxes share the same functionality.
The problem:
------------------
When using a custom baseclass (AbstractBox.as) to define all the functionality for the boxes, Flex looses all the code hinting for the movieClips inside the box movieClip (bg in our example) Also it seems like Interfacing doesn't work since as3 can't define MovieClip instances or any other variables in interfaces.
[code]...
Now my question: Why is this so complicated!? Isn't there a cleaner / simpler way to write this?
I've been trying to setup a working method for unit testing flex libraries using Flex Builder. i have tried setting up a standard flex lib project and using Ant to compile and run the units tests. But this means that when something does go wrong and I want to use the flex builder debugger I cannot do so.
So my next plan is to setup the library as a normal as3/flax/air app as I can use the concept of a main class to run the unit tests. I can then compile the actual library code using Ant.
I could also setup a separate companion project who's sole task is to run units tests on the lib. But this is a little awkward as each library now requires two projects to manage. How do other people develop flex libraries and use unit tests to test/develop/debug the code?
I'm building a video player using Flash CS4 (hereby referred to as "Flash") to create the graphic symbols and compiling and debugging with Flash Builder 4 ("FB4"). Here are the steps I take in my current workflow: --Create the graphic symbols in Flash. I've created a few different symbols for the player, but I'll focus on just the play/pause button ("ppbutton") here. --In the Library panel, I go to the ppbutton symbol's Linkage properties and link to a class named assets.PlayPauseButtonAsset that extends MovieClip. I do not actually have an assets package nor do I have a class file for PlayPauseButtonAsset as Flash will create them for me when I publish.
--In Flash's Publish settings, I set the project to export a SWC that will be used in FB4, called VideoPlayerAssets.swc. --After the SWC is created, I create my FB4 project called "VideoPlayer" and add the SWC to my path. FB4 creates the class VideoPlayer in the default package automatically. --In VideoPlayer.as, I import assets.*, which imports all of the symbol classes I created in Flash and are available via VideoPlayerAssets.swc. I can now instantiate the ppbutton and add to the stage, like this:
Why does Flash still offer to declare library items as either MovieClip, Graphic or Button? Is this just for backwards compatibility or is there any reason not to use MovieClip for everything? (Well, Button does have some additional functionality, but what about Graphic? does a Graphic have any advantage over a MovieClip?)
I have a really big project that has gone through many iterations, and has gotten very large. I am certain there are a lot of library items that are not being used, but I am not sure how to identify them. The FLA file is really large, 500 MB. And I am running into memory problems. Is there a way to remove all unused library items in an FLA? Or at least identify them?
Does anyone know if there is a way to make the new Package Explorer window in Flash Builder emulate Flex Builders 'Flex navigator' window?
Bottom line is I don't always need to peer into SWC's, and I don't like having a 'default package' automatically created for me. Not sure why the interface wasn't made simpler, allowing access to more power and complexity only if necessary. I want to focus on the code, not on how to navigate and use the bells and whistles in the coding environment.
I just upgraded to Flash Builder 4 (beta 2) from Flex Builder 3 which I have been using since it came out. Problem: All the projects that were in my workspace from Flex Builder 3 did not carry over into Flash Builder 4 (e.g. in the "Flex Navigator" view if FB3). Flash Builder 4 now uses the .FXP format to manage projects, but Flex Builder 3 did not. Is there an easy way to get all my projects back into Flash Builder 4?
I'm using Flash Builder 4.6 and in one of my ActionScript projects, I have a referenced .swc library file.The way I added it was Project > Properties > Flex Library Build Path > Library Path tab > Add SWC...Here a popup occurs and I must select a .swc file by browsing through my machine and selecting one. Once I do that, it'll display the added library like this:
I have a symbol named picHolder. In symbol properties under linkage, I chose "Export for ActionScript" and "Export in frame 1" and gave it a class name of picHolder.Normally, to instantiate a new instance, I'd say:
Code: var tempPic:picHolder = new picHolder(); and I'd go about my way.
Because of intricate animations for an iOS project, I'm kinda forced to use Flash CS5.5 IDE, but I'm trying to use Flash Builder 4.5.1 to code library movieClips. For the most part this is working; I'm making movieClips in the library, giving them class names I then edit in FB 4.5. My rationale is for iOS it all has to be one big ass file anyway. I don't really want to make everything a swc and embed in Flash Builder, just want to make movieClips and edit their code in FB.But, say I have made a ball in the Flash IDE. In the Library I give it a class name of 'Ball' that extends MovieClip. When I go back to Flash Builder in my main class I use [code]The code works and the ball is placed from library onto stage, however there is the "?" next to the Ball instantiation suggesting the type cannot be found or is not a compile time constant. I don't really want to make a custom class for Ball - although I'm pretty sure if I did and imported a custom Ball class it would find it and the '?' would go away, but is there not a way to force Flash Builder 'see' the Flash IDE library objects/classes?
I have an AIR project that I was working on Flash Builder 4.5 which now I'm trying to import to my updated Flash Builder 4.5.1 and it is prompting me to fix some paths before the import is completed. I'm kinda clueless what I should put in those fields.
[URL]
The project access a web server to retrieve data using JSON.
I am trying to migrate a project from Flash Builder 4.0 to Flash Builder 4.5. After Flash Builder prompts me to choose my new SDK, I choose 4.5, Then I get the following error:" error "The required skin state 'disabledWithPrompt' is missing".
Say I create a symbol, and then another inside the symbol. In the library I now have 2 symbols. Is there a way to combine these into just one library item?
I have a flash file, which is a header for a website. I inherited it from my company's previous webmaster. I was looking through the library items & see alot of images & graphics that I don't see in the finished product on the webpage. The guy worked really sloppy so it's possible there's alot of unused items. Is there anyway to easily tell which items are not used in the final exported flash file so I can clean it up?
I'm creating a facebook application in flex. I'm actually working on the friends component that shows your friends who are using the application. now, each friend has a profile image.
I created the component using a s:List element.
In the Skin Class of the element i configured the requestedColumnCount to 3, which means it shows 3 friends. i added buttons to scroll left and right in the list.
Whenever I scroll to see a different friend, for a half of a second i see no image because the List component is loading the image in order to view it.
is there a way to make the list preload all the elements so i won't have this kind of problem ?
I downloaded a flash template for my website. All the library items are not local. Here's the path:..........websites20004sources2007dekabr_#lana_2128flashps d1_ikon.png How can I save my library items so I can edit them in FW? I have CS4.
Flash CS4 is really good for design and development point of view. But I noticed two things:If library have more item then there is no option on right click "Select Unused Items". How can I get this option "Select Unused Items" on right Click while library have a more items with scrollbar?Some times the actions window's height increased. At this time there is no option to decrease the height of actions window except the Reset option.
I'm practice with Flash, and trying out different things, but somehow, I managed to create a movie symbol from a graphic symbol, and now whenever I try deleting one of the symbols, it effects the other symbol as well.
I only want one of these symbols, yet I can't seem to only keep one. They both seem to depend on each other, and I don't know how to get around this.
I am developing a site in flash and have over 800 Library Items. My problem is, I need to edit a portion of a Library Item and cannot find the Library Item, and NO, I did not delete the Library Item because when I go to preview or test the flash document, the Library Item is there in the movie. Is there any way to search for the Library Item? I am using Flash Professional 8..
ok so i know the general code to rename all selected library items
var items = fl.getDocumentDOM().library.getSelectedItems(); for (var i=0; i<items.length; i++){ var item = items[i]; item.name = "ABC_"+item.name; }
but this isn't good enough if the library items are in folders... because item.name returns the full path, but item.name sets the name. o.O as someone else points out here, [URL]
so when i try to rename Level1 to be ABC_Level1 if Level1's folder path is LIBRARY/FolderA/FolderB/Level1 i get this instead ABC_FolderA-FolderB-Level1
i could probably code some sort of string parser something like this,
I've got a flash movie that loads images from an external folder. I'd like to make a CD version and would like to have the images embedded in the flash movie so that the images can't be copied from the cd. I thought I could add the images to the Library and reference them from the xml file.
I was wondering if you could loop through your library or a specific folder in your library and get alle linkage names of items that have 'Export for Actionscript' checked. I have an amount of items in my library of which I want to random pick one. Of course I could just use an array of linkage names that correspond to my library items, but I was wondering if there is a more efficient way.
Does flash store the items in the library in an array? I would guess yes. For example if i have an array named pics in my fla file can i write something like:
if there is a way to get a manual text list (or an array or really just anything I could use to get an overview) of items in the library of an FLA...?
I have about 60 movieclips of different flags in my FLA- they all are "linked" to be used in Actionscript- so they have names there but are not named otherwise (as instances on the stage, for example).
Is there a way to get a list of them? I don't want to have to type them all out manually, if there is another way
I'm still in the 'need to learn a lot more' phase of AS3 and am wondering the best way to do this. I have some graphics (MovieClips) in my library that I'd like to have use the same class. But Flash wants unique class names.What's the proper way to handle this? External swf graphics?
lets say you have a whole website written in classes, and you have some items in the library as well (maybe some buttons, a picture for a background and so on...)what to do with all these simbols?leave them in the library, give them all a class name, and when the website loads access them like that, or pull them out on the stage, not neccessarily in the visible area, and not neccessarily on the first keyframe.
so I have a few questions about preloading and specifically preloading in relation to items within the library which get added to the stage through AS3.
The main thing I don't understand is, what is the library? Are these assets contained within the FLA itself and is their data transferred to the SWF on export? If that is the case, does preloading the entire SWF preload its entire library (even the items that are not on the stage?)
If not, how do I preload items which are in the library?