JSON content - click here to see another symbol on the stage

Hello

Thanks Zaxist, I have a code of work similar to that below:

$.getJSON ("content.json",

{function (Data)}

for (var i = 0; i < data.length; i ++) {}

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

s.$("title").html (Data [i] .title);

s.$("description").html (Data [i]. Description);

s.$("Seira").html (Data [i]. Seira);

s. $("imageholder") .css ({'background-image': "url ('" + data [i].) "}) (image_+_«_'_»)});

.data s. $("imageholder") ("Great", data [i] .largeimage);

s.. Click$ ("imageholder") ("click", Function {}

sym.getComposition () .getStage ().$("finte").css ({'background-image': ' url ("+ .data ('l arge') $ (this) + ') '});

});

}

});

Now, I'm trying on the click function to show the display symbols on the stage, for example during the click on the first point, the red symbol will appear, so cliked the second element of the (previous symbols which appeared will be hidden) and the new blue symbol will appear. So on with all the other ellements with JSON files.

I tried this on the code, but nothing:

$.getJSON ("content.json",

{function (Data)}

for (var i = 0; i < data.length; i ++) {}

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

s.$("title").html (Data [i] .title);

s.$("description").html (Data [i]. Description);

s.$("Seira").html (Data [i]. Seira);

s. $("imageholder") .css ({'background-image': "url ('" + data [i].) "}) (image_+_«_'_»)});

.data s. $("imageholder") ("Great", data [i] .largeimage);

s.. Click$ ("imageholder") ("click", Function {}

sym.getComposition () .getStage ().$("finte").css ({'background-image': ' url ("+ .data ('l arge') $ (this) + ') '});

If (data [i] = 3) {}

sym.getComposition () .getStage ().$("red").show ();

}

else {}

sym.getComposition () .getStage ().$("red").hide ();

}

If (data [i] = 5) {}

sym.getComposition () .getStage ().$("blue").show ();

}

else {}

sym.getComposition () .getStage ().$("blue").hide ();

}

});

}

});

Could you help me?

Thanks in advance!

Well, if I have understood correctly, you want to check your image index, and the index was 3 or 5 show you a symbol appropriate for this...

I want to tell you something before I tell you how you can do this:

data [i] is your index of json files that return data from your json file not a number, and if your json file is something like this:

[

{"image": "images/toy - B.jpg",}

"title": "1st Image."

'Names': 'toy-B '.

}

]

(I'm looking for purpose of json that have index 0) means of data [0]

Well in this address, we have an object, but no data! because it has not itself data say witch we want, so it just return a data unreadable (just object), so if we say

Image Data [0] (now we have image data and this will return us Images/toy - B.jpg )

so we cannot simply say that [i] data

you need to do this way:

.data s. $("imageholder") ("Great", data [i] .largeimage);

s. $("imageholder") .data ('myIndex', i); We need another variable to save our index

s.. Click$ ("imageholder") ("click", Function {}

sym.getComposition () .getStage ().$("finte").css ({'background-image': "u rl (" + $(this).data('Large') + ")"});

If ($(this) .data ("myIndex") == 3) {/ / read value right and check}

sym.getComposi () .getStage ().$("blue").hide () ing;

sym.getComposition () .getStage ().$("red").show ();

}

ElseIf ($(this) .data ("myIndex") == 5) {}

sym.getComposi () .getStage ().$("red").hide () ing;

sym.getComposition () .getStage ().$("blue").show ();

}

});

}

});

also, you wrote your statement if and else in an improper way, learn the right way at the top for future use

If you have any question do not hesitate to ask

Zaxist



Tags: Edge Animate

Similar Questions

  • Everyonce in a while, I get a pop up window that says ' you run lack of disk space on drive BRFD click here to see if you can...» "What is a legitimate dialog or malware?

    I am running windows 7 on new laptop - everyonce in awhile, I get a pop up window that indicates "you run lack of disk space on BRFD-Drive (g) click here to see if you can free up space on this drive"-it's a legitimate dialog or malware?

    Ready boost is a piece of software that uses an external flash as SD card memory / Compact etc. as memory cache that the computer can use... as virtual but faster memory.

  • Make subtle tweaks to the similar symbols on the stage

    Let's say I have create a symbol of a stick figure holding a shield.

    Symbol 1: The Stick man

    Side 2: The shield

    Side 3: the Stick man holding the shield.

    Now, how would it be possible to place multiple copies of a symbol on the stage 3 while making subtle tweaks for EACH symbol on the stage 3.

    Is this possible?

    Let's say I want to make each stickman slightly a different color, without each unique stickman taking the same color.

    So I want to side 2 (the shield) a slightly different color in each of the stickman.

    How could I do all of this subtle adjustment without making each symbol instance 1 and 2 on the scene. Is this possible in flash? It seems that flash has so much power, but I still have to figure out how to use it, and I really hope that something like this is possible.

    If I need to explain what I mean, of course I will take the time to do it, but if someone could help me here, that would be much appreciated.

    Here is an example of what I was trying to describe you: http://www.ddg-designs.com/downloads/stick.zip . I have two instances of the same figure on the stage. I put a value of color transformation for the shield of one of these bodies. Shield of the other figure remains unchanged.

    If you double-click any figure given on the stage and then double-click on the shield of this figure and change the color, you change the color of the original symbol, and if all instances of this shield in each figure on the stage will be changed. Leaning on the transformation of color to an individual instance in an instance unique figure on the stage, you are able to change one and not all of the shields.

  • Add the symbol to the stage based on string of symbols

    Hello

    I am the string to add a symbol on the stage based on a string value in an existing symbol which is on the stage. I get no error when the game turns, but the symbol just reproduce on stage. I have no idea why

    This is the code:

    Variables used

    var score: int = 0

    var startX:int = stage.stageWidth = 920

    var startY: int = stage.stageWidth = 475

    Check to see if the "partition" amounts to 350 in ScoreBoardDisplay.txtScore.text

    If (ScoreBoardDisplay.txtScore.Text == String (350))

    {

    var HD1 = new HealthDrop();

    HD1.x = stage.stageWidth = startX

    HD1.y = stage.stageHeight = startY

    stage.addChild (HD1);

    HealthDrops.push (HD1)

    }

    Assuming you do not penetrate into this framework, when you check the score, but are always there, or at least hang out for a while, the problem is that the conditional code that you show only will run once, immediately entering into this framework.  He is not sitting it monitor any changes in the value of the text field.  You must specify the code to run.

    In this case what you could do is to place this code in a function that runs whenever the textfield value is changed.

    This code that you have to change the value of the TextField?

  • Dynamically set the order of the symbols on the stage?

    Is it possible to change the order of the symbols on the stage dynamically via the coding?

    While clicking on a button would be a symbol on the back?

    The reason why I ask is because even if one of my symbols is set to invisible, it still hinders my ability to click on the buttons that are technically below.

    Any help would be appreciated.

    Thank you

    You can use the z-index with this basic format:

    SYM. $('NomSymbole') .css ({' z-index': 100 '});

  • Use a button to the reversal, or click here to see the hidden text

    I am using Captivate 8 and I want to use a custom button I created as a rollover or click to view the object.

    For example, I have a useful suggestion I want the user to see if they choose to click on a light bulb.

    The bulb is customized to three positions (high, low).

    There is NO option to have this button to act as a trigger to display a text like a rolling caption.

    I thought it was a fairly common feature - I can't do that in Captivate?

    If I use the function of turning over I got to fix above my button. Although rolling works, he defeated the Visual purpose to have the button to display a different color turnover, since the bearing must be on a top layer.

    Is there a custom code that I can use for this?

    Check out this blog:buttons on Question/Score 6 Captivate Slides?-Captivate blog

    Although the question slides, there a button configured to display information. But you need a tip or, since you're on CP8, joint action.

    I'm a little surprised when you say "There is NO option to have this button to act as a trigger to display a text like a rolling caption."? The success of your button action has a long dropdown menu with simple actions possible, one of them is show. You're supposed to hide this legend of text (or shape with text) and make it visible with the Show command. If you want to toggle the button to act like a button, you'll need a user variables and a conditional advanced or shared action. Something like this:

    IF v_visib equals 0

    See the Tx_n

    Toggle v_visib

    ON THE OTHER

    Hide Tx_n

    Toggle v_visib

    v_visib is a user variable, a Boolean value that has two possible rated: 0 means that the object is invisible, 1 that it is visible. I would prefer a shared action here, with only Tx_n (the legend of text) as a parameter. You can override this setting by any object or group, when you use an instance of this action. It is one of the actions in my shared library of actions.

  • Reset button for all the chronologies of symbol on the stage

    I have several slideshows in my animated document, and I have three buttons at the top of the document that a user can click. Each button calls some slide shows (which are symbols) and brings them to animate using sym.getComposition () .getStage ().getSymbol("mySymbol").play. It works fine, but as soon as I click a different button, the symbols that the other button activated keep animating.

    I know that I can reset the timelines for symbols referencing each slide show by name individually, but y at - it an easier way? I have so many symbols!

    Thanks in advance!

    Erik

    You can also use getChildSymbols(), which gives you a table of references of the symbols of your scene.  Here is a brief sample, which uses the same code of sample of the API to animate:

    https://creative.Adobe.com/share/b2c57450-5bc6-41d7-ACF6-8aac9a84456a

    This code would be a bit more generic and would not involve to maintain a list of objects.  Please note that this applies only to symbols that are currently on your scene, dynamically declared or not.

    I hope this helps!

    -Elaine

  • How to remove all symbols within a symbol on the stage?

    Hi all

    I have this code located on the close button click:

    var childSymbols = sym.getSymbol("mc_InnerStage").getChildSymbols ();

    Alert (childSymbols.Length);

    for (var i = 0; i < childSymbols.length; i ++) {}

    childSymbols [i] .deleteSymbol ();

    }

    SYM. Stop ("Start");

    which could remove all the symbols inside the symbol (mc_InnerStage), but it does not everyone knows what is wrong with this code? I had alerted the number of children, but it keep giving me 0 any number of symbols in the symbol of the mother there? ! can someone help me please?

    Thanks in advance.

    and I forgot to say that you can remove them by using this line:

    SYM. $(". Name of your class here"). remove();

    Zaxist

  • Count the number of symbols on the stage

    It is possible to count the number of symbol on the composition and store it in a variable?

    symbolCount = 0;

    var childSymbols = sym.getChildSymbols (); for (var i = 0; i)

    symbolCount ++;

    Alert (symbolCount);

    Add to the compositionReady, loops through the child symbols and alerts and how they are.

  • Find the number of symbols on the stage

    Hello

    I'm trying to find out how much of symbols with a certain naming convention is on the scene. The name of these symbols are incremented by 1, if for example I have symbols "drag_1" & "drag_2" currently on the stage and I want to go back to how many symbols "drag_" is on the scene. This can change depending on how much of these symbols that the user adds to the scene.

    I have included some pseudo-code below to help understand what I'm talking about!

    for (var i = 0; i < 100; i ++) {}

    If (SYMBOL_ON_STAGE = "drag_" + i) {}

    number_of_symbols = number_of_symbols + 1

    }

    }

    Thanks for any help!

    You can use

    var childSymbols = sym.getChildSymbols ();

    var num = 0

    for (var i = 0; i)<>

    var reg = new RegExp(/Stage_drag_*/);

    {if (Reg.test (childSymbols [i] .getSymbolElementNode (USER.USER)))}

    NUM ++;

    }

    }

    Alert (num);

  • After the separate file .fla code do not see my objects on the stage.

    I have the .fla file. There, in the library, I have 3 film clips, cockroach0, cockroach1, cockroach2. I want to show they randomly on the stage on the .swf file.

    Labour Code:

    var classNames:Array = ["cockroach0", "cockroach1", "cockroach3"];
                   var len:int = classNames.length;
                   var cockRoachList:Array = [];
                   var ClassRef:Class;
                    
                   for (var i:int = 0; i < len ; i++) {
                         ClassRef = Class(getDefinitionByName(classNames[i]));
                         cockRoachList[i] = new ClassRef();
                         addChild(cockRoachList[i]);
                   }
                   
                   var currentCockRoach:MovieClip;
                   for (var ii:int = 0; ii < len ; ii++) {
                         currentCockRoach = cockRoachList[ii];
                         currentCockRoach.x = Math.random() * (stage.stageWidth - currentCockRoach.width);
                         currentCockRoach.y = Math.random() * (stage.stageHeight - currentCockRoach.height);
                   }
    

    But when I try to separate the code from the .fla to .as I have problems.

    I see the error:

    TypeError: Error #1009: cannot access a property or method of a null object reference.
    code: KillCockRoach()
    at cockroach0()
    code: KillCockRoach / showCockRoach)
    code: KillCockRoach()

    The attached photo, maybe this would help you to undestand...

    each class of cockroach extends flash.display.MovieClip

  • Single user lock screen requires now click here to see the password field; what setting or API controls this?

    At first, this may seem like only an issue with a third-party application, but the question applies to Windows in general. I am a software developer and experienced Windows user, but I can't seem to find no answer on what's going on.

    Normally lock on Windows 7 Professional 64-bit (when you press Windows + L for example) display an icon of great user, the user name, the word "locked" and a password field and a "Change user" button. But after installing the client VPN Junos Pulse , my lock screen changes: it is a tiny user icon and no password field. I have to click the tiny user icon before a password field is displayed:

    This situation is not limited to the Junos Pulse. I found the people ask this question after installing programs face connection. Others have had the same problem. And still others have had this problem - more recently. But no one can provide no answer to which change the login screen.

    If I uninstall Junos Pulse login screen returns to normal. But the question is not about Junos Pulse; I want to know what Windows setting or API call causes this situation. What could be the Junos Pulse that would lead even this behavior?

    Yes, I already checked that there is only one user account after the installation of Junos Pulse, and the guest account is disabled.

    Junos Pulse setting changed to change the behavior of my lock screen, and how to make a lock screen normal return that immediately presents the password field without requiring an additional click?

    Hi Garret

    Your message is addressed in the discussions on these forums of Community consumers Microsoft. It is better suited for the MSDN Developer audience. Go to the links below and ask your question in the appropriate forum.

    MSDN forums: Index

    http://social.msdn.Microsoft.com/forums/en-us/categories

    MSDN forums:

    http://social.msdn.Microsoft.com/forums/en-us/home#category=usingforums&filter=AllTypes&sort=lastpostdesc&content=content

    Concerning

  • HTMLChecker guard is placing ads on Web sites and receive click takes me to another link of the ad how to remove?

    pop up ads and links to other sites are popping up on every page, I can't complete a simple task without going to the other Web site first. I tried remove the program but can not find it listed anywhere on the characteristics of programs in the control panel.
    The program is decreasing my productivity until most of the transactions now take twice. Very frustrating

    It may be a browser extension, you can withdraw within Firefox. Try this:

    Disable all non-essential or unrecognized extensions on page modules. Either:

    • CTRL + SHIFT + a
    • Firefox orange (or the Tools menu) button > Add ons

    In the left column, click Extensions. Then, when in doubt, turn off. (Or if it should obviously go, use remove.)

    Typically, a link will appear above at least an extension disabled to restart Firefox. You can complete your work on the tab and click one of the links in the last step.

    What is fix?

  • Animate a symbol on the stage using a JS function

    Lets say I want to animate SampleSymbol to the right, the following code is placed in the CLICK trigger for a button, my understanding is the best way to liven things up is to write JS functions in Action panels, is - this?

    The following line fails animate the SampleSymbol placed on stage...

    moveToRight();

    function moveToRight() {}

    SYM. $("SampleSymbol").style.left = (sym. $("SampleSymbol").style.left + 1) + 'px ';

    This code supposed to move the object 1px right

    setTimeout(moveToRight,20); / / call function() in 20 msec

    }

    Hi, check-

    In fact, I would say that the best practice is to animate on the timeline and code to call the animations of the reserve.  Personally, I only animate with code, when there is absolutely no other way to get what I want.  In regards to your code, some of the syntax is incorrect, but instead of doing things in this way, you can use jQuery to animation method of:

    SYM. $("SampleSymbol") .animate ({left: ' 20px +='}, 20);

    http://API.jQuery.com/animate/

    -Elaine

  • call a symbol on the stage of the nested symbol

    sym.getComposition () .getStage ().getSymbol("mySymbol").hide ();

    and it does not work!

    What I am doing wrong?

    Try this:

    sym.getComposition () .getStage ().$("mySymbol").hide ();

Maybe you are looking for