Dynamically create a Repeater component in ActionScript

Hello

I am dynamically creating a repeater with an image control and a label control. I can do it directly in the MXML file but when I try and covert in ActionScript it does not work. You can see what the problem is with my code?

public void GetPalettes (): void {}
removeChild (document). FrontPage);
Palettes.Method = "GET";
params = {"method": "GetPalettes", "BodyPartNo": document.} PalettesMenu.selectedItem.@partNo};
Palettes.Cancel ();
Palettes.Send (params);

var VerticalBox:VBox = new VBox();
VerticalBox.x = 10;
VerticalBox.y = 10;
VerticalBox.id = "VerticalBox";

var PaletteRepeater:Repeater = new Repeater();
PaletteRepeater.dataProvider = "{Palettes.lastResult.Palette}";
PaletteRepeater.startingIndex = 0;
PaletteRepeater.id = "PaletteRepeater";

var PaletteImage:Image = new Image();
PaletteImage.setStyle ("HorizontalAlign", "left");
PaletteImage.source = " http://localhost/Flex/Personalised%20Palettes-debug/ {PaletteRepeater.currentItem.@PictureS rc} Med.png"; ""
PaletteImage.useHandCursor = true;
PaletteImage.buttonMode = true;
PaletteImage.mouseChildren = false;
PaletteImage.id = "PaletteImage";

var PaletteDescription:Label = new Sun;
PaletteDescription.text = "{PaletteRepeater.currentItem.@Description}";
PaletteDescription.id = "PaletteDescription";

document. MainPage.addChild (VerticalBox);
VerticalBox.addChild (PaletteRepeater);
PaletteRepeater.addChild (PaletteImage);
PaletteRepeater.addChild (PaletteDescription);

}

Thank you

"katychapman85" wrote in message
News:g6ndvo$5B0$1@forums. Macromedia.com...
> This is my ActionScript function to get pallets:
>
> public void GetPalettes (): void {}
> document. FrontPage.visible = false;
> document. PaletteCanvas.visible = false;
> Palettes.url =
> "" http://localhost/Flex/Personalised%20Palettes-debug/Palettes.php?BodyPartNo= " "
> Palettes.url += document. PalettesMenu.selectedItem.@partNo;
> Palettes.send ();
> document. PalettePictures.visible = true;
> }
>
>
> So I to the PalettePictures folded after that I extracted pallets
> but
> it still flashes the previous ones. Is the HTTPService has any sort of
> onComplete parameter so that I can make visible pallets once they have been
> completely
> Recovered?

Try this:

public void GetPalettes (): void {}
Palettes.URL =
"" http://localhost/Flex/Personalised%20Palettes-debug/Palettes.php?BodyPartNo= " "
Palettes.URL += document. PalettesMenu.selectedItem.@partNo;
Palettes.Send ();
Palettes.addEventListener ('Result', onPaletteResult);
}

private void onPaletteResult(e:ResultEvent) {}
Ugh! encapsulation of broken, but I don't know
enough of your structure to fix
document. FrontPage.visible = false;
document. PaletteCanvas.visible = false;
document. PalettePictures.visible = true;
}

HTH;

Amy

Tags: Flex

Similar Questions

  • How to dynamically create action item?

    Hi, I want to dynamically create point.

    Before I want to create using qml, but does not seem possible

    http://supportforums.BlackBerry.com/T5/Cascades-development/how-to-create-action-item-of-page-dynami...

    So maybe better to use C++ to create dynamically,

    I'm already try but are still not

    So I have a custom control qml (a Navigation pane)

    name List.qml

    the structure is like this:

    NavigationPane {}

    {Page}

    objectName: myPage

    {Of container

    ....

    }

    }

    }

    How to add action item to this .qml?

    I'm already try that, but failed

    C++ :

    Engine QDeclarativeEngine;

    QDeclarativeComponent component(&engine,QUrl::fromLocalFile("List.qml"));)

    QObject * object = component.create ();

    Page * myPage = object->findChild ("Edit");  Maybe, on that note, I'm wrong implemented? -> not found?

    ActionItem * action1 = ActionItem::create () .title ("first action");

    my page-> addAction (action1, ActionBarPlacement:nBar);

    Remove the object;

    How to create this dynamic Action item?

    Help, please

    Thank you

    Hello

    QML, the object name must be included between "" marks.

    Name of the object of your Page will be:

    objectName: "myPage"
    

    You can reach any CPP QML object like this:

    This excerpt comes from YourProjectName.cpp

    // create scene document from main.qml asset
    // set parent to created document to ensure it exists for the whole
    // application lifetime
    
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
        // set created root object as a scene
        app->setScene(root);
    
    //and here comes the findChild method
    Page* qmlPage = root->findChild("myPage");
    

    After this, you can create any object on the side of C++ QML, as your own code:

    ActionItem* action1 = ActionItem::create().title("First action");
    myPage->addAction(action1, ActionBarPlacement:nBar);
    

    Don't have no need to create a QObejct, or declarative stuff.

  • Help with dynamically created components (turning point properties on or off)

    Hi all! I'm working on an application with a bunch of delegates of control is created dynamically.

    Here's my use case-scenario:

    I do a type app GPA calculator, and instead of hard coding a lot of drop-down lists for students select notes, I created a custom component. According to the documentation, each component created dynamically are destroyed until the parent TI auto is destroyed. ControlDelegate seems to be a better option that you can set the flag to false to make the component to go.  I created a delegate of control that uses the custom of the list drop-down and added a few aliases to give each a name of object on creation. Now, my problem is that I can't understand the correct item call to the property delegateActive set to false to make the element disappear.

    Here is the delegate of the control:

    import bb.cascades 1.2
    
    Container {
        property alias cT : classTitle.text
        property alias oN : obName.text
        property alias dN : dDown.objectName
        property alias cdF : dDown.delegateActive
        property alias dDown : dDown 
    
        topPadding: 10.0
        bottomPadding: 10.0
    
        ControlDelegate {
            id: dDown
            sourceComponent: droDwn
            delegateActive: true
        }
        attachedObjects: [
            ComponentDefinition {
    
                id: droDwn
                GpaDD {
                    ddPro {
                        title: cT
                        objectName: oN
                    }
                }
            }
    
        ]
    
        Label {
            id: classTitle
            text: ""
            visible: false
        }
        Label {
            id: obName
            text: ""
            visible: false
        }
    
        onTouch: {
            console.log(dDown.delegateActive + " " + dDown.objectName)
        }
    }
    

    on the home page, I have the following code to create a new component:

    Page {
        id: gpaCalc
        actions: [
            ActionItem {
                id: addDD
                title: "Add Class"
                imageSource: "asset:///images/add.png"
                ActionBar.placement: ActionBarPlacement.OnBar
    
                onTriggered: {
                    var nn = ddContainer.count();
                    var newDD = defDrop.createObject();
                    newDD.cT = "Class " + [ nn ];
                    newDD.oN = "_" + nn;
                    newDD.dN = "_" + nn;
                    ddContainer.add(newDD);
    
                }
            },
            ActionItem {
                id: remDD
                title: "Remove Class"
                imageSource: "asset:///images/Edit.png"
                ActionBar.placement: ActionBarPlacement.OnBar
    
                onTriggered: {
                    console.log();
                }
    
            }
        ]
        attachedObjects: [
            ComponentDefinition {
                id: defDrop
                DropDelegate {
                }
            }
        ]
        Container {
    
            /* ImageView {
             * horizontalAlignment: HorizontalAlignment.Fill
             * verticalAlignment: VerticalAlignment.Fill
             * imageSource: "asset:///images/rect_overlay.png"
             * opacity: 0.65
             * }*/
            ScrollView {
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
                scrollViewProperties {
                    scrollMode: ScrollMode.Vertical
    
                }
                Container {
                    horizontalAlignment: HorizontalAlignment.Fill
                    verticalAlignment: VerticalAlignment.Fill
                    topPadding: 50
                    leftPadding: 50
                    rightPadding: 50
                    id: ddContainer
    
                    onCreationCompleted: {
                        if (ddContainer.count() < 2) {
                            var nn = ddContainer.count();
                            var newDD = defDrop.createObject();
                            newDD.cT = "Class " + [ nn ];
                            newDD.oN = "_" + nn;
                            newDD.dN = "_" + nn;
                            ddContainer.add(newDD);
                        }
                    }
                    Label {
                        text: "Select Your Grades"
                        textStyle.fontStyle: FontStyle.Normal
                        textStyle.fontWeight: FontWeight.W100
                        verticalAlignment: VerticalAlignment.Top
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle.fontSize: FontSize.XXLarge
                    }
                }
                accessibility.name: "TODO: Add property content"
            }
        }
    }
    

    How can I find the last delegate of control created to define the delegate tag as wrong?

    Any help is appreciated!

    You have so much you need to do it this way?
    Why not just have a placeholder for * each * drop-down list and turn them on and off individually using delegateActive?

  • Handling dynamically created components qml in C++

    Hey,.

    I dynamically create a qml page by using the following code:

                    onClicked: {
                        var favPage = favPageDef.createObject();
                        nav.push(favPage);
                    }
                    attachedObjects: ComponentDefinition {
                        id: favPageDef
                        source: "FavPage.qml"
                    }
    

    I would now like to manipulate the components in this new page qml in c ++. How to access these components?

    I was able to access the qml components fairly easily if they were created during the initialization of the application, but of course, this isn't the case.

    I discovered what the problem was. I had to do my public AbsractPane in my header file. Then when I created the qml component and calls a function in c ++ it turns out to be a child. Thanks for everyone help well.

  • Access dynamically created movieclips

    I have an application that I add movieclips to a movieclip container through a loop and repeatedly by calling myClip.addChild (theNewClip). Now I have a dozen of clips in my container and it seems that the only way to access the item is to use the getChildByName() method and run it in a temporary clip, so I can get to the properties.

    What is the best or only way to do this? The old AS2 myContainer ["theName"] .property does not work with dynamically created movieclips? It doesn't seem to work for me.

    In any case, I now get the clips, but I was hoping that someone could show me a better way to access a clip created dynamically.

    OK Yes im a dumass.

    You can just say container.getChildByName("theName").x;

    Do not consider this post lol.

  • When dynamically created variables are emptied in the sequential process template?

    I have a sequence TestStand 2014 in which I dynamically create and fill many FileGlobal variables in the installation section of my main sequence.  I have it using the TestStand API to read the data in an Excel file (the data consists mainly of thresholds, limits, etc.).  The methodology itself works flawlessy.

    However, there are differences in behavior when using entry points both execution of the sequential process model.  When you use the entry point of execution 'Single Pass', he has no problem in test a DUT after another.  However, when you use the entry point for execution "Test DUT", I encounter the following error after completing of DUT1 and DUT2 testing:

    An error occurred the call 'InsertSubProperty' in 'PropertyObject' of 'NI TestStand 2014 API.

    The name of the element "VariableName" is not valid because it is already in use.

    I interpret this error message means that the variable I am trying to dynamically create the DUT2 track is already present race of DUT1.  I have a few questions about this:

    1. at what point in the sequential process template are dynamically created variables flushed, such as run a further by using 'Single Pass' starts with a clean slate?

    2. is there a reminder that I can substitute such as variables to rinse after each HAD run, allowing me to dynamically create variables on each HAD, during execution using "Test UUT?

    3. better yet, is there a counter of TestStand I can query to determine if I already ran DUT1 when using "Test DUT", such as DUT2 uses the variables that were created dynamically on trail of DUT1?

    Or you can simply use the PropertyExists function as a precondition.

    PropertyExists ("Locals.Foo")

  • How to dynamically create variables of StationGlobals who are LabVIEWIOControl

    I'm looking for a way to dynamically create variables StationGlobals LabVIEWIOControl.  I know not how to create variables through "PropertyObject/SetValXXX", however I have some difficualty create variables that are custom data types.

    Thank you

    Bryon

    Bryon,

    You can use an expression as follows:

    StationGlobals.NewSubProperty("MyVariable",PropValType_NamedType,False,"LabVIEWIOControl",0)

    I hope this helps!

  • dynamically create and destroy the custom menu item

    I have a standard TestStand platform that I use on multiple systems.  On some systems, I have a few sequences of calibration and I would like to have the Update menu to have the RunSequence of these sequences of calibration.  I know how to manually create these menu items, but they are no longer valid for some sequence files.  I would use the sequence SequenceFileLoad to dynamically create menu items and the SequenceFileUnload to destroy these menu items.

    I've played around with the API, but cannot determine the correct path to get to the create and destroy the custom menu items.  Does anyone know how this can be done?

    Thank you

    Matthew

    Yes, see the online help for the members of the following APIs:

    Engine.GetEditTimeToolMenuItems

    EditTimeMenuItems

    EditTimeMenuItem

    Basically, you get a collection of tool using Engine.GetEditTimeToolMenuItems () menu items and then call EditTimeMenuItems.Insert () or EditTimeMenuItems.Remove (). If you insert a you get returns an EditTimeMenuItem object on which you can change the settings.

    In addition, since it has an expression to hide items in menu tool, you need not necessarily to destroy, you can hide them instead.

    Hope this helps,

    -Doug

  • Time of design and of the dynamically created controls

    I have a project written in VC6 as a project of the MFC dialog box. In a particular area, I dynamically create several (the exact number depends on user input) CNiGraphs. There is also a two CNiButtons that were created at design time using the resource editor. The problem I have is that when this dialog box is open, a message appears saying it is an eval version and the control will go off after 5 minutes. After 5 minutes of waiting, the CNiButtons 2 go inactive (black tower), but the continuous CNiGraphs of work. I have a valid license of MStudio 8.1.6, version but it seems that these 2 buttons do not recognize the license. There are also other buttons from the moment of conception of the project, but these have no problem at all. When you create the dynamic creation of the CNiGraphs, give them a valid license string, and I was wondering if there is a problem with the time created and dynamically controls created in the same dialog box to design. Anyone know?

    I don't remember, but I can have created these 2 CNiButtons when I was with only an eval license. (All others were undoubtedly create when I got a full license) Could have an impact on them? I have a vague memory of reading somewhere that DTC create controls to check the license when they are created in the designer and store that info in them license. If this is the case does anyone know an easy way to update the license stored in control? I rather not just delete it and Add again because I would avoid having to redo the tab order (unless someone knows how to easily insert something in the middle of the order of tab instead of having to click through all the controls in the correct order)?

    In addition, I don't know if this would affect anything, but the project was originally built with ComponentWorks 1.0, we were forced to move to MStudio when we met a few bugs in CW, so all controls were originally CW controls which have been converted into control of CNi. I doubt that this is so like everywhere else, we changed during controls is not a problem, but I'm ready to try the suggestions.

    Hi JC,.

    I hope you had a good weekend!  I'm glad to hear that you're back running.  Add the extra button was, in fact, causing update the licensing information for the other buttons, as you can imagine.  After further research, I found that the license information are stored only the form of the control, and if this control doesn't change in any way (or in your case, adding a new project), he sees no reason when compiling to recreate a link to the license.  However, after the change of control and a new, it updates the link between the license information, which solved this problem in your case.

    I hope this helps, JC.  Have a great day!

  • Dynamically create QmlComponentDefinition objects in the code

    With QML sample:

    // --- main.qml ---Container {    objectName: "fooContainer"    attachedObjects: [        ComponentDefinition {            id: barComponent            source: "Bar.qml"        }    ]}
    
    // --- Bar.qml ---Container {    objectName: "bar"    Label {        text: "FooBar"    }}
    

    I am trying to dynamically create barComponent objects and add them to fooContainer in C++ code.

    So I reference the using fooContainer:

    fooContainer = createdRootObject->findChild("fooContainer");
    

    But how to reference the definition of QML barComponent to use his method createObject()?

    The definition of the element is used to create the object of QML

    To create the C++ object, you need to do:

    qml = QmlDocument::create("asset:///Bar.qml");
    Control *root =  qml->createRootObject();
    fooContainer->add(root)
    
  • Create a custom component which scales

    Hi all

    Maybe I can't think good question, but I can't find anything on it.

    I created a custom component extending UIComponent. Inside I have Bitmap, TextField, form. For now the width is fixed.

    Now, I like my element designed to always keep 100% width of the container that I put in it and based on the width would calculate height. I would like to stay same size (ie. not Bitmap scaling), except that we should adapt width of TextField and form - based on the width of the container parent.

    I have to add some listeners for a parent, or override my methods of a component? I'm totally lost here.

    Thank you!

    Michal

    A custom event in the scrolling pane, the configuration container, and the event through your components of bubble.

    i.e. the scrollpane triggers your custom event to the custom container event that triggers the event to your custom components.

  • Is it possible to create a shuttle component in Oracle ADF, where the available and selected lists are tables of the adf?

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    Is it possible to create a shuttle component in Oracle ADF, where the available and selected lists are tables of the adf?



    I did a POC sample on it. I can share with you. I can't put in my dropbox because dropbox is blocked in my network. Share your email. I'll send the POC through

  • May not know how to create a repeating table to PDF forms in InDesign

    Hello!

    It's all in the title. When I have my table with my header and footer, I can't understand how to create a repeating table for all users of my PDF files interactive.

    Thank you for your help,

    Will be

    If you mean that you try to create a table with entries from forms that develops by creating new topics, I'm sorry to tell you that is not possible in InDesign. It is not yet possible in Acrobat. The only software that takes in charge who is LiveCycle ES Designer that creates some XFA forms, a type of form which becomes less support in the future.

    -Dov

  • dynamically create a database in form 10g

    Hi guys,.

    I got a new requirement, that is to dynamically create a database of blocks and elements...

    How is it possible... ?

    Thank you...

    Ok...

    Thank you

    concerning

    SAI sandeep t

  • iframe on a dynamically created symbol

    Hello

    -J' have a button that creates a dynamically. That's ok

    - then I pass this symbol with TweenMax. It's Ok, I tested it.

    - and finally, I want to load an external URL in this symbol. It does not work.

    The problem is, I think, that I n 't know how to approach this dynamically created symbol.

    This is my code:

    externalURL var = "portfolio/FFD.html";

    var mywrapper = $(sym.createChildSymbol("wrapper","Stage").getSymbolElement ());

    var wrapperMove = TweenMax.to (mywrapper, 2, {css: {top: "2500", left:"0"},ease:Sine.easeOut});}})

    SYM. $("mywrapper") .html ("< iframe src ="+"externalURL + height = 100% width = 100% > < / iframe >");

    Thanks for any help

    Hi Joel

    It worked like that...;

    var mywrapper = sym.createChildSymbol ("wrapper", "Stage");

    var wrapperMove = TweenMax.to (mywrapper.getSymbolElement (), 2, {css: {top: '2500px", left:"0px"},ease:Sine.easeOut});}})

    mywrapper.getSymbolElement () .html ("");

    Somehow it didin'tt as the externalURL variable... don't know why...

    I got to understand it.

    Thanks for your help

Maybe you are looking for

  • How to make a screenshot?

    How to make a screenshot?

  • PHOTO PROBLEM

    Hi all, still waiting for a response to my question. I have a load pictures on my Amazon cloud, which I access from my laptop. I want to copy these photos (MUCH) to my iCloud, which I also access from my laptop. I don't want to use other devices, jus

  • Scan &amp; Copy 7520 thin vertical line

    A thin vertical line extends all the way to the bottom of the page - 6cm in on the left of the page.  It appears that when I use the automatic document feeder.  I have cleaned the printer according to the instructions and also to reset a couple of ti

  • EA6350 not accept the password "admin" little matter I have reset the router device.

    Hello I just brought a new EA6350 router and it does not accept the 'admin' to connect to the router. I have reset the router and can ping 192.168.1.1. Also able to enter in the login screen. But the default password: admin has not been the success y

  • (PalmOne) Tungsten E2 software installation

    I need to load the driver for my Tungsten E2 on Windows Vista Home edition, I am wanting to use my PDA (no phone yet cause I have a contract with ATT which doesn't seem to have a phone yet?) but want to hot sync my PDA with Palm Desktop... How do I?