flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JP Bader ...@zavteq.com>
Subject Re: mixing flex components and Sprites
Date Wed, 17 Jul 2013 17:08:22 GMT
UIComponents by default have no size, without updating it's size, it'll
never display what you want to show.

My way produces the same, but makes it in AS3 (which can be easier to read
sometimes)

Also, are you embedding your assets, or loading them at runtime?

sample code:

var uic:UIComponent = new UIComponent();
addElement(uic);
var sprite:Sprite/MovieClip/Class = new Sprite/MovieClip/Class();
uic.addChild(sprite);


On Wed, Jul 17, 2013 at 11:57 AM, Dennis Raddle <dennis.raddle@gmail.com>wrote:

> Okay I'm trying to figure out how to write code that would let me add
> Sprite-based objects to a Flex framework. Looking at the bigger picture, I
> don't know if this is right way to go. My larger goal is to mix buttons and
> layouts and things that Flex provides, with animation of graphics. But
> anyway, here is my first attempt to code something. I'm stuck in the
> function addStuff(). Let's say that I create a class called AddSprites that
> does the work of adding Sprites and animating them. I'm going to need to
> pass the UIComponent into its constructor. How do I do that?
>
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>            xmlns:s="library://ns.adobe.com/flex/spark"
>                xmlns:mx="library://ns.adobe.com/flex/mx">
>
>   <fx:Script>
>     <![CDATA[
>       import exper AddSprites;
>       private var e:AddSprites;
>       public function addStuff():void {
>         .... ???? problem is next line ...
>         e = new AddSprites(..UIComponent?..);
>       }
>     ]]>
>
>   </fx:Script>
>
>   <s:layout>
>     <s:VerticalLayout/>
>   </s:layout>
>
>   <s:Button click="addStuff()" />
>
>   <mx:UIComponent id="uic"/>
> </s:Application>
>
>
>
> On Wed, Jul 17, 2013 at 9:22 AM, Alex Harui <aharui@adobe.com> wrote:
>
> > Well, SkinnableComponent will probably require a Skin.  It is possible to
> > use subclasses of UIComponent or SpriteVisualElement to do low-level
> Flash
> > stuff.
> >
> > It is also possible to create a single UIComponent that will reserve a
> > bunch of screen space for you to add any combination of Sprites and
> Shapes
> > that don't subclass Flex stuff.
> >
> >
>



-- 
JP Bader
Principal
Zavteq, Inc.
@lordB8r | jp@zavteq.com
608.692.2468

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message