Flex 2 TabNavigator & AccordianNavigator

I am just starting to learn Flex 2 and have a questions for
developrs with Flex experience.
One of my current ColdFusion MX7 applications uses a set of
custom tags to provide me with Tabbed Data Entry forms with several
Accordians on each tabbed page. In Flex 2, is it possible to
combine the TabbedNavigator and AccordianNavigatotr for a series of
data entry screens? I would like to upgrade this application
utilizing the features of Flex 2 if possible.
Any comments would be appreciated. Thanks...
Glenn

In Flex, containers can be nested arbitrarily. So you can put
an Accordion inside a Tab inside a Canvas inside another Tab,
etc.

Similar Messages

  • Load speed: FLEX MX:TABNAVIGATOR LOAD SPEED VERSUS SPARK:TABBAR

    TODAY I NOTICED A LARGE DIFFERENCE BETWEEN
    THE OLDER MX:TABNAVIGATOR
    AND NEWER S:TABBAR (SPARK)
    Summary:
    My test application was built in flex builder 4 and I was using my localhost (asp.net devlepment enviroment) for testing.
    Tests I built:
    I built many proofs for concept using flex objects, ui  and data handlers.
    HOW WAS THIS TEST (which I spoke about in the title) CREATED:
    I built two components which will be used as CHILDREN to the main application.  The fist child component used the SPARK TABBAR and the other child component used the MX:TABNAVIGATOR.  The main application declared these children (using action script) initially and a List control actually loaded the children into the main application.
    BOTH CHILD COMPPONENTS had 10 tabs....
    5 of the 10 tabs contained "grand" child components (none of the components(main application/children/grandchildren) worked with external data)
    RESULTS:
    THE LOAD SPEED BETWEEN THE TWO CONTROLS was very noticable between the two controls.
    THE SPARK COMPONENT (S:tabbar) AVERAGED 3-5 SECONDS TO LOAD
    WHERE THE MX:TABNAVIGATOR ONLY TOOK 1-2 SECONDS
    HAS ANYBODY ELSE EXPERIENCED THE SAME RESULTS?
    THANKS,
    DOUG LUBY OF LOUISIANA
    WWW.douglubey.com
    SEARCH:  FLEX MX:TABNAVIGATOR LOAD SPEED VERSUS SPARK:TABBAR

    It definately seems to fit (pretty good).
    My labels in the "TABS" were of different length.
    So I converted them all to be the same length.
    <s:TabBar dataProvider="{viewstackSampleB}" id="sampleBMainTabBar"left="
    11" top="8" right="11" height="34" fontSize="6"/>
    <mx:ViewStack id="viewstackSampleB" cornerRadius="20" top="40" bottom="10" left="10" right="10">
    <s:NavigatorContent label="Profile___________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="0" right="0" bottom="0" backgroundColor="#000080">
    <sample:SampleB_Profile id="studentProfile" left="2" top="2" right="2" bottom="2"/>
    </s:NavigatorContent>
    </s:NavigatorContent>
    <s:NavigatorContent label="SampleB_DragNDrop1________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="0" right="0" bottom="0" backgroundColor="#000080">
    <sample:SampleB_DragNDrop1 id="studentDragNDrop1" left="2" top="2" right="2" bottom="2"/>
    </s:NavigatorContent>  
    </s:NavigatorContent>
    <s:NavigatorContent label="SampleB_DragNDrop2________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    <sample:SampleB_DragNDrop2 id="studentDragNDrop2" left="2" top="2" right="2" bottom="2"/>
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    <s:NavigatorContent label="SampleB_PullDataFromParent" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    <sample:SampleB_PullingDataParent id="studentPullingDataParent" left="2" top="2" right="2" bottom="2"/>
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    <s:NavigatorContent label="Tab Five__________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    <s:NavigatorContent label="Tab Six___________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    <s:NavigatorContent label="Tab Seven_________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab Eight_________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab Nine__________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab Ten___________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    </mx:ViewStack>
    THIS APPEARS TO HAVE THE SAME LOAD TIME as the TabNavigator.
    So I have to ask:
    What is a permanent fix for this.
    Where I can I update my current "Build" for FLEX 4
    so my application does not retain this bug.
    OR ANOTHER QUESTION...what can I exclude in my declarations to fix this bug.
    I would prefer to use the Spark TabBar over the mx:tabnavigator
    MY CURRENT "BUILD" is 4.0.1.277662

  • Flex 3 TabNavigator getting tab name when tab clicked

    Hi All, I am using Flex 3.
    I have <mx:TabNavigator  id="dbtabs" width="100%" height="100%" click="changeTabs()"  />
    I am also adding tabs dynamically. 
    In the grand scheme of things, I want to let a user add tabs as needed and chose what content is on the tab.  This is saved data, so when they come back I need to reload their saved settings.
    What I am trying to do is find out how to get the index of the tab when it is clicked. Right now I have to click the tab then click in the vbox to get the selectedIndex.  Is there a way to get the selectedIndex as soon as the tab is clicked?
    Thanks.

    private function handleTabClick(evt:IndexChangedEvent):void
           var i:int = evt.newIndex;
    <mx:TabNavigator change="handleTabClick(event)">
            <mx:Canvas width="200" height="200" label="Tab 1"/>
            <mx:Canvas width="200" height="200" label="Tab 2"/>
    </mx:TabNavigator>
    Dany

  • Tabnavigator in flex

    Hello,
    Has anyone experience this type of issue when your tabs
    display a green highlighted color and the font style and size are
    all changed to a larger size then you set.

    Hello,
    We found a solutions to the Tabnavigator error, it appear
    that the namespace in the xml document which is created
    automatically in AIR apps, throws an connection error. The fix
    consisted of changing the following:
    Fromn this:
    <application xmlns="
    http://ns.adobe.com/air/application/1.1">
    Change it to:
    <application xmlns="
    http://ns.adobe.com/air/application/1.5">
    We found that to work best.
    Thanks, DM

  • How can I initialize all TabNavigator Tabs upon a state change?

    Here's the basic goal. I want to provide two views to the
    user that display the same panels. I configured each view as a
    separate state but I am having trouble initializing each of the tab
    views since they are only created by Flex when the user first
    selects it. I need them all created when the user changes to that
    state so that I can insert my view objects. Does that make sense?
    Ok, how about an example program. I define three view objects
    in ActionScript which will be used in two different states. I use
    AddChild to put them in the proper layout location. The problem is
    with the Tab state. The AddChild operation only works for the first
    tab because it is visible. The other two tabs don't get setup
    properly. Can anyone help me resolve this?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="onCreationComplete()">
    <mx:Script>
    <![CDATA[
    import mx.containers.VBox;
    import mx.controls.Label;
    [Bindable] public var view1:VBox;
    [Bindable] public var view2:VBox;
    [Bindable] public var view3:VBox;
    private function onCreationComplete():void
    var label1:Label = new Label();
    var label2:Label = new Label();
    var label3:Label = new Label();
    label1.text = "This is view 1.";
    label2.text = "This is view 2.";
    label3.text = "This is view 3.";
    view1 = new VBox();
    view1.label = "View 1";
    view1.addChild(label1);
    view2 = new VBox();
    view2.label = "View 2";
    view2.addChild(label2);
    view3 = new VBox();
    view3.label = "View 3";
    view3.addChild(label3);
    currentState = "wizardState";
    private function changeState():void
    switch(stateBox.selectedItem.data)
    case 0: currentState = 'wizardState'; break;
    case 1: currentState = 'tabState'; break;
    ]]>
    </mx:Script>
    <mx:Panel id="mainPanel" title="Tab View Bug" width="400"
    height="320"/>
    <mx:ComboBox id="stateBox" change="changeState()">
    <mx:dataProvider>
    <mx:Object label="Wizard" data="0"/>
    <mx:Object label="Tabbed" data="1"/>
    </mx:dataProvider>
    </mx:ComboBox>
    <mx:states>
    <mx:State name="wizardState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:HBox width="100%" height="100%"
    verticalAlign="top">
    <mx:ToggleButtonBar id="wizardButtonBar" width="20%"
    direction="vertical"
    dataProvider="{wizardViewStack}"/>
    <mx:ViewStack id="wizardViewStack" width="80%"
    selectedIndex="{wizardButtonBar.selectedIndex}"/>
    </mx:HBox>
    </mx:AddChild>
    <mx:AddChild target="{view1}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    <mx:AddChild target="{view2}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    <mx:AddChild target="{view3}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    </mx:State>
    <mx:State name="tabState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:TabNavigator id="tabViewStack" width="100%"
    height="100%">
    <mx:VBox label="Tab 1" id="tab1"/>
    <mx:VBox label="Tab 2" id="tab2"/>
    <mx:VBox label="Tab 3" id="tab3"/>
    </mx:TabNavigator>
    </mx:AddChild>
    <mx:AddChild target="{view1}" relativeTo="{tab1}"
    position="lastChild"/>
    <mx:AddChild target="{view2}" relativeTo="{tab2}"
    position="lastChild"/>
    <mx:AddChild target="{view3}" relativeTo="{tab3}"
    position="lastChild"/>
    </mx:State>
    </mx:states>
    </mx:Application>

    Ok, here is an even simpler scenario. I take each view from
    the default state and put them in the new tab view when the state
    changes. If you compile and run this example, the only view that
    makes it into the tabview is the one that was active when the state
    changed. Why is that?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    private function changeState():void
    switch(stateBox.selectedItem.data)
    case 0: currentState = ''; break;
    case 1: currentState = 'tabState'; break;
    ]]>
    </mx:Script>
    <mx:Panel id="mainPanel" title="Tab View Bug" width="400"
    height="320">
    <mx:HBox id="wizardView" width="100%" height="100%"
    verticalAlign="top">
    <mx:ToggleButtonBar id="wizardButtonBar" width="20%"
    direction="vertical"
    dataProvider="{wizardViewStack}"/>
    <mx:ViewStack id="wizardViewStack" width="80%"
    selectedIndex="{wizardButtonBar.selectedIndex}"
    creationPolicy="all">
    <mx:Canvas id="view1" label="Part 1" >
    <mx:TextInput text="This is view 1"/>
    </mx:Canvas>
    <mx:Canvas id="view2" label="Part 2">
    <mx:TextInput text="This is view 2"/>
    </mx:Canvas>
    <mx:Canvas id="view3" label="Part 3">
    <mx:TextInput text="This is view 3"/>
    </mx:Canvas>
    </mx:ViewStack>
    </mx:HBox>
    </mx:Panel>
    <mx:ComboBox id="stateBox" change="changeState()">
    <mx:dataProvider>
    <mx:Object label="Wizard" data="0"/>
    <mx:Object label="Tabbed" data="1"/>
    </mx:dataProvider>
    </mx:ComboBox>
    <mx:states>
    <mx:State name="tabState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:TabNavigator id="tabView" width="100%" height="100%"
    creationPolicy="all">
    <mx:Canvas label="Tab 1" id="tab1"/>
    <mx:Canvas label="Tab 2" id="tab2"/>
    <mx:Canvas label="Tab 3" id="tab3"/>
    </mx:TabNavigator>
    </mx:AddChild>
    <mx:RemoveChild target="{view1}"/>
    <mx:AddChild target="{view1}" relativeTo="{tab1}"/>
    <mx:RemoveChild target="{view2}"/>
    <mx:AddChild target="{view2}" relativeTo="{tab2}"/>
    <mx:RemoveChild target="{view3}"/>
    <mx:AddChild target="{view3}" relativeTo="{tab3}"/>
    <mx:RemoveChild target="{wizardView}"/>
    </mx:State>
    </mx:states>
    </mx:Application>

  • Flex FAQ 9-22-08

    Q: I want to use an XML data source to dynamically display
    images and
    data in my Flex application. I won't know how many
    images/data points I
    will have at design time. How can I best approach this?
    A: Depending on what you're wanting to do, you can either use
    a
    Repeater with an Image or custom component that contains an
    Image or you can
    use a List based component to display an Image or custom
    component with an
    Image (or SwfLoader, or Loader) in it. The Help is full of
    resources on
    this subject. Here are some places you may want to try:
    Help>Flex Start Page>Creating a Simple RIA
    Help>Help Contents>User Interfaces
    - Using Data Providers and Collections
    - Controls
    - Image
    - SwfLoader
    - Using Data Driven Controls
    - Using Item Renderers and Item Editors
    - Dynamically Repeating Controls and Containers
    Here is an example that might get you running fast if you
    find it easier to
    learn from a working example than from Help files:
    http://examples.adobe.com/flex2/inproduct/sdk/photoviewer/PhotoViewer.html
    Q: I've created a custom itemRenderer component to use in a
    List
    based component (Datagrid, TileList, HorizontalList, etc.).
    When my List
    first displays, everything looks fine, but when I scroll it
    or change the
    dataProvider, some of the itemRenderers show values or
    formatting that
    aren't right. How do I fix this?
    A: List-based components don't draw a renderer for every item
    in the
    dataProvider. Instead, they create enough to display what is
    on screen now,
    plus one or two more waiting in the wings. This means they
    recycle the
    renderers rather than creating new ones when you change
    dataProvider or
    scroll up and down. When you use a creationComplete event to
    set up the
    itemRenderer, that event doesn't happen again when the
    renderer is used for
    a different set of data. The solution to this is to override
    the set data
    protected function that most components have.
    For more information, check out the following resources:
    http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html?devcon=f1
    http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html
    Q: I want to run a function in my main application from
    inside my
    custom component. But when I try to refer to myFunction() in
    that
    component, I get a compile time error Call to a possibly
    undefined function
    myFunction. How can I fix this?
    A: Your component has its own scope, so it doesn't know
    anything
    about the functions in the main file. You can get around this
    by directly
    referencing the main application scope like this:
    Application.application.myFunction(). However, this makes
    your component
    tightly coupled, which is a quick way of saying that your
    component is only
    usable in an application that has a myFunction() function in
    it. You're
    better off dispatching an event from your component and
    letting the
    application decide how to handle it. For more information,
    check out the
    following resources:
    http://www.adobe.com/devnet/flex/articles/loose_coupling.html
    http://www.adobe.com/devnet/flex/articles/graduating_pt1.html
    Q: I want to decide at runtime what kind of component to add
    to
    display my data. How can I accomplish this?
    A: Use getDefinitionByName and ClassFactory to dynamically
    create
    your class. Just be sure that you actually have at least one
    "hard"
    reference to each class you intend to use, or the class might
    not get
    compiled into your swf. Here's a full write-up of how to do
    that:
    http://www.paulofierro.com/archives/520/
    Q: I need to set a property or add an event listener on a
    component
    that is in a ViewStack/TabNavigator/Accordion. When the
    component is not
    the first child of the Navigator Container, I get a null
    object error
    (#1009). What causes this, and how can I fix it?
    A: By default, the Navigator containers only create the
    children of
    each pane as that pane is viewed. The easy way to fix this is
    to set the
    creationPolicy on the Navigator to "all." However, this will
    cause your
    application to take longer to load. A better way to fix this
    is to wait for
    a later event, such as creationComplete on the component you
    want to access,
    or to use binding to "pull" the data into the component.
    The way I handle it is to call invalidateProperties() on
    change of the
    ViewStack. I then override commitProperties() and call an
    "initializer" for
    each pane. In the body of each initializer function, I check
    to see if the
    selectedItem for the viewStack is the one my initalizer cares
    about. If
    not, I return from the function immediately. Inside that
    initializer
    function, I set properties and add listeners as appropriate.
    Q: When my application is taller than the browser window, I
    get
    scrollbars in the application. I want the browser to do the
    scrolling. How
    can I do this?
    A: In the html-template/index.template.html file change line
    46 (in
    the Flex 3 template) to read <body scroll="auto">
    instead of the default of
    <body scroll="no">.
    Q: I am using URLRequest, HTTPRequest, or HTTPService to
    retrieve
    information from a database on a server. The first time my
    application
    makes a server call, it works fine. But when I call the same
    page again, I
    get the same data, even though I know the data has changed on
    the server.
    Is this a bug?
    A: The browser has cached the response it got from the first
    call
    you made to the page. This means that you need to either
    change how you are
    calling the page so it appears to be a new request, or you
    need to change
    the page itself so that it won't be cached.
    To change how you are calling the page, append a unique value
    to the end of
    the URL. For example, new
    URLRequest('yourPage.asp?param="+(new
    Date()).getTime).
    If you want to change the page itself, you need to change the
    response
    headers. The method for changing the response headers will
    vary from
    language to language. For more on this see:
    http://msdn.microsoft.com/en-us/library/aa923184.aspx
    http://www.sun.com/books/components/Hall_ch7.pdf
    http://www.w3schools.com/php/func_http_header.asp
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_g-h_07.html#3989067
    Q: I am using Modules in my Application. When I load the
    first
    Module, everything works fine. But when I load the second
    one, I get a Type
    Coercion Error failed error #1034 that looks something like
    TypeError: Error
    #1034: Type Coercion failed: cannot convert
    com.myDomain.package::SingletonClass@fce9a89 to
    com.myDomain.package::SingletonClass or TypeError: Error
    #1034: Type
    Coercion failed: cannot convert
    mx.managers::HistoryManagerImpl@22346589 to
    mx.managers.IHistoryManager. How do I fix this?
    A: When you reference a singleton class, either a custom
    singleton
    or one of the managers in Flex, into a Module, if this is not
    loaded in the
    Application domain, it will load into the child domain of the
    first Module
    to load and other Modules will not be able to see it. To
    prevent this,
    either directly load your class into the main Application
    before loading any
    Module, or use a Runtime Shared Library with the class
    included.
    For more on this, see Alex Harui's presentation on Modules
    from Flex 360
    http://blogs.adobe.com/aharui/2007/03/modules.html
    (slides 19, 24-31).
    Not sure what a Singleton is? Check out
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=262&produc tId=2
    Q: I'm using a Repeater to lay out the right number of
    components on
    the screen for me based on a data source. I'm trying to set
    up the id for
    each component dynamically like this:
    <mx:Repeater id="myRepeater" dataProvider="mySource">
    <mx:Button id="{'myButton'+myRepeater.currentIndex}"
    label="{myRepeater.currentItem.label}" />
    </mx:Repeater>
    When I try to run the file, I get a compiler error
    '{'myButton'+myRepeater.currentIndex}' is not a valid
    identifier.
    I need to be able to reference each of the repeated
    components. How can I
    do this?
    A: If you give the component an ordinary id like this:
    <mx:Button id="myButton"
    label="{myRepeater.currentItem.label}" />
    Flex will create an Array for you called myButton that
    contains a reference
    to each component the repeater created. For more information,
    see
    Referencing Repeated Components here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=repeater_3.html
    Courtesy of Amy's Flex Diary.
    The most recent version of this FAQ can always be found at
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

    "Greg Lafrance" <[email protected]> wrote in
    message
    news:gbr2r8$qtv$[email protected]..
    > Is it possible to number the questions? Sometimes in
    your posts you refer
    > to Q3, but they are not numbered.
    Good point :-). I get tired of counting them sometimes. I'll
    try to get
    that done before next week.

  • Flex FAQ

    Q: I want to use an XML data source to dynamically display
    images and
    data in my Flex application. I won't know how many
    images/data points I
    will have at design time. How can I best approach this?
    A: Depending on what you're wanting to do, you can either use
    a
    Repeater with an Image or custom component that contains an
    Image or you can
    use a List based component to display an Image or custom
    component with an
    Image (or SwfLoader, or Loader) in it. The Help is full of
    resources on
    this subject. Here are some places you may want to try:
    Help>Flex Start Page>Creating a Simple RIA
    Help>Help Contents>User Interfaces
    - Using Data Providers and Collections
    - Controls
    - Image
    - SwfLoader
    - Using Data Driven Controls
    - Using Item Renderers and Item Editors
    - Dynamically Repeating Controls and Containers
    Here is an example that might get you running fast if you
    find it easier to
    learn from a working example than from Help files:
    http://examples.adobe.com/flex2/inproduct/sdk/photoviewer/PhotoViewer.html
    Q: I've created a custom itemRenderer component to use in a
    List
    based component (Datagrid, TileList, HorizontalList, etc.).
    When my List
    first displays, everything looks fine, but when I scroll it
    or change the
    dataProvider, some of the itemRenderers show values or
    formatting that
    aren't right. How do I fix this?
    A: List-based components don't draw a renderer for every item
    in the
    dataProvider. Instead, they create enough to display what is
    on screen now,
    plus one or two more waiting in the wings. This means they
    recycle the
    renderers rather than creating new ones when you change
    dataProvider or
    scroll up and down. When you use a creationComplete event to
    set up the
    itemRenderer, that event doesn't happen again when the
    renderer is used for
    a different set of data. The solution to this is to override
    the set data
    protected function that most components have.
    For more information, check out the following resources:
    http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html?devcon=f1
    http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html
    Q: I want to run a function in my main application from
    inside my
    custom component. But when I try to refer to myFunction() in
    that
    component, I get a compile time error "Call to a possibly
    undefined function
    myFunction." How can I fix this?
    A: Your component has its own scope, so it doesn't know
    anything
    about the functions in the main file. You can get around this
    by directly
    referencing the main application scope like this:
    Application.application.myFunction(). However, this makes
    your component
    tightly coupled, which is a quick way of saying that your
    component is only
    usable in an application that has a myFunction() function in
    it. You're
    better off dispatching an event from your component and
    letting the
    application decide how to handle it. For more information,
    check out the
    following resources:
    http://www.adobe.com/devnet/flex/articles/loose_coupling.html
    http://www.adobe.com/devnet/flex/articles/graduating_pt1.html
    Q: I want to decide at runtime what kind of component to add
    to
    display my data. How can I accomplish this?
    A: Use getDefinitionByName and ClassFactory to dynamically
    create
    your class. Just be sure that you actually have at least one
    "hard"
    reference to each class you intend to use, or the class might
    not get
    compiled into your swf. Here's a full write-up of how to do
    that:
    http://www.paulofierro.com/archives/520/
    Q: I need to set a property or add an event listener on a
    component
    that is in a ViewStack/TabNavigator/Accordion. When the
    component is not
    the first child of the Navigator Container, I get a null
    object error
    (#1009). What causes this, and how can I fix it?
    A: By default, the Navigator containers only create the
    children of
    each pane as that pane is viewed. The easy way to fix this is
    to set the
    creationPolicy on the Navigator to "all." However, this will
    cause your
    application to take longer to load. A better way to fix this
    is to wait for
    a later event, such as creationComplete on the component you
    want to access,
    or to use binding to "pull" the data into the component.
    The way I handle it is to call invalidateProperties() on
    change of the
    ViewStack. I then override commitProperties() and call an
    "initializer" for
    each pane. In the body of each initializer function, I check
    to see if the
    selectedItem for the viewStack is the one my initalizer cares
    about. If
    not, I return from the function immediately. Inside that
    initializer
    function, I set properties and add listeners as appropriate.
    Q: When my application is taller than the browser window, I
    get
    scrollbars in the application. I want the browser to do the
    scrolling. How
    can I do this?
    A: In the html-template/index.template.html file change line
    46 (in
    the Flex 3 template) to read <body scroll="auto">
    instead of the default of
    <body scroll="no">.
    Q: I am using URLRequest, HTTPRequest, or HTTPService to
    retrieve
    information from a database on a server. The first time my
    application
    makes a server call, it works fine. But when I call the same
    page again, I
    get the same data, even though I know the data has changed on
    the server.
    Is this a bug?
    A: The browser has cached the response it got from the first
    call
    you made to the page. This means that you need to either
    change how you are
    calling the page so it appears to be a new request, or you
    need to change
    the page itself so that it won't be cached.
    To change how you are calling the page, append a unique value
    to the end of
    the URL. For example, new
    URLRequest('yourPage.asp?param="+(new
    Date()).getTime).
    If you want to change the page itself, you need to change the
    response
    headers. The method for changing the response headers will
    vary from
    language to language. For more on this see:
    http://msdn.microsoft.com/en-us/library/aa923184.aspx
    http://www.sun.com/books/components/Hall_ch7.pdf
    http://www.w3schools.com/php/func_http_header.asp
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_g-h_07.html#3989067
    Courtesy of Amy's Flex Diary (
    http://flexdiary.blogspot.com)
    You can always find the most recent version of this document
    here:
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

    "danger42" <[email protected]> wrote in
    message
    news:gamils$eb2$[email protected]..
    > Cool, thanks for posting this, Amy!
    You're welcome :-)

  • Flex FAQ 9-29-08

    Amy's Flex Frequently Asked Questions
    Q: I want to use an XML data source to dynamically display
    images and
    data in my Flex application. I won't know how many
    images/data points I
    will have at design time. How can I best approach this?
    A: Depending on what you're wanting to do, you can either use
    a
    Repeater with an Image or custom component that contains an
    Image or you can
    use a List based component to display an Image or custom
    component with an
    Image (or SwfLoader, or Loader) in it. The Help is full of
    resources on
    this subject. Here are some places you may want to try:
    Help>Flex Start Page>Creating a Simple RIA
    Help>Help Contents>User Interfaces
    - Using Data Providers and Collections
    - Controls
    - Image
    - SwfLoader
    - Using Data Driven Controls
    - Using Item Renderers and Item Editors
    - Dynamically Repeating Controls and Containers
    Here is an example that might get you running fast if you
    find it easier to
    learn from a working example than from Help files:
    http://examples.adobe.com/flex2/inproduct/sdk/photoviewer/PhotoViewer.html
    Q: I've created a custom itemRenderer component to use in a
    List
    based component (Datagrid, TileList, HorizontalList, etc.).
    When my List
    first displays, everything looks fine, but when I scroll it
    or change the
    dataProvider, some of the itemRenderers show values or
    formatting that
    aren't right. How do I fix this?
    A: List-based components don't draw a renderer for every item
    in the
    dataProvider. Instead, they create enough to display what is
    on screen now,
    plus one or two more waiting in the wings. This means they
    recycle the
    renderers rather than creating new ones when you change
    dataProvider or
    scroll up and down. When you use a creationComplete event to
    set up the
    itemRenderer, that event doesn't happen again when the
    renderer is used for
    a different set of data. The solution to this is to override
    the set data
    protected function that most components have.
    For more information, check out the following resources:
    http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html?devcon=f1
    http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html
    Q: I want to run a function in my main application from
    inside my
    custom component. But when I try to refer to myFunction() in
    that
    component, I get a compile time error Call to a possibly
    undefined function
    myFunction. How can I fix this?
    A: Your component has its own scope, so it doesn't know
    anything
    about the functions in the main file. You can get around this
    by directly
    referencing the main application scope like this:
    Application.application.myFunction(). However, this makes
    your component
    tightly coupled, which is a quick way of saying that your
    component is only
    usable in an application that has a myFunction() function in
    it. You're
    better off dispatching an event from your component and
    letting the
    application decide how to handle it. For more information,
    check out the
    following resources:
    http://www.adobe.com/devnet/flex/articles/loose_coupling.html
    http://www.adobe.com/devnet/flex/articles/graduating_pt1.html
    Q: I want to decide at runtime what kind of component to add
    to
    display my data. How can I accomplish this?
    A: Use getDefinitionByName and ClassFactory to dynamically
    create
    your class. Just be sure that you actually have at least one
    "hard"
    reference to each class you intend to use, or the class might
    not get
    compiled into your swf. Here's a full write-up of how to do
    that:
    http://www.paulofierro.com/archives/520/
    Q: I need to set a property or add an event listener on a
    component
    that is in a ViewStack/TabNavigator/Accordion. When the
    component is not
    the first child of the Navigator Container, I get a null
    object error
    (#1009). What causes this, and how can I fix it?
    A: By default, the Navigator containers only create the
    children of
    each pane as that pane is viewed. The easy way to fix this is
    to set the
    creationPolicy on the Navigator to "all." However, this will
    cause your
    application to take longer to load. A better way to fix this
    is to wait for
    a later event, such as creationComplete on the component you
    want to access,
    or to use binding to "pull" the data into the component.
    The way I handle it is to call invalidateProperties() on
    change of the
    ViewStack. I then override commitProperties() and call an
    "initializer" for
    each pane. In the body of each initializer function, I check
    to see if the
    selectedItem for the viewStack is the one my initalizer cares
    about. If
    not, I return from the function immediately. Inside that
    initializer
    function, I set properties and add listeners as appropriate.
    Q: When my application is taller than the browser window, I
    get
    scrollbars in the application. I want the browser to do the
    scrolling. How
    can I do this?
    A: In the html-template/index.template.html file change line
    46 (in
    the Flex 3 template) to read <body scroll="auto">
    instead of the default of
    <body scroll="no">.
    Q: I am using URLRequest, HTTPRequest, or HTTPService to
    retrieve
    information from a database on a server. The first time my
    application
    makes a server call, it works fine. But when I call the same
    page again, I
    get the same data, even though I know the data has changed on
    the server.
    Is this a bug?
    A: The browser has cached the response it got from the first
    call
    you made to the page. This means that you need to either
    change how you are
    calling the page so it appears to be a new request, or you
    need to change
    the page itself so that it won't be cached.
    To change how you are calling the page, append a unique value
    to the end of
    the URL. For example, new
    URLRequest('yourPage.asp?param="+(new
    Date()).getTime).
    If you want to change the page itself, you need to change the
    response
    headers. The method for changing the response headers will
    vary from
    language to language. For more on this see:
    http://msdn.microsoft.com/en-us/library/aa923184.aspx
    http://www.sun.com/books/components/Hall_ch7.pdf
    http://www.w3schools.com/php/func_http_header.asp
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_g-h_07.html#3989067
    Q: I am using Modules in my Application. When I load the
    first
    Module, everything works fine. But when I load the second
    one, I get a Type
    Coercion Error failed error #1034 that looks something like
    TypeError: Error
    #1034: Type Coercion failed: cannot convert
    com.myDomain.package::SingletonClass@fce9a89 to
    com.myDomain.package::SingletonClass or TypeError: Error
    #1034: Type
    Coercion failed: cannot convert
    mx.managers::HistoryManagerImpl@22346589 to
    mx.managers.IHistoryManager. How do I fix this?
    A: When you reference a singleton class, either a custom
    singleton
    or one of the managers in Flex, into a Module, if this is not
    loaded in the
    Application domain, it will load into the child domain of the
    first Module
    to load and other Modules will not be able to see it. To
    prevent this,
    either directly load your class into the main Application
    before loading any
    Module, or use a Runtime Shared Library with the class
    included.
    For more on this, see Alex Harui's presentation on Modules
    from Flex 360
    http://blogs.adobe.com/aharui/2007/03/modules.html
    (slides 19, 24-31).
    Not sure what a Singleton is? Check out
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=262&produc tId=2
    Q: I'm using a Repeater to lay out the right number of
    components on
    the screen for me based on a data source. I'm trying to set
    up the id for
    each component dynamically like this:
    <mx:Repeater id="myRepeater" dataProvider="mySource">
    <mx:Button id="{'myButton'+myRepeater.currentIndex}"
    label="{myRepeater.currentItem.label}" />
    </mx:Repeater>
    When I try to run the file, I get a compiler error
    '{'myButton'+myRepeater.currentIndex}' is not a valid
    identifier.
    I need to be able to reference each of the repeated
    components. How can I
    do this?
    A: If you give the component an ordinary id like this:
    <mx:Button id="myButton"
    label="{myRepeater.currentItem.label}" />
    Flex will create an Array for you called myButton that
    contains a reference
    to each component the repeater created. For more information,
    see
    Referencing Repeated Components here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=repeater_3.html
    Courtesy of Amy's Flex Diary (
    http://flexdiary.blogspot.com).
    The most recent version of this FAQ can always be found at
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

    "Greg Lafrance" <[email protected]> wrote in
    message
    news:gbr2r8$qtv$[email protected]..
    > Is it possible to number the questions? Sometimes in
    your posts you refer
    > to Q3, but they are not numbered.
    Good point :-). I get tired of counting them sometimes. I'll
    try to get
    that done before next week.

  • How to access a function in a tabnavigator container?

    I have a tabNavigator container that I create the tabs using
    the following code:
    var tabFieldsBase1:Canvas = new Canvas();
    var _userFields:userFields = new userFields;
    tabFieldsBase1.label = "User Fields";
    _userFields.id = "userFields";
    tabFieldsBase1.addChild(_userFields);
    tabHolder.addChild(tabFieldsBase1);
    inside the tabed document/class I have a function/method
    named: startMeUp(). How can I call this function in the currently
    active tabed class using AS3 in my app?
    I've tried many ways including: var testTemp:Object =
    tabHolder.selectedChild.getChildAt(0);
    testTemp.startMeUp();
    userFields.startMeUp();
    Thanks for the help;
    Carlos

    Thanks Tracy for your input, I think my problem is
    understanding Flex 2 scopes properly.
    I'm under the impression that when you create an mxml file
    compoenent that Flex 2 converts that into an AS2 class, but I guess
    not.
    I solved this situation by using Actionscript 3 classes to
    build my tabs. Now when my main form changes I'm able to
    automatically synchronize the displayed tab by calling a method in
    the class.
    Thanks!!
    Carlos

  • Flex 4 - Error with DataGrid in Module

    Hey, I'm using Flex 4 final and am now getting the following error when loading a Module with a DataGrid inside:
    TypeError: Error #1009: Cannot access a property or method of a null object reference
        at mx.styles::StyleProtoChain$/initProtoChainForUIComponentStyleName()[E:\dev\4.0.0\framewor ks\projects\framework\src\mx\styles\StyleProtoChain.as:356]
    It is created via MXML:
    <mx:Module layout="absolute" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx">
        <mx:DataGrid>
            ... config etc.
        </mx:DataGrid>
        ... other code
    </mx:Module>
    If I remove the DataGrid the Module works fine. The code used to work in the various betas.
    If I put a DataGrid in the main application that also renders fine, so it's only inside Modules.
    Thanks in advance for any help or ideas!

    Hi Darrell,
         I have the exact same error, and yes I am using module.factory.create() but I get an error when I try to add the module to my stage.  Here it is the code in my modReady function.
    var _sd:Object = new Object();         
    _sd = util.app.SDModule.factory.create() as SequenceDetail;
                _sd.sequenceId = event.currentTarget.selectedItem.sequenceId;
                _sd.environment = event.currentTarget.selectedItem.environment;
                _sd.seqname = event.currentTarget.selectedItem.sequenceName;
                util.app.page.addChildAt(_sd as SequenceDetail, util.app.page.numChildren);
                util.app.nav_buttons.selectedIndex = -1;
                util.app.page.selectedIndex = util.app.page.numChildren-1;
    I get an error on util.app.page.addChildAt(........).
    error is
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at mx.styles::StyleProtoChain$/initProtoChainForUIComponentStyleName()[E:\dev\4.0.0\framewor ks\projects\framework\src\mx\styles\StyleProtoChain.as:356]
        at mx.styles::StyleProtoChain$/initProtoChain()[E:\dev\4.0.0\frameworks\projects\framework\s rc\mx\styles\StyleProtoChain.as:171]
        at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::initProtoChain()[E:\dev\4.0.0\frameworks\proje cts\framework\src\mx\core\UIComponent.as:10186]
        at mx.core::UIComponent/regenerateStyleCache()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\core\UIComponent.as:10249]
        at mx.core::Container/regenerateStyleCache()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\Container.as:3737]
        at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:\dev\4.0.0\frameworks\projects \framework\src\mx\core\UIComponent.as:7114]
        at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChild()[E:\dev\4.0.0\frameworks \projects\framework\src\mx\core\Container.as:4464]
        at mx.core::ContainerRawChildrenList/addChild()[E:\dev\4.0.0\frameworks\projects\framework\s rc\mx\core\ContainerRawChildrenList.as:143]
        at mx.containers::TabNavigator/createChildren()[E:\dev\4.0.0\frameworks\projects\framework\s rc\mx\containers\TabNavigator.as:559]
        at mx.core::UIComponent/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\ UIComponent.as:7250]
        at mx.core::Container/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:3129]
        at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\UIComponent.as:7142]
        at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\Container.as:3951]
        at mx.core::Container/addChildAt()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:2616]
        at mx.core::Container/addChild()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Cont ainer.as:2534]
        at mx.core::Container/createComponentFromDescriptor()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\core\Container.as:4371]
        at mx.core::Container/createComponentsFromDescriptors()[E:\dev\4.0.0\frameworks\projects\fra mework\src\mx\core\Container.as:4160]
        at mx.containers::Panel/createComponentsFromDescriptors()[E:\dev\4.0.0\frameworks\projects\f ramework\src\mx\containers\Panel.as:1685]
        at mx.core::Container/createChildren()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\cor e\Container.as:3187]
        at mx.containers::Panel/createChildren()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\c ontainers\Panel.as:1198]
        at mx.core::UIComponent/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\ UIComponent.as:7250]
        at mx.core::Container/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:3129]
        at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\UIComponent.as:7142]
        at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\Container.as:3951]
        at mx.core::Container/addChildAt()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:2616]
        at mx.core::Container/addChild()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Cont ainer.as:2534]
        at mx.core::Container/createComponentFromDescriptor()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\core\Container.as:4371]
        at mx.core::Container/createComponentsFromDescriptors()[E:\dev\4.0.0\frameworks\projects\fra mework\src\mx\core\Container.as:4160]
        at mx.core::Container/createChildren()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\cor e\Container.as:3187]
        at mx.core::UIComponent/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\ UIComponent.as:7250]
        at mx.core::Container/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:3129]
        at SequenceDetail/initialize()
        at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\UIComponent.as:7142]
        at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.0.0\frameworks\projects\ framework\src\mx\core\Container.as:3951]
        at mx.core::Container/addChildAt()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\Co ntainer.as:2616]
        at mx.containers::ViewStack/addChildAt()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\c ontainers\ViewStack.as:1426]
        at com::MyDBResult/displaySequenceDetail()[/Users/jbhavsar/Documents/workspace/virome/src/co m/MyDBResult.as:114]
        at <anonymous>()[/Users/jbhavsar/Documents/workspace/virome/src/com/MyDBResult.as:103]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at ModuleInfoProxy/moduleEventHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\mo dules\ModuleManager.as:1168]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at ModuleInfo/readyHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\modules\Modul eManager.as:812]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::FlexModuleFactory/update()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\cor e\FlexModuleFactory.as:433]
        at mx.core::FlexModuleFactory/docFrameHandler()[E:\dev\4.0.0\frameworks\projects\framework\s rc\mx\core\FlexModuleFactory.as:582]
        at mx.core::FlexModuleFactory/docFrameListener()[E:\dev\4.0.0\frameworks\projects\framework\ src\mx\core\FlexModuleFactory.as:126]
    Thanks
    Jay
    p.s: Please dont hammer me if my code isn't upto standard, I am learning this as I go along.

  • Flex with Java - DB data access

    Hello, folks,
    I am developing a Java application and realized that I need
    some advice. My application is simple:
    I have a MSSQL server, tomcat 5.5 ,flex data services.
    In my application , i have two combo boxes.. country, town..
    i have populated the country combobox with the values from
    DB(country table) obtained using the fill(List ListArgs) in
    Assembler Class.
    Now, based on the country selected in have to populate my
    town combobox from (town table)
    How can i populate the town combobox from the DB based on the
    country code?
    Is there any function to pass the selected index and populate
    the town combo box..????
    My code is as below:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" >
    <mx:DataService id="ds" destination="quick-search-country"
    autoCommit="false" autoSyncEnabled="false"/>
    <mx:DataService id="tds" destination="quick-search-town"
    autoCommit="false" autoSyncEnabled="false"/>
    <mx:ArrayCollection id="cntry_list"/>
    <mx:ArrayCollection id="town_list"/>
    mx:Panel layout="absolute" backgroundColor="#c6daf5"
    verticalCenter="0" horizontalCenter="0">
    <mx:Form id="SearchForm">
    <mx:TabNavigator >
    <mx:Canvas label="Hotel" width="339" height="234"
    backgroundColor="#ffffff">
    <mx:Label x="10" y="91" text="Country :" alpha="0.12"
    />
    <mx:ComboBox x="93" y="89" fontSize="10" id="Country"
    dataProvider="{cntry_list}"
    labelField="countryName"
    creationComplete="ds.fill(cntry_list)"
    change="tds.getItem(Country.selectedItem)" prompt="United
    Kingdom" >
    </mx:ComboBox>
    <mx:Label x="10" y="126" text="Town / City :"
    fontFamily="Georgia" alpha="0.12"/>
    <mx:ComboBox id="town" x="94" y="124" fontSize="10"
    dataProvider="{town_list}"
    labelField="townName" prompt="London WC1" >
    </mx:ComboBox>
    </mx:Canvas>
    </mx:TabNavigator>
    </mx:Form>
    </mx:Panel>
    </mx:Application>
    this is my main.mxml . I have CountryAssembler to fill the
    country combo and a DAO class . Have a Town assembler..
    Please advice me on how to populate the town combo based on
    country selected from the DB...
    I am really stuck up... and also dont have any documentation
    on Flex data services with Java support..
    please give me some suggestions on this.
    Thanks in Advance,
    Ambili

    Hi Mete,
    Thanks for ur reply , Mete. Your reply helped me a lot. Am
    using FDS 2.0.
    I have a doubt in combo box area itself.
    I have two tables by name country_list and town_list
    country_list consists of identity column , country_name and
    country_code
    town_list has identity column, country_code, town_code and
    town_name
    Normally while we use combobox in jsp, we have key value
    pairs for combo box..
    For eg:- if we have a Country combo , we have the country
    name(United States) as text displayed and its country code (US) as
    key.
    So if i select the United States , i will be returned with
    the value 'US' so that i can use it in query directly as
    Select town_name, town_code from town_list where country_code
    ='US'
    But while using flex , am not able to retieve the
    country_code from country combo. its only returning the text and
    the id.
    Here am forced to write a nested query as follows
    Select town_name, town_code from town_list where country_code
    =( Select country_code from country_list where country_name='United
    States')
    Is there any way to get the country_code as key while i
    select the country from country combo .
    And also how to keep 'United States' as selected during the
    intial load of the page.
    <mx:ArrayCollection id="cntry_list"/>
    <mx:ComboBox x="93" y="89" fontSize="10" id="Country"
    dataProvider="{cntry_list}"
    labelField="countryName"
    creationComplete="ds.fill(cntry_list)"
    prompt="Select Country" />
    please give me some suggestions on this.
    Thanks in Advance,
    Ambili

  • Flash components in Flex

    I have built an interface in Flash CS3 and now have the need
    to port it over to Flex. I am trying to do it with as little
    re-build as possible, so I need to port the Flash components over
    with it. I exported a SWC with all of the components I am using,
    and added it to the Library Path of an AS project.
    The build gives me no errors, but I do get a #2007 at
    runtime. The error seems to be stemming from a Yahoo ASTRA Flash
    component, which was included in the SWC.
    TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/addChildAt()
    at fl.controls::BaseButton/drawBackground()
    at fl.controls::LabelButton/draw()
    at fl.controls::Button/draw()
    at
    com.yahoo.astra.fl.controls.tabBarClasses::TabButton/draw()
    at fl.core::UIComponent/drawNow()
    at com.yahoo.astra.fl.controls::TabBar/drawButtons()
    at com.yahoo.astra.fl.controls::TabBar/draw()
    at fl.core::UIComponent/callLaterDispatcher()
    I have been searching around the net, and the majority of
    people are saying that this happens when the skins aren't included
    (so you need to set them before the component is added to the
    stage). I am using customized programmatic skins, for which the
    source files are included in the build, and the styles get set
    before the component is added to the stage (I actually replaced the
    default ones in the class).
    Does anyone have any other ideas as to how I could fix this?
    PS - It is an ASTRA TabBar component that is giving me
    issues. I know that Flex has a TabBar and TabNavigator, but I can't
    find any documentation on how to use these from an AS project (no
    MXML). I will simply rebuild using the native Flex controls if
    necessary, and if possible, but would prefer to fix the issue as it
    currently stands. (I might go back to Flash at some point, and
    don't want to tie myself to a particular solution, considering I
    can't use Flex components in Flash).
    PPS - If you are wondering why I am porting to Flex right
    now, especially if I am considering taking it back to Flash in the
    future, it is because I have the need to begin building in
    FlashPlayer 10 functionality, and the only way you can build to
    FP10 right now (as its in beta) is with a nightly build of
    Flex.

    "rritchey" <[email protected]> wrote in
    message
    news:g8ua6d$qu6$[email protected]..
    > bump: Was I not clear in my question? Or does no-one
    know the answer?
    You might want to try in the flexCoders Yahoo! group.

  • Indesign Script Opening Flex App / Tab Handling

    Hi,
    I am working on a  FlashBuilder 4 application that is opened from, and interacts with, an  Indesign CS4 .jsx script. I have added a TitleWindow that  provides for login processing (there is a backend database) to the Flex application. The login  window is opened from the method that is registered as the  initialization method for the Flex application. The flow works nicely.  The application, with its presentation of a TabNavigator holding the  core panels, visually appears then the login TitleWindow opens modally.  The id / password is entered, then the web service is called that  handles verifying login. The event handlers that receive the callback  from this then populate the controls on the application if the user is  verified.
    The problem I am having is with tabbing on the  TitleWindow. No matter what I do (tabEnabled / tabIndex settings, etc.) within Flex,  the TitleWindow will not receive tab presses and react to them. Tabbing  seems to cycle through the Indesign application in the background.
    From a  ScriptUI perspective the Flex application is opened as a Window (I've  tried Palette with similar results. I need it to be non-modal). Not only does the first tabbable  field not get focus, even when explicitly coded to do so, if you try to  tab off of it, which doesn't work, then click on the  second field on the TitleWindow to force focus, the first keystroke you type into the text field is ignored.
    If  I test the application from FlashBuilder directly, without being invoked  as a ScriptUI Window / FlashPlayer, the first field gets focus, tabbing  works, etc.
    Can anyone tell me how to make the login window behave such that I can set focus on field 1 and have it respond to tab  presses to cycle to the second field? Is there something I should do in the FlashBuilder application's invocation within the .jsx?
    Here are the operative lines from the script:
    var res =
    "window {        \
        fp: FlashPlayer { preferredSize: [1100,650], minimumSize:[800,450], maximumSize:[1200, 850] },    \
    var importFlashWindow = new Window (res,"Import Stories", undefined, {resizeable:true, independent:true});
    importFlashWindow.onShow = function(){
        var movieToPlay = new File (mySWFFile);
        try {
            //This function must be declared before the swf file is loaded as the flex panel calls it
            //from its init method.
            this.fp.getBaseUrl = getBaseUrl;
            this.fp.loadMovie(mySWFFile);
            //etc.
    I have posted the same basic question in the Flex / FlashBuilder forum with no response. I'm hoping someone here might know what I need to do to get the FlashBuilder application to receive the tab presses instead of the Indesign application behind it.
    Any help appreciated.
    Thanks,
    David

    Hi All
    I'm doing somthing similar.
    I have many textArea in my SWF file and I can't copy and paste text in it using shortcuts.
    If I paste contents using the Indesign menu commend, all works fine.
    Someone can help me?
    thanks
    Ivan

  • A Bug in mx:TabNavigator ? See small example here

    Hi all,
    Maybe it's a bug in the TabNavigator component... should I
    fill a new bug in the system or is that behaviour well known?
    Just compile the code attach to this message.
    It's a simple application with a mx:TabNavigator and some
    buttons. When you create a new tab, via ActionScript, the 1st tab
    ca be automatically selected.
    But when you delete all the tabs (either by calling
    removeAllChildren(), or by calling subsequently removeChildAt(...)
    on every tabs), you wont be able to select the 1st tab, unless you
    create a second one, select the new one and select the 1st one
    afterward.
    Is there any workaround for this?!
    I really need to find a fix now, I can't wait another
    revision of the Flex framework . . .
    Please someone, help me!!!
    thanks!!!
    P.S. It's not a bug in the attach code, anybody can try this
    at home, with the same result...

    This is a bug and I just checked the source.
    It seems that selectedIndex remains as 0 when you remove all.
    When you addChild again, it checks if the index of added children
    == selectedIndex and if yes, it do not focus. The patch should
    affect removeAllChildren and removeChild, by setting -1 to
    selectedIndex when numChidren reaches 0.
    Where do I report this bug? It's the second one I found....
    Regards,
    Guilherme Blanco

  • Error in app with TabNavigator loaded with SWFLoader - WebKit browsers

    Hiya,
    I use a flex app (A) to load another flex app (B) using SWFLoader (both built using Flex Builder 3 sometime ago).
    Everything works fine as expected across all (IE, FF, Chrome, Safari) desktop browsers.
    However, if I use a TabNavigator within the flex app (B) then when you click on any of the tabs it unloads the flex app (B) and re-starts flex app (A). This behaviour is limited to Webkit based browsers (Chrome & Safari) the rest of the browsers (IE, FF) it works fine.
    I wonder if anyone can throw some light on this.
    Many thanks
    Kind regards,
    klem

    Resolved:
    Replacing the HTML template files with the latest copy from Flash Builder 4.5 seemed to resolve the issue. It appears they have replaced the AC_OETags.js with swfobject.js
    Tried to explore upgrading the code to 4.5 but seemed to throw a lot of incompatibilities, created a test/dummy project instead in 4.5 and used the html file created to replace the old html files created by Flex Builder 3.0
    Clearly not a very common problem, but hope this saves someone time and effort.
    Thanks Harui

Maybe you are looking for

  • Problem with having several database connection registered in JDEVElOPER

    Hi Thank you for reading my post I have several AS registered in my Jdeveloper environemtn and several database connections. unfortunately some times Jdeveloper can not deploy an application into a server beacause it say that "I failed to create the

  • Unable to create query for new dataset

    Something weird has happened to our BI Publisher application in production. It was working fine, we could create reports and datasets and templates just fine. Now all of a sudden when we create a new report and a new dataset the Data Set screen is no

  • Font size when printing from Safari to HP Photosmart 6520 printer

    I just bought a Macbook Pro 13 inch, running OSX 10.9.5.  When I try to print something from within a Safari web page to my HP PhotoSmart 6520 printer, the font is huge. Does anyone know how to adjust the font size for use with Safari. The font size

  • All the vocals are being cut out... help!!!

    I haven't used my iPod mini in a while, and when I started updating my library I had some updates to download and ever since then it has been acting up. The EQ is extremely off, and no matter what setting I put it on its still strange. Many of the vo

  • HP Photosmart C309G does not upload to Snapfish correctly

    When I insert a memory card into my C309G wireless printer, I choose to save the pictures to Snapfish. It goes through the whole process of saving the pictures and even gives an album name, which is the date.  When I login to my Snapfish account thro