English 中文(简体)
• 如何使用复读机在炉 to内打 comp
原标题:How to use repeater for componets inside swc

I build a swc file by Flash CS5 contains some interface component like TextInput, Label. And then I use it in a flex program.

但是,当我希望对这一构成部分使用弹性重复处理时,我就应对了这一问题。

以下是我自己在使用闪电机的血清中确定的内容。

package {
    import fl.controls.TextInput;
    ......

    public dynamic class MyWindow extends UIMovieClip {
        public var txt1 : TextInput;
        ......
        }
    }
}

接着,我以我这样的灵活方案来使用:

<local:MyWindow id="myWindow"/>
<fx:Script>
    <![CDATA[
        ......
        private function Init() : void {
            myWindow.txt1.text = "myText";
        }
        ......
    ]]>
 </fx:Script>

它运作良好。

但是,我如何能够直接在哺乳动物中使用tx1。 类似:

<local:MyWindow id="myWindow" txt1.text="myText"/>

我知道这项工作不多,但我想重复一下,以创造一些类似的MyWindow,它需要约束数据提供者。 我这样写道:

<mx:VBox>
    <mx:Repeater x="10" y="10" id="multiWindow">
        <local:MyWindow txt1.text="{multiWindow.currentItem}"/>
    </mx:Repeater>
</mx:VBox>

但它可能无法奏效。

是否有任何人知道如何工作? 感谢。

================================================================================================================================================================================================================================================================

更新法典,多寡妇完整法典:

package {
import fl.controls.TextInput;

import mx.flash.UIMovieClip;

import flash.display.DisplayObject;
import flash.events.EventDispatcher;
import flash.display.Sprite;
import flash.display.InteractiveObject;
import flash.display.MovieClip;
import flash.display.DisplayObjectContainer;

public dynamic class MyWindow extends UIMovieClip {
    public var txt1 : TextInput;
    public var txt2 : TextInput;
    public var txt3 : TextInput;
}
}
问题回答

贵方希望使用元数据交换集装箱的任何组成部分都需要执行国际数据交换委员会的责任。 我认为,闪电是建立在你可以扩展至灵活使用的基本类别上,但你也可以这样做:

<mx:VBox>
     <mx:Repeater x="10" y="10" id="multiWindow">
         <mx:UIComponent>
             <local:MyWindow txt1.text="{multiWindow.currentItem}"/>
         </mx:UIComponent>
     </mx:Repeater> 
</mx:VBox>

请注意,如果你不考虑灵活组成部分的生活周期和布局制度,它可能不会很好地发挥作用。





相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签