[osflash] More on components

Glen Pike postmaster at glenpike.co.uk
Wed Apr 9 16:47:30 PDT 2008


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> 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> wrote:
>>
>>
>>
>> http://noahlittle.wordpress.com/2007/09/09/flex-and-actionscript-3-with-textmate-and-fcsh/
>>
>>
>>
>>
>> Glen Pike
>>  01736 759321
>>  www.glenpike.co.uk
>> _______________________________________________
>>  osflash mailing list
>>  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
>> _______________________________________________
>>  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/9b384313/attachment-0001.html 


More information about the osflash mailing list