Creating and deleting symbols dynamically

I need help to get this put particular function implemented.

I have 2 buttons with the codes I added

Create a button

$.getJSON ("content. JSON")

(.the)

{function (Data)}

Console.log ("incoming data:", data);

Console.log ("it comes from a present value of s var", model);

If (s == null)

{

$(données, fonction (index, item) {} .each)

var s = sym.createChildSymbol ('template', 'content');

s = sym.createChildSymbol ('template', 'content');

Creation of the variable which save my new instance of mySymbol

sym.setVariable (itemContainer"+ i, s);

Console.log ("name of the container element", s);

s. $("title") (item.item) .html.

s. $("description") .html (item.description);

s.Play (index *-500);

i ++ ;

Console.log ("'dressbtn' inside was CLICKED");

});

}

on the other

{

}

});


Remove button

for (p = 1 variety; p < = i; p ++)

{

s = sym.getVariable("itemContainer"+p);

s.deleteSymbol ();

}

i = 1;

So the two buttons one will obtain the Json and display, and the other to clear the created symbols.

But I only managed to erase the symbols on stage only once, and after that, I am getting error Javascript in the handler! Type of event = element

It's because I try to make an app that can get information about a file json from a Web server and can update and display the latest information in the application. So I have to be able to allow the user to press a button to refresh the page.

Is someone can shine some light on this?

Dropbox - test.zip

Hello

Your questions (or problems) come from your json file. Your json file is not well formed.

Here's a good one:

{"shoes": []}

{"item": 'Red shoes', 'description': "red prada shoes"},

{"item": "black shoe', 'description': 'Black canvas shoes'},

{"item": 'tilith shoe', 'description': 'ballet tilith shoes'},

{"item": 'hoof of gold', 'description': ' ballet shoes gold "},

{"item": 'ganma hoof', 'description': "ganma canvas shoe"}

]}

Then your button code:


(1) mybtn.click:

get information of json and display

$.getJSON ("content. JSON")

.the (function (data) {})

Console.log ("incoming data:", data);

$(données. chaussures, fonction (index, item) {} .each)

var s = sym.createChildSymbol ('template', 'content');

s. $("title") (item.item) .html.

s. $("description") .html (item.description);

s.Play (index *-500);

}) ; each

}) ; success


(2) btn_2.click:

removal of shoes (symbols)

symbol var = sym.getChildSymbols ();

$(symboles, fonction (index, item) {} .each)

Console.log ("symbols on stage:", item.getSymbolTypeName ());

If (item.getSymbolTypeName () == "template") item.deleteSymbol ();

});

Download link: test-2 - copie.zip - box

Tags: Edge Animate

Similar Questions

  • How to create and delete partitions automatically?

    How to create and delete partitions automatically?
    The environment is (10.2.0.3) 10g Oracle on the RHEL4.0 system.
    I want to partition the table of MESSAGES by date (NUMTODSINTERVAL(1,'DAY')). One partition per day. Because the table is huge, only 2 partitions (as of yesterday and today) are required to be available online. All partitions as earlier than the day before will be saved, and then dropped. I want to do the partition to create and delete the work performed automatically. How to do?

    Thank you

    junez wrote:
    Could do in detail?

    Here is an example of a procedure (part of a package) that adds/add a partition to an existing partitioned table schedule:

    procedure AddHourlyPartition( tableName varchar2, hour date, partitionName IN OUT varchar2 ) is
            sqlCreate       varchar2(4000);
            d               date;
    begin
            partitionName := GetHourlyPartitionName( hourly );  -- name of partition to create
    
            if existsPartition( tableName, partitionName ) then
                    -- nothing to do
                    return;
            end if;
    
            d := TRUNC(hour,'hh') + (1/24);                                -- upper date limit of the partition
    
            sqlCreate :=
            'ALTER TABLE '||tableName||'
                    ADD PARTITION '||partitionName||'
                    values less than
                            (TO_DATE('''|| TO_CHAR(d,'yyyy/mm/dd hh24:mi:ss') ||''',''yyyy/mm/dd hh24:mi:ss''))'
            ;
    
            ExecSQL( sqlCreate );
    
    end;
    

    The partition is safer to create partitions according to the experience?

    It is always better to write good packages in PL/SQL. Packages can (and should) use the application programming interfaces (API). Because our partition custom package that allows the management of partition. Or a messageLog package that allows for logging of application messages, errors, and debugging messages. Or a Notification package that allows to be send by email or SMS notifications. Etc.

    Design and software development, we should always approaches a "+ Lego mentality +"-which is to create building blocks ("+ Lego bricks +") which can be used and reused over and over again. Modularization is of crucial importance in software engineering as the result is not only of reusable code, but also the code that is easier to maintain, extend easier and easier to debug.

  • How to create and delete accounts

    How can I delete and create accounts?

    Hello

    Your question is off-topic for this forum, you may find the answer here:

    http://support.Microsoft.com/kb/279783

    Good luck

    Donald Anadell

  • FTP creates and deletes the temporary instead of the download file when you use the switch S:

    We use Windows 2008. There is a strange problem to start the FTP., receive a file.
    I can receive the file when the command line GET command. When I use the file with the command (ftp - s:Filewithcommands.txt), ftp creates a temporary file and remove it automatically without doing the real download.
    Thanks in advance

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums:

    http://social.technet.Microsoft.com/forums/en/winserverDS/threads

  • How to create and save symbols?

    I followed some tutorials on the creation of symbols, but I don't seem to be able to save them.  Also, I want to know the best way to organize, safe, change the symbol libraries.  Y at - it any documentation on this?

    Thanks in advance, John R.

    Observer,

    Select the illustration, and then open the window > symbol palette and click new symbol in the dialog box, and then from there.

  • Code to create and name shapes dynamically

    I am trying to create rectangles on the Web that have unique names. Finally, I would like to add a listener for these rectangles that allow to drag the mouse.

    So far, I've got:

    var box: MovieClip = new MovieClip();

    Box.Name = "rect1";

    box.graphics.drawRect (100,100,100,100);

    this.addChild (box);

    var targetBox:MovieClip = this.getChildByName ("rect1") as MovieClip;

    This [targetBox] (MouseEvent.MOUSE_DOWN, onStart) .addEventListener;

    This [targetBox] (MouseEvent.MOUSE_UP, onStop) .addEventListener;

    function onStart (e)

    {

    e.currentTarget.startDrag ();

    }

    onStop (e) function

    {

    e.currentTarget.stopDrag ();

    }

    But it does not work. I get an error: TypeError: Error #1010: a term is undefined and has no properties.

    Call createRectF(), passing the name and initial x, y of the used values:

    function createRectF(nameS:String,x_val:int,y_val:int):void {}

    var box: MovieClip = new MovieClip();

    Box.Name = nameS;

    addChild (box);

    {with (Box.Graphics)}

    lineStyle (what you want here);

    drawRect (0,0,100,100);

    }

    Box.x = x_val;

    Box.y = y_val;

    box.addEventListener (MouseEvent.MOUSE_DOWN, startdragF);

    }

    function startdragF(e:MouseEvent):void {}

    e.currentTarget.startDrag (false);

    stage.addEventListener (MouseEvent.MOUSE_UP, stopdragF);

    }

    function stopdragF(e:MouseEvent):void {}

    stopDrag();

    stage.removeEventListener (MouseEvent.MOUSE_UP, stopdragF);

    }

  • How to get the old default profile and delete the new default profile?

    Due to the power cut, I was not able to shut down my PC (windows 7). When I started it again once I started it in safe mode as i had dialogue"Windows has not stopped correctly chosen what mode to boot your PC... »

    I chose safe mode and then restarted the PC normally. But when I started FF, he behaved as if it were the first time installed and all my settings were gone.

    Open the Profile Manager and he showed only 1 default profile where, as I have 2 (default and another profile). This new default profile is completely new.

    I found my profile folder. It contains 3 profiles. My previous default and the other that I had created. And the third profile is new default. How do you take the 2 earlier

    Hello! You can copy your old information in your profile again (and since you had two old profiles to be restored, you can also create a new another profile for the second). It's all about copy - paste between folders, more information here: recovery of data from an old profile.

    Information on how to create a new profile here: use the Profile Manager to create and delete profiles Firefox.

  • grant, create and drop objects on the diagram to a role/user

    Generic question for Oracle RDBMS:

    As far as I know, there is no way for the owner of a schema privileges such as create objects, or drop objects in this schema to a user or a role.

    I know that a lot of people always asked if it is possible, and I hope Oracle will provide this capability, but as far as I know, it is not possible, even in 12.1.0.2.

    Does anyone have ideas on this?

    I considered to have developers to create programs to create tables, views, packages, etc. and then grant execute on them to the users/roles, but it would be a huge amount of work.

    Did someone come up with an easier way to do this?  Or know of a way that this can be done?

    Obviously, I can not grant create any table, index, package, view, etc., or to delete any table, view, etc., and of course we grant the DBA role.

    I thought that the 'become a user"was a solution, but it is apparently far from able to do such things.

    In our case, apparently, we have users log in with account of the owner of the schema and create objects, modify objects, etc.  (Change the objects is not a problem, because we can give everything on the object to someone.)   The problem is that we need to prevent people to connect to shared group accounts (or as the owner of the schema record) to create objects, drop objects, etc.).  We all have as their own user name and will not be able to create and delete objects in patterns of selection.

    Why must everyone CREATE and DROP of objects within the framework or the processing of information on the day the day?

    I feel a serious design flaw & conversion Orace DB.

  • 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!

  • All IT gurus out there who know Firefox... have lost the passwords saved when FF created a new profile and delete old files key3.dbf and logins.json profile.

    All IT gurus out there who know Firefox... have lost the passwords saved when FF created a new profile and delete old files key3.dbf and logins.json profile. Any ideas, anyone?

    So it's not a logins.json file?

    I see a signons3.txt file and a file signons.sqlite older, if you can try to see if you can import passwords stored in this file.

    You can force Firefox to re-import the passwords in the file signons.sqlite and regenerate the file logins.json with the following steps:

    • reset the signon.importedFromSqlite pref on the topic: config page by default via the context menu
    • Delete the logins.json file in the closed Firefox with Firefox profile folder

    When you restart Firefox, then you should have the pref signon.importedFromSqlite with the value set to true.
    You have passwords that are imported in the password manager, unless there were errors or signons.sqlite signons3.txt.

    You can open the topic: config page via the address bar.
    You can accept the warning and click on "I'll be careful" to continue.

    You can use this button to go to the current Firefox profile folder:

  • 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

  • Unable to delete a folder, once created and made common, my network place domestic, although I eliminated the prorotype of the folder inside the C.

    I create a folder, put it in common use and it appears as well as a branch in the plan on my local network. I can put some content in this folder. Sometimes I decide that this folder with its files is of no use to me and delete the folder of C. sometimes, it happens that the image in this folder, even empty, freezes on the plan of the network without being able to remove it from there. How can I get rid of this annoying and useless image?

    Hey Eagle54ZY,

    Try to use the steps in this article to remove the share of the computer that is located in the folder:
    Stop sharing a folder or drive

    If the folder still appears in Windows Explorer, try pressing F5 on your keyboard to refresh the items that are displayed.

    Hope that helps.

  • dynamically create and bind datamodel and listview

    Hello

    I looked through forums and examples, but in all the listview/datamodel example are linked since the start of the application only. I need to create and link dynamically. Because my data listview will depend on the selection of the previous shape. Need to do using qml. Can someone help me?

    I have not seen that your souce code can only guess the possibility.

    You have set the query, like "query:" / xxx/yyy "? You can add the journal to your custom data source to check the loop iteration of data?

    If you can show your brief source code, it willl be quick analysis.

  • dynamically create and addEventListener on the mouse, click

    Hi, I have 9 buttons on the main stage and each has an incremented instance P0001, P0002, P0003 name...

    I'm trying to dynamically create and addEventListener on mouse click for each call, then the function appropriate when the button is clicked, it is I who does not work, I go about it the wrong way? Thank you

    for (var i: int = 1; i < 10; i ++) {}

    var btn1:String="P000"+i.toString();

    var btn11:Object = btn1;

    var ClickBtn:String="Func"+i.toString();

    btn11.addEventListener (MouseEvent.CLICK, ClickBtn);

    i = i + 1;

    }

    function ClickBtn1(event:MouseEvent):void

    {

    trace ("in it1");

    }

    function ClickBtn2(event:MouseEvent):void

    {

    trace ("in it2");

    }

    ......

    Use:

    for (var i: int = 1; i<10; i++)="">

    This ["P000" + String (i)] .addEventListener (MouseEvent.CLICK, this ["ClickBtn" + String (i)]);

    }

  • Creating Instances of symbols containing an image dynamically resolved - need help

    I'm working on a prototype site which has many images flown in the navigation. Each image is unique, but the code rollover and rollout is identical. I am trying to create a unique symbol which can be used for all the bearings, but need help to figure this out, because it will considerably speed up my work.

    I think that the pseudocode would work like this:

    1. Create a symbol that contains a default rollover image.
    2. In the symbol, add the code rollover and rollout. To set the transparency of 0 - > 100 and back.
    3. Create instances of the symbol on each element of the NAV.
    4. For each instance, set a variable containing the name of the rollover image to use.
    5. In this instance of symbol, get the value of the variable.
    6. In this instance of symbol, use the image name in the variable to replace the default image.
    Question: How do the job 4 to 6 step? I have 1-3 working smoothly. P.S. my last work of dev is waaaaay returns with the Director, PHP and ColdFusion. I still get basic principles such as the use of the functions, instances, objects, inheritance, etc., but the language has changed. And I have very very little experience with the DOM.
    Appendix: How I do it manually
    1. There is a background image of the NAV showing all unselected States
    2. Each element of the net asset value has a rollover image in a series of elements on the nav element. Each bearing has initially set to 0% opacity.
    3. Each element of a rollover image, deployment and click triggers. Triggers rollover and deployment are the same for each. There is also a little more code with deployment that provides a quick fade. It means a lot to copy same code. I hate the idea of having to change any part of this code.

    Thank you! Chassy

    A big thank you Tim (?)!  You saved me a lot of hours on this project.  I'm still learning more jQuery / javascript behind Edge.  Could you assess if my interpretation of the loop content is accurate?  This is my understanding of the code is more limited:

    • SYM. $(array_btns [i]) - access to jQuery object associated with the element of border.
    • MouseEnter (...), - the content define the code to be executed during the passage of the mouse.
    • {obj:array_btns [i]} - refers to the element in the jQuery object, represented by the symbol of edge
    • function {...} - function to run on the given event within the given object/symbol.  The role of the "e" parameter is something I'm not clear on that.  The flow of the code, it seems to represent the edge symbol that contains the element that will be affected by the code.
    • var = e.data.obj BTN - implements a variable to refer to the side of edge.  I think it is the same symbol as number 1 above.
    • sym.getSymbol (btn).$("over").fadeIn (500) - runs the jquery code for fade in at the moment the jQuery "over" event is triggered.

    Also, I'm about to start testing to see if it works in nested symbols.   I guess compositionReady Trigger for each symbol, I can create a [array_btns] and then call sym.getComposition () .setup_btns ()?

Maybe you are looking for