|
-
[RESOLVED] Evoking Box container classes in AS3?
I'm trying to build am AS3 function that will take an xml document (formated like an mxml document) and render it at runtime rather than at compile. It looks like the Box, VBox, and HBox classes are there, but they seem to be restricted from being evoked in ActionScript.
Does that sound right? Is there no way for me to get at these pre-made classes?
-
half as fun, double the price
What are you using? Flex?
I've done something similar. But to be able to generate instances at runtime, they have to be included in the SWF. If not, their defiitions will not be available and instances can't be created.
-
 Originally Posted by senocular
What are you using? Flex?
I'm using the Flex IDE, but I'm working on it as an Actionscript project.
 Originally Posted by senocular
I've done something similar. But to be able to generate instances at runtime, they have to be included in the SWF. If not, their defiitions will not be available and instances can't be created.
So...
If I include a Flex project swf that uses the various classes I'd like to use, but are not included in actionscript, will I be able to use those classes then?
How did you generate the instances at runtime?
Code:
var myBox:HBox = new HBox
?
-
half as fun, double the price
I'm not entirely sure how the Flex components work in an ActionScript project in Flex 2 (if at all). Otherwise, you just include it and place the class somewhere, even if after the include.
Code:
import com.flashkit.Component; Component;
-
The more I look at it, the less likely this appears. I'm not sure why an Actionscript project has access to some classes in the mx package and not others, or how you determine that before you try to implement it, but there definitely seems to be a restriction.
For instance, I can import mx.core.* but not mx.containers.* Even though it looks like mx.containers classes extends flash.display classes, which my project does have access to.
Go figure.
I'm going to leave this as unresolved in case someone comes up with a solution, but at this point I don't think there is one short of creating my own custom classes that do the same thing as the classes I'm trying to import.
Yuck.
-
half as fun, double the price
I'm not entirely fluent in Flex, but I know the mx framework, especially the ui components, are heavily dependant on things like the Application class which is facilitated by the Application tag in MXML. If you want to use those components, you're best bet will probably to use MXML with two tags, the Application tag and the Script tag within it for your ActionScript.
-
That did it. Instead of my top level being an actionscript file, I swapped it out for an MXML file and I could access everything. Thanks.
-
half as fun, double the price
welcome
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|