Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-22-2008, 09:04 PM   #1
jfoley
Registered User
 
Join Date: Jan 2008
Posts: 39
Default How do I use a custom class within a Flex MXML app?

Ok, here I go...
How do I use a custom class within a Flex MXML app? I created a Papervision 3D project that is wrapped in an as3 class...

Now how do I instantiate it in MXML?
jfoley is offline   Reply With Quote
Old 07-22-2008, 11:53 PM   #2
Sleeve
Corrupted Whitespace
 
Join Date: May 2006
Location: Seattle, WA
Posts: 489
Default

With your flex project open choose Project>>Properties and select 'Felx build Path' add a new folder and browse for your papervision package. Now you should be able to instantiate your custom classes from within your project.

Good Luck!
__________________
Some people smoke, some drink...I code Actionscript
Sleeve is offline   Reply With Quote
Old 07-23-2008, 02:20 AM   #3
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,140
Default

keep in mind your display objects have to inheritant from UIComponent Sprite something or other (or IUIComponent) or you can't added it to an mx container.
__________________
trace("Good bye Flash.") Log.i(TAG, "Hello Droid");
Flash Gordon is offline   Reply With Quote
Old 07-23-2008, 02:56 AM   #4
Sleeve
Corrupted Whitespace
 
Join Date: May 2006
Location: Seattle, WA
Posts: 489
Default

Exactly, adding objects to anything that extends Container or otherwise uses ConstraintColumns and ConstraintRows needs to be or extend UIComponent because the LayoutManager needs access to setActualSize, updateDisplayList, InvalidateDisplayList etc. on the child object. Else, add it to a UIComponent and add the UIComponent to the container. Else, do it right and refactor your code to extend UIComponent then override createChildren(), childrenCreated(), measure(), commitProperties(), updateDisplayList() and a few others to layout your component.
__________________
Some people smoke, some drink...I code Actionscript
Sleeve is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Applying a custom class to an object in the document class... DTAlexONE ActionScript 3.0 2 07-15-2008 06:53 AM
Scaling an Externally Loaded Flex app njward Flex 2, 3 & 4 1 05-15-2008 03:30 AM
Using .onRelease within a custom class Ralph Brooker ActionScript 2.0 6 08-23-2005 09:55 PM
Database simulated with arrays on a cd-rom lecasn5 Components 61 09-07-2004 11:40 AM
card game: designing Deck class and good OOP? pigpen Gaming and Game Development 1 11-26-2002 11:41 AM


All times are GMT. The time now is 09:01 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.