flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Raddle <dennis.rad...@gmail.com>
Subject mixing flex components and Sprites
Date Wed, 17 Jul 2013 14:00:16 GMT
I have a vision for my educational software, in which part of the stage
will have buttons (maybe radio buttons and checkboxes) and part of the
screen will have animated Sprites or some kind of visual objects. How do I
write an mxml file that includes custom visual elements? Can they be
extensions of Sprite? In a little example program I wrote, I got an error
that said something about my object declaration was not assignable to
mx.core.IVisualElement.

Here's what I wrote. The second to last line contains the declaration for a
Sprite-based class. The error I got was

- 'AnotherSprite' declaration must be contained within the Declarations
tag, since it is not assignable to the default property's element type
'mx.core.IVisualElement'

<?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:exper="exper.*">
  <s:layout>
    <s:VerticalLayout/>
  </s:layout>

  <s:TextInput id="myTI" text="Enter text here"/>
  <s:Label id="myText" text="{myTI.text.toUpperCase()}"/>
  <exper:AnotherSprite/>
</s:Application>

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