[osflash] More on components

Glen Pike postmaster at glenpike.co.uk
Thu Apr 10 02:23:41 PDT 2008


Cool...  That's just opened up a whole load of opportunities for me, thanks.

Glen

Yotam Laufer wrote:
> If you want to use the Flash CS3 Components you can create a swf, in 
> Flash, that holds the components you want to use and the use Loader to 
> load them into your application. Once they have loaded you can do the 
> following:
>
> //  UIScrollBar
>
> var uiScrollClass:Class = getDefinitionByName 
> ("fl.containers.UIScrollBar") as Class;
> var uiScrollbar:UIScrollBar = new uiScrollBarClass () as UIScrollBar;
>
> addChild (uiScrollbar);
>
> Make sure you load the swf holding the components in the same 
> ApplicationDomain as your application using the LoaderContext class:
>
> var loader:Loader = new Loader ();
> var context:LoaderContext  = new LoaderContext (true, 
> ApplicationDomain.currentDomain);
>
> loader.load (new URLRequest ("urlToYourSwf.swf"), context);
>
>
>
> Best regards, Yotam,
>
> On Thu, Apr 10, 2008 at 2:47 AM, Glen Pike <postmaster at glenpike.co.uk 
> <mailto:postmaster at glenpike.co.uk>> wrote:
>
>     Hi,
>
>         I don't think you can do a pure AS3 project and use the Flex
>     components - there are a few threads on the FD forum, which will
>     apply to any editor as they are mainly about the code...
>
>         It looks like your project has to contain some MXML - even
>     just a tiny bit to initialise the framework, etc.
>
>        
>     http://www.flashdevelop.org/community/viewtopic.php?t=1556&highlight=pure+as3+flex
>     <http://www.flashdevelop.org/community/viewtopic.php?t=1556&highlight=pure+as3+flex>
>
>        
>     http://www.flashdevelop.org/community/viewtopic.php?t=1264&start=0&postdays=0&postorder=asc&highlight=components
>     <http://www.flashdevelop.org/community/viewtopic.php?t=1264&start=0&postdays=0&postorder=asc&highlight=components>
>
>         Now I just have to figure how to do the same with Flash
>     components as opposed to Flex ones as FD only comes with intrinsic
>     classes for Flex, not Flash, to compile against.
>
>         Glen
>
>     Schell wrote:
>>     I've read through that post as well, seems we're following the same
>>     steps! Hmmm, tried it with a couple different variations, still no
>>     luck. I changed import mx.controls.Button to import fl.controls.Button
>>     and that got rid of multiple null reference run-time errors, but
>>     there's absolutely nothing on the stage. At least there are no errors
>>     at this point.
>>
>>     On Wed, Apr 9, 2008 at 4:00 PM, Glen Pike <postmaster at glenpike.co.uk> <mailto:postmaster at glenpike.co.uk> wrote:
>>       
>>>      You should be able to import the component, create it using new and then
>>>     add it
>>>
>>>
>>>     http://filt3r.free.fr/index.php/2007/08/11/28-using-flex-3-component-without-mxml-only-as3
>>>
>>>      You may need the "intrinsic" or other classes to compile against and this
>>>     is for Flex, so for Flash you may be importing different components.
>>>
>>>      Simple example:
>>>
>>>      package
>>>      {
>>>          import mx.controls.Button;
>>>
>>>
>>>          public class Main extends Application
>>>          {
>>>              private var btn:Button;
>>>
>>>              public function Main():void
>>>              {
>>>
>>>                  addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
>>>              }
>>>
>>>              private function onAddedToStage(event:Event):void {
>>>                  btn = new Button();
>>>
>>>                  addChild(btn);
>>>              }
>>>          }
>>>      }
>>>
>>>
>>>     Schell wrote:
>>>      Thank you Glen. I have seen this post before and I've added my swc's
>>>     to the library path. I'm a little lost on the next step. How can I
>>>     take advantage of the Button class now? I've had no luck.
>>>
>>>     On Wed, Apr 9, 2008 at 3:20 PM, Glen Pike <postmaster at glenpike.co.uk> <mailto:postmaster at glenpike.co.uk> wrote:
>>>
>>>
>>>
>>>     http://noahlittle.wordpress.com/2007/09/09/flex-and-actionscript-3-with-textmate-and-fcsh/
>>>
>>>
>>>
>>>
>>>     Glen Pike
>>>      01736 759321
>>>      www.glenpike.co.uk <http://www.glenpike.co.uk>
>>>     _______________________________________________
>>>      osflash mailing list
>>>      osflash at osflash.org <mailto:osflash at osflash.org>
>>>      http://osflash.org/mailman/listinfo/osflash_osflash.org
>>>
>>>
>>>
>>>      _______________________________________________
>>>     osflash mailing list
>>>     osflash at osflash.org <mailto:osflash at osflash.org>
>>>     http://osflash.org/mailman/listinfo/osflash_osflash.org
>>>
>>>
>>>
>>>
>>>
>>>     --
>>>
>>>
>>>     Glen Pike
>>>      01736 759321
>>>      www.glenpike.co.uk <http://www.glenpike.co.uk>
>>>     _______________________________________________
>>>      osflash mailing list
>>>      osflash at osflash.org <mailto:osflash at osflash.org>
>>>      http://osflash.org/mailman/listinfo/osflash_osflash.org
>>>
>>>
>>>         
>>       
>
>     -- 
>
>     Glen Pike
>     01736 759321
>     www.glenpike.co.uk <http://www.glenpike.co.uk>
>
>
>     _______________________________________________
>     osflash mailing list
>     osflash at osflash.org <mailto:osflash at osflash.org>
>     http://osflash.org/mailman/listinfo/osflash_osflash.org
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>   

-- 

Glen Pike
01736 759321
www.glenpike.co.uk <http://www.glenpike.co.uk>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20080410/c71d43a6/attachment.html 


More information about the osflash mailing list