animation inside the symbol depends on the click counts

Hello

for example, there is a hammer striking the rock

If I clicked 1 time - cracked rock (animation inside the symbol)

twice - destroyed semi

Triple - completely destroyed

I have tryied this but it plays all the animations at the same time:

-Make stop() end of each animation

-by clicking on the symbol:

var i = 0

i ++

{if(i==1)}

Play('1000')

}

i ++

{if(i==2)}

Play('2000')

}

and so on

but he plays any animation

where is the error? =)

Hello

Here's a demo file: incrementingButtons.zip - Box

I use a global variable. I put it with the Panel of compositionReady: sym.setVariable ("i", 0). You can also use the creationComplete Panel.

Then I increment in a panel of the event (for example: click): sym.setVariable ('i', sym.getVariable ("i") + 1);

Tags: Edge Animate

Similar Questions

  • Animation inside the movie clip symbols in the part "header" of the web site

    Question: should I do a header animation of the website. seconds, it happens and is stopped with action script command stop(); but I need an elenment inside the flash header continue to animate like here: http://ves-lab.ru/ a scalable logo in the upper left corner of the header. If somewhere the answer has already been written - someone write a link to this source. Thank you.

    Make this entity that continues to animate a separate with its own animation movieClip.

  • Q on the buttons and animations inside the mc

    OK, it's a long question - sorry (and I'm new to FLASH if it sounds stupid).

    I'm creating a simple "tamagotchi". It is a cute creature onstage, it has 4 buttons next to it (power, sleep, play and 'cute')

    So, I created a long chronology of 15 images in the main stage. To frame 1, I had 'cute', frame 5 I got 'food', frame 10 I 'play' and frame 15 I had 'sleep '.

    I accumulate animation in this way: each of the images (1, 5, 10, 15) has a movieclip with an animation inside - for example "play" to the 10 member contains a movieclip and inside this movieclip I have an animation that I want to play.

    But but... the buttons... If I put the buttons inside the animation and push 'play' it works fine, but I can't get out of this animation and more to for example "food".

    If I put the buttons on the main stage, it will play only 10-15 image when I press 'play', because I can't understand that he must go inside the movieclip and it play.

    So the main question: is there a function saying "touches you - get out of this animation in the main stage and other animation and play that!"?

    Or y at - it an easier way to do this? I tried to copy all the layers of an animation and paste it into the main stage, but when I do it this way, items in layers appear randomly on the stage, which means that I have to put it all together again. AND it will be a very long timeline if I do it this way.

    I hope I make sense?

    It is all back now, so I can see things from new... from what I have just described, your code frame 1 will be replaced by...

    button_1.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_1);

    function fl_ClickToGoToAndPlayFromFrame_1(event:MouseEvent):void
    {
    gotoAndStop ("nuttet");
    }

    'Play' button

    leg_btn.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);

    function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void
    {
    gotoAndStop ("leg");
    }

    Power button

    mad_btn.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_10);

    function fl_ClickToGoToAndPlayFromFrame_10(event:MouseEvent):void
    {
    gotoAndStop ("mad");
    }

    and if your movieclips have a stop at their first image, then these images you would order for the involved movieclip, meaning the 5 frame you order... leg.play ();

  • How to create an animated inside the glass globe image

    1. I have managed to place an image inside a glass globe animated, kind of like the bouncing ball. I tried to enlarge the drawing area, but when I play it in my browser it says not enough memory. My little brother built me a new office, I'm picking up the next time I'm in town. If all goes well, that will take care of this issue.

    2. I am wanting to create a story where the camera stays put on the ball and the animation is the character of comics by itself (perhaps typing on glass to come out).

    3. I will try adding text to #1 above "Help".

    If I run the. GIF in my browser and copy the address, it's safe to stick online?

    Lucie

    For anyone to see, the file must be uploaded on a site. No one can see the file on your computer that your firewall protects your computer. If you allow access someone for a malicious purpose could adversely affect your computer.

    Have a character on the ball is considered to be advanced animation. It can be done using the deformation of the puppet, be aware that it may take time and practice to make look it good.

    Rather than increase the canvas use the zoom of the camera or closer to the camera at objects. Then this will not affect the memory as would change the canvas.

  • Need help on the button for the click count thing!

    Right now I have a button that whenever I click on it, it adds 30 seconds to a countdown.  I also want the button followed by clicks so that whenever you click on it it ajoute.01 to a total which starts at 0.   That's what I got from the code so far...

    bidbutton.addEventListener (MouseEvent.CLICK, addTim e);

    function addTime (e:MouseEvent): void {}
    TOTAL_TIME += 30;
    }

    Any help would be appreciated!

    It could be as simple as what is below according to your design...

    clicks: the number of var = 0;

    bidbutton.addEventListener (MouseEvent.CLICK, addTim e);

    function addTime (e:MouseEvent): void {}
    TOTAL_TIME += 30;

    Click on + = 0.01;
    }

  • Animation time during the click on, but after that he used to go next frame please help.

    I make a game of sniper where you just look in the window and pull the right person, but I can't get the coding to work or it just won't go to the next section if the guy is dead. I have a lot of false people on the screen and only does anything. The main guy is a movieclip with a button inside that. In the movieclip, I made an animation and the button code that I put the code

    on {(press)

    Play();

    }

    that part works as well when I click on it (or him some snipe) he plays the animation I did head burst, but I want to make sure after he plays the animation to the next section where I did another level.  Ive tried several different codes in different places, but none of them brings me to the next section about that they play only the animation. The code that I thought I should use is

    on {(press)

    gotoAndStop (3);

    }

    I know that the code is fair and would put me in the frame 3 because I used this code on my splash screen, to have a framework of instruction and it works Ive also made the platform games using stop to bring me to the next level. Ive also tried to make a new scene and have goto, but it won't work.  Someone please help I would really appreciate it.

    At the end of the head popping animation (inside the movieclip) on the main timeline, add:

    _root.gotoAndStop (3);

    It's the 3 is the next level framework.

  • Game animation that happens inside the symbol_2 by clicking symbol_1 located at the stadium

    So basically I want exactly what the title says. I have the stage and two symbols... each symbols contain their own items. Symbol_1 has some static elements that act as buttons and Symbol_2 has images that are animated... at the beginning of each animation of each item, I put a tag (e.g. image1_start, image2_start etc.). And I want that when I click on one of the buttons that are sittuated in Symbol_1 to start an animation of a specific label that happens inside the Symbol_2.How should I do?... If they are all in the same timeline, it's simple by using the sym.play("image1_start") command, but this isn't really what I'm looking for. I hope that I've been pretty accurate. THANK YOU IN ADVANCE!

    P.S.Mostly is how I can do several different timelines to communicate properly.

    Enter the code to run when the composition is fully charged here

    {sym.getSymbol('symbol_1').$('btn1').click (function ()}

    sym.getSymbol('symbol_2').play ('image1_start');

    });

    {sym.getSymbol('symbol_1').$('btn2').click (function ()}

    sym.getSymbol('symbol_2').play ('image2_start');

    });

    {sym.getSymbol('symbol_1').$('btn3').click (function ()}

    sym.getSymbol('symbol_2').play ('image3_start');

    });

    Here is the example:

    https://www.box.com/s/dcpe4xvdu6h9391gy5yd

  • Select the event inside the nested symbol does not

    It's actually based on a previous thread located here: http://forums.Adobe.com/message/5596353#5596353

    I thought about adding to this thread, but in many ways it deserves it's own separate discussion.

    I used the Zaxist examples and AMULI put in place successful. On a navigation bar located directly in the root.

    Now, the question is the same thing with a menu that is nested inside a symbol.

    In my example, I have a button that when you click on anime a symbol of navigation bar down. This works. Also, the LINK button retains its background color set to black until the user clicks another button in the main navigation bar. OK, he has no other button in this example. So just pretend and believe me, it works.

    Now in the nested clip, there is a similar function I Illustrazione in the compositionReady. Then I added my actions to each of the four buttons inside the symbol navlink nested. The rollover/rollover effects work well. But the click event shows an error. It is basically the same click event in the navigation bar on the root, which does not have an error.

    My code inside the compositionReady is;

    Reset the State of each button

    buttons = {}

    Reset: function() {}

    sym.getSymbol("btnLink").$("back").css ({"opacity": "0"})

    }

    }

    which button?  Zero means no!

    We set this variable to get know e what button

    WB = 0;

    Reset each State buttons Sub

    buttonsub = {}

    Reset: function() {}

    sym.getSymbol("btnCommunication").$("back").css ({"opacity": "0"})

    sym.getSymbol("btnIndividuality").$("back").css ({"opacity": "0"})

    sym.getSymbol("btnCreativity").$("back").css ({"opacity": "0"})

    sym.getSymbol("btnInclusivity").$("back").css ({"opacity": "0"})

    }

    }

    which button?  Zero means no!

    We set this variable to get know e what sub button

    SB = 0;


    I would like to only it where there are two functions. One for all main buttons and the other for all the buttons of the child. This way I can have two buttons stuck to the hover effect when you click them in order. If all goes well, that makes some sense.

    Here is my event click in the button "btnIndividuality" inside the symbol navLink nested:

    buttonsub. Reset();

    sym.getSymbol("btnIndividuality").$("back").css ({opacity: 1})

    SB = 1;

    The other three buttons are basically the same.

    So I tried a number of ideas. Especially goes directly from the stage and drilling down into JQuery. Nope.

    So the Firebug error is 'Javascript error in the event handler. Type of event = 162 item line ' we of edge.2.0.0.min.js. It's this line:

    function (a) {if (a) {if(!this.aSymbolInstances) this.aSymbolInstances = []; this.aSymbolInstances.push (a.getSymbolElement ())}}; Y = Function (a, b, c) {function f (c, b) {if (b.length > = 2 & & typeof b [0] = 'object' & & typeof b [1] = 'object' & & b [1] .Guy! == "onError") {var e; e = d.Event ("onError"); if (g) e.compId = g.getComposition () .compId; e.originalEvent = b [1]; d (doc indicator) .triggerHandler (e)} window.console.log ("Javascript error in the event handler.}} Type of event = "(+a)} var e = this [b [0]], g;" = If (typeof e = "function") if (b.slice (1), a = 'element') return function() {var;

    Why would I get this here and not on the root? What is the correct path to make it all work? If close, but not home right now.

    Files are located in:

    https://www.dropbox.com/s/xlgfeeyam9hyuf3/nested.zip

    Oops! Sorry, without my knowledge, that it was published before it is completed

    (3) thus, using Firebug, you get this when you trigger a click event

    In other words, sym.getSymbol ("btnCommunication"), the first statement in your buttonsub.reset function fails.

    In your mind, sym points to the instance of navLink, parent of the instance of btnCommunication.

    But the buttonsub.reset function is defined in the compositionReady event handler, so when it runs sym points until the symbol of the scene, which has no child symbol instance named btnCommunication. Where the bug.

    Therefore, the context of symbol should be past to the function as a parameter. Set it like this:

    buttonsub = {}

    reset function: ( symClick)

    {

    symClick.getSymbol("btnCommunication").$("back").css ({"opacity": "0"})

    And call it like this:

    buttonsub. Reset ( sym);

    In other words, the formal parameter symClick will receive as the effective setting, this actually sym sym pointing to the instance of navLink.

    Gil

    .

  • Animate the edge - how to create a hyperlink inside a symbol?

    Hello

    I am facing a problem to create a hyperlink inside symbols.

    For example - the main symbol name is "left-nav '.

    Inside of the symbol of the "left-nav', I created 3 symbols, what is" menu-1', ' menu-2' & ' menu-3'.»»» Inside of the ' menu-1', ' menu-2' & ' menu-3' symbols, I created animation.»»»

    But inside the Menu-2 & the symbol menu-3 frame, I put stop action is "sym.stop ()";

    Here, I created a button inside the symbol menu-1, when I click on this button, it should play animation menu-2.

    It is very important to me. Help, please...

    Thanks and greetings

    E. Kumar Muduli

    Use this code if you want to add to an object/button inside a symbol to play the label on the timeline

    sym.getComposition () .getStage () .play ("spinBlock");

    Use this code if you want to add to the object/button inside a symbol to control another symbol on the stage.

    sym.getComposition () .getStage ().getSymbol("star").play ();

    Use this code if you want to add to an object/button inside a symbol to control a symbol within a symbol

    sym.getComposition () .getStage ().getSymbol("starB").getSymbol ("starCent er") .play ();

  • Hide/show element at the click of another symbol

    Hello

    I want to hide an element by click. The item that is clicked is inside another symbol, which one that should be hidden.

    Please tell me how I can handle this.

    Thank you very much

    // Get the symbol element "kitten_1" and hide the element "kitten_paw"
    sym.getComposition().getStage().getSymbol("kitten_1").$("kitten_paw").hide();

  • How to add an event handler (to the click or mouseover) symbol on the timeline of the scene

    Is it possible to add an event handler on the main stage anime who controls a symbol?  Thus, for example, if you had several symbols on the stage, each with their own unique name, then on the main stage you wanted to add a list of event handlers specific to these symbols to affect a change when you interacted with this symbol.

    For example when you click on the symbol a few things happen here...

    (1) for (name of the symbol) click starts the animation of the symbol

    2) roll (symbol name) the symbol animation stops

    (3) the symbols background image is set on the main timeline.

    All this can be done easily on the symbol itself, but those is possible since the main timeline (scene).  Anyone know a solution?

    Yes

    1. Add jquery min CDN (https://code.jquery.com/jquery-2.1.1.min.js) to the script library (from the "Add js to URL" option.

    2. in the compositionReady event handler try something like that - the "many event handlers section" located here: http://learn.jquery.com/events/handling-events/

    Code example

    item = sym.$("btn");

    Element.on ({}

    MouseEnter: function() {}

    Do something

    Alert ("gliding on a div");

    },

    MouseLeave: function() {}

    Do something

    Alert ("the mouse has left a div");

    },

    click on: function() {}

    Do something

    Alert ("clicked on a div");

    }

    });

    end of the sample code

    A way to do among many others. In the use above cases pay special attention to the point of separation between the "chained" events

    HTH

    Darrell

  • How to return to the main stage from inside a symbol

    Greetings,

    I'm going absolutely crazy trying to get back to the main stage from inside a symbol.

    To open the symbol on a click of the main stage...

    var mySymbolObject = sym.createChildSymbol ("practiceScene", "Stage");

    It works, I get the symbol

    To return to the main stage from within the symbol on a click...

    sym.getComposition () .getStage () .play () [0]; or sym.getComposition () .getStage () .play ('home');

    This does NOT work, I can't get the symbol.

    Help, please!

    R

    Obliously your symbols are hiding the main timeline. If you put this in your steps, click on events, it will remove the symbols and go to home label.

    I put a square home and hide it when not on the House. Thus, it shows only there.

    sym.getComposition () .getStage () .stop ('home');

    sym.deleteSymbol ();

    So basically, you will need to remove the symbols and recreate them when you need.

    But I could be wrong.

    Here is your file with this correction: I once on home and the other at the opening.

    sym.getComposition () .getStage () .stop ('open');

    sym.deleteSymbol ();

    https://app.box.com/s/aj0zapp11mc98gz3ghtj

  • Insert text field nested inside the symbol of JQuery .html

    This is one of those, "it must be so simple... of course, is not" question.

    Got a symbol nested. A fairly simple. Inside of the symbol is a background rectangle and a text field. When I click a button, it must insert the HTML code, I give him the click event.

    Now at first I did using only the text field per itself. No nesting. This is the code:

    SYM. $("copie") .html ("Edge Rocks!");

    OK, success! The text is loaded correctly.

    Now let's insert this text inside a symbol field. And we'll call this symbol "content".

    Now, I'm trying...

    SYM. $("contenu").$("copy").html ("new text");

    Result? Nothing.

    Tried to use the scene instead of sym and even added a scene var = sym.getComposition () .getStage () before. Nope.

    Yes, they do not easily allow. So what is the solution?

    Here is my sample file.

    https://www.dropbox.com/s/5n1ehhsp7r3rbt6/text.zip?m

    BTW, he ran in the Firebug console. No errors.

    OK, I found it! This is it!

    sym.getComposition () .getStage ().getSymbol('content').$('copy').html ("text here");

  • Get the ID of the clicked symbol

    Problem: When you click on the buttons of the Menu I want to get the ID of the Clicked symbol (by ID, I mean the name that I entered in the title area on angle for each symbol top left).

    The attempt failed:

    Find buttons by their class "btn".

    $('.btn').click (function () {}

    Window.Location = "http:/"+ (this) sym.lookupSelector + ".html"

    });

    undefined

    I tried this.getSymbolElement (.attr('id'))

    Eception TypeError: Object # < HTMLDivElement > has no method 'getSymbolElement '.

    Confusion: What confuses me here, it's that () refers to a div element while I was expecting a symbol object. I think it's hard for me to understand the relationship between DIV & symbol coming from flash where the symbols are the only creatures of the object to process. In other areas, I have a problem scaling and etc., targeting the div instead of the symbol I want.

    Example: Like [event.target.name] in ActionScript, I want to detect the name of the symbol who listened to the Click event.

    The problem is that the ID is actually defined depending on where you are in your structure. Thus on the level of the scene is always "Stage_xxxxxx".

    I use usually just a substring method to extract out:

    $('.btn').click (function () {}

    If it is in a symbol called "buttons" on the stage the ID will be like Stage_buttons_xxxxx

    ID var = $(this).attr('id').substring (14); 14 = "Stage_buttons_."

    Window.Location ="http://" + id + ".html";

    });

    The other (better) option is to assign a parameter on the button object, so you don't need to make any kind of magic, then you can just call $(this) .attr ('whatever_you_want');

  • Accessible inside the container Adaptive symbol?

    Hello.

    I created an Adaptive container on my main stage. He calls 2 symbols "layout1200" and "layout800".

    These symbols have fairly basic functionality, and that works inside the symbol.

    So drop the provision of symbols directly on the stage, the feature works very well.

    But call the symbols of layout through the Adaptive container, it no longer works.

    I have even converted the Adaptive container into a symbol, calling first of all of the symbols.

    So I'm pretty lost at this point.

    I hope someone can help me.

    Link to archived files work:

    https://DL.dropbox.com/u/2093612/adaptive_sensible.zip

    Link to doc html:

    https://DL.dropbox.com/u/2093612/adaptive_sensible/Adaptive%20and%20Sensible.html

    Thus,.

    Here's a first correction: attached file (Adaptive and Sensible2.an).

    Was what you expected? (I mean: action click)

Maybe you are looking for

  • Contact technical support in Belarus

    Hello I live in Belarus now and trying to get the support of Apple for a few days. Any time, I try to get help, I get redirected to the page where only the telephone communication is available. Belarus still isn't in the list and good old ticket syst

  • &lt; published by host &gt;

    In one of my posts, I see this tag and my message has been modified. Apple plays the moderators here? My post was not even anything worth of censorship! though he is with someone else?

  • Equium A200-1v0 powering on after it has been closed

    When I turned off my laptop and try to restart it it won't come, but if I leave it for a low it starts as usualCan someone tell me what may be the problem?

  • HP Pavilion changeable: need help determine which laptop to buy

    I was hoping that somoene could help me determine which laptop is the best for me I have a powerful desktop computer, so I have no need for anything either super madly fancey-shmancyI really just want something that I can take with me on a business t

  • Fan cooling for HP Pavilion dv7-6135dx

    Now that my cooling fan is broken - it makes too much noise. I took my laptop to the it Department, and they said that this current fan needs to be replaced by a new. But they could not order it. Is it possible to buy a new fan cooling for my compute