On mouseclick logic for timeline animation

So there is a movieclip that goes through certain stages in a Breaking,BrokenLooping,Fixing,brokenPermenant animation cycle
I'm just starting to make the actionscript for it but I'm not sure how to go about it, or if the logic is sound. I am a bit new to actionscript
i assume i can make a function like this
Quote: 
  function myButtonAction(eventObject:MouseEvent)
trace("you clicked on the button ");
myButton.addEventListener(MouseEvent.CLICK, myButtonAction); 
where myButton is the instance of a button movieclip ontop of the movieclip
The general idea is that randomly things will break and stick in a broken loop, then you have to start taping the screen to repair it until fixed or else it permanently breaks
*note that the fixing animation cycle is backwards so that positive on the timeline is it slowly breaking - you tap to reverse frames and "repair"
the logic goes like this (at the start of the looping broken animation)
on user input (mouseclick)
-goto frame (xx) (end of fixing animation)
-stop() for 1 second  (stopping so it doesnt just enter next animation cycle)
.....     -if user input yes (tap/click)
.........          -go back one frame [currentframe -1]
.........          -stop() for 0.100 seconds then play()
.........          - or if time between taps is less than 0.100, then play
.....     -if user input is no (no tap/click)
.........          -play()
I'm not sure if that handles all the possibilities but i guess ill find out as i go.
whats the best way to write what I want to happen

Thanks for the advice, just a few questions though
*there are 6 animations in total so would I start each of these functions from mouse events on those individual buttons?
*Would it be a good idea to use enter_frame events to track where the timeline is and to control other things, or can i just use the mouse events on its own to tell the animation to go back 2 frames on a click etc..
*also since i'm relativly new at actionscript I'm having trouble with my document class, maybe im entering functions wrong or just not understanding how i need to write actionscript
but i am unsure where to put my new functions and listeners and such.
currently this is the line i want to put in
levelMC.childmc.childmc.childmc.button1.addEventListener(MouseEvent.CLICK, animationcycle);
        public function animationcycle(event:MouseEvent):void
                trace("when i click on the button this text should show up")
I would assume i can put it in here
Document class
package
     Imports
     public class main extends movieclip
           public function main()
           caching bitmaps and other things i want done on startup
          eventlistener called Listener
          public function Listener ()
               trace("various lines of code");
This is where i assume I can just drop
          levelMC.childmc.childmc.childmc.button1.addEventListener(MouseEvent.CLICK, animationcycle);
          public function animationcycle(event:MouseEvent):void
                trace("when i click on button1 this text should show up")
When I do that I'm getting a acess of undefined propery "levelMC" and "animationcycle"

Similar Messages

  • Best Codec for exporting animations with alpha channel from FCP timeline

    Whats the best codec for exporting animations (hopefully using loseless compression) that will retain alpha channel, and use the current sequence settings for fps and size?
    Currently Im exporting image sequences, but I'd prefer a wrapper.. I don't know much about the 'Animation' export codec.. I did notice that set to current size had some funky value of 753x450 or something.. instead of my current project size of 1920x1080...
    Anyhow.. Just seeing what others are doing..
    basically Im reading out some titles that I'll end up dropping over video later.. but since they render out so slowly (**** lower 3rds is slow) Im trying to get a jump on the process..
    Tx..

    PNG should do it. I think PNG is lossless (that's what they say, anyway). But realistically, if you use PNG, Animation, or JPG2000 set on highest quality, I'd dare you to tell a difference.
    I use PNG because it's supposedly lossless, renders twice as fast as Animation in a FCP timeline, and is usually about half the size.
    If you use "Export Using Quicktime Conversion", you will need to check all of the settings manually to make sure they match your sequence settings. This is always true, no matter what codec you use.
    If that sounds risky, your other option is to go into your sequence settings and change the codec to the one you want to render to (this will probably turn your whole timeline red), and then choose Export -> Quicktime movie.

  • Best setting for gif animations

    what is the optimal setting for animated gifs

    Depends on your style and your training as an animator, and
    what your project goals are: straight animation? interactivity?
    e-cards? Traditional animators used to drawing frame-by-frame with
    exposure sheets will feel more comfortable with Toon Boom Studio
    (www.toonboom.com). It has far superior drawing tools and color
    pallette management and timeline management than Flash. But if
    you're used to Illustrator, that may make no difference to you. It
    appears that the upcoming Flash CS4 will narrow the gap, as the
    interface appears to include enhancements that will be more
    familiar to traditional animators, not to mention IK, which Toon
    Boom Studio doesn't have (the highly expensive Toon Boom Solo does
    have it).
    That said, I think Flash is a great program for creating
    cartoon animation. You may not think you're interested in
    ActionScript programming at this point. I use Flash mainly for
    cartoon animation and I resisted ActionScript for a few years. But
    once you get used to Flash as an animation tool, and then decide to
    dip your little toe into ActionScript, you'll find out what an
    astounding tool it is, even for traditional animation, enabling you
    to do things impossible in more traditional-oriented programs. Plus
    now Flash and Illustrator are fairly well integrated, so you'll be
    able to import and export between the two.
    On balance, I'd go for Flash.

  • Converting timeline animations into .swf??

    Hello all,
    In CS3 I was able to export animations into .SWF files but with CS6 I cant seem to find out how to do this?  The only option is .MP4 via File>Export>Render Video but thats no good to me.  I've searched high and low for this answer but have come up with nothing!
    Any suggestions?  It needs to be SWF.  I've tried to convert MP4 into SWF using a 3rd party software but the quality was shocking and I'm unsure what settings to use for the original animation and also for the converting!  Doing it with CS6 is much prefered if possible!
    Thanks in advance

    To my knowledge, you cannot do this in Photoshop CS6. Check out this help document, Creating Timeline Animation (Photoshop Extended).
    Do you have Flash or After Effects?
    Cheers,
    Michael

  • Flash CS6 as3 Navigate to URL stops timeline animation!

    Hello
    I'm hoping someone can help me out! I'm quite new to flash but slowly getting the hang of it. I'm trying to make an interactive banner using jpegs converted to buttons etc with type, all animated. I've got separate layers for everything including mask layers and actions. I just want to navigate on a top layer which is invisible to take the user to a new URL. Everything is working great until I put more than one URL link in the code, as soon as I do the whole banner animation stops!!
    If someone could suggest a few ideas it would be much appreciated as I'm all out?!
    Many thanks,
    here's the code:
    import flash.events.MouseEvent;
    btn1.addEventListener(MouseEvent.CLICK, btn1Click_1);
    btn2.addEventListener(MouseEvent.CLICK, btn2Click_2);
    function btn1Click_1(event: MouseEvent): void
      navigateToURL(new URLRequest("http://www.google.com"), "_self");
    function btn2Click_2(event:MouseEvent):void
      navigateToURL(new URLRequest("http://www.youtube.com"), "_self");
    addEventListener(MouseEvent.MOUSE_OVER, mo);
    function mo (event:MouseEvent):void
    event.currentTarget.stop();
    function mo2 (event:MouseEvent):void
    event.currentTarget.play();
    } addEventListener(MouseEvent.MOUSE_OUT, mo2);

    Thanks Ned and moccamaximum for the replies.
    The last bit of code does apply to the whole timeline as it stops the animation with a Mouse Over/Roll Over. Taking this away has no effect on the animation in the timeline. The only thing that seems to stop the timeline animation is the second button URL request!
    btn2.addEventListener(MouseEvent.CLICK, btn2Click_2);
    and:
    function btn2Click_2(event:MouseEvent):void
      navigateToURL(new URLRequest("http://www.youtube.com"), "_self");
    Works perfectly without this command. I don't get it!

  • Best practice for optimising animation / stage bitmaps

    Hi everyone and a happy new year.
    I am currently working on a prototype app for the iPad which involves some well known (UK) characters from childrens TV.
    My usual job is to build interactive online magazines which are essentially very simple Flash games, and I mean really simple. The artwork is provided to me as hi res jpeg images and I then convert them to 72dpi and add them to the stage as per the design given to me.There is generally between 3-10 user interactions that trigger an animation. I use Tweener for the animations and they are either a popup that slides on and or off the stage.or a character is animated around the stage a bit.
    This obviously works fine in a browser but on the iPad it really struggles with the animation, the framerate drops by around 75% and sometimes freezes for several seconds. I knew not to expect high performance animation sequences and high end game play using the packager for iPhone, but I did expect simple animations not to be a problem.
    Does anyone have any suggestions on optimisation? Is it perhaps the use of Tweener that is the problem? I am really hoping to get some good results here.
    Thanks for any help.

    The secret to success when using stream audio to sync timeline animation is to have the items load ahead of when they are needed. For example, if several new items are to appear at frame 100, and then immediately animate in some way, the audio will cause the frames where they animate to be skipped, because it takes so long for the items to load and get onto the GPU.
    So, have those items appear on the stage at perhaps frame 80, and concealed in some way so that you don't notice them. They have to overlap the stage by at least a pixel, otherwise they won't really load onto the GPU. Then at frame 100 move them into their correct positions, and the animation should go as intended.
    When doing this, make sure the items are remaining in the same layer, have the same instance name, and there are no gaps in the timeline.

  • Replay Button for SWF animation

    Situation: Imported animated SWF file into slide. Using
    Captivate Back and Next buttons to control navigation. I want to
    add a "Replay Demo" button for the animation SWF file.
    Is this possible through Captivate (or Flash)? I don't want
    the continuous loop animation but do I want the option for a user
    to review animation again if desired.

    I hate it when I post something on a forum and then I
    discover the answer 10 minutes later. Ny your answer I'm guessing
    the Captivate add button fweature with a Jump to slide 1 setting"
    is the answer, right?
    That DID fix the replay issue. Now on to second issue. The
    animation blanks out once it finishes playing. While looking for
    the replay answer yesterday, I noticed a post that said something
    about creating a screen capture of the last slide and insert it on
    the timeline or something... back to searching. Thanks for the
    quick reply.

  • Flash CS6 How to set up pages for an animated app/book for children

    Hi there,
    I'm quite experienced with flash/ middle ground in AS3 for flash player, but would like now to make apps using AIR. I have two questions:
    1 - Could anyone tell me how to create pages for an animated book (such as Alice on the ipad, etc)? 
    • Should I create all pages on the main timeline, in different frames, or should I use a loader for each time the user turns the page? and how to put a "flip" page effect?
    2 - I don't understand how AIR compiles. All the files should be in the library or there is some sort of "root" folder for dynamic download? (for music, pictures, video etc)
    • When you create an app do you put all your objects in the timeline? Instantiate at runtime with ActionScript? how this affects performance?
    Many thanks

    You can't enter sites in a list to make Firefox remember names and passwords for specific sites.
    If the password manager is enabled (remember passwords is check-marked) then Firefox will ask via a pop-up from the key icon that appears on the location bar whether you want to remember that name and password and that name will then appear in the list in the password manager window.
    *http://kb.mozillazine.org/Password_Manager
    *https://support.mozilla.org/kb/make-firefox-remember-usernames-and-passwords
    Websites can use autocomplete=off to prevent Firefox from saving the name and password.<br />
    You can remove autocomplete=off with a bookmarklet to make Firefox save the name and password in such a case.
    *http://kb.mozillazine.org/User_name_and_password_not_remembered

  • Photoshop CC: Layer Merging Behavior with Timeline Animations (Bug?)

    Hello,
    we're working a lot with the Photoshop timeline in our company. After upgrading to Photoshop CC we encountered a behavior that was different with CS6.
    Picture a file with a timeline animation consisting for example of 8 frames, with 8 layers, each layer's visibility exposed on a single frame (layer 1 exposed in frame 1, layer 2 exposed in frame 2 etc) and all other layer not visible.
    In Photoshop CS6, if I were to create a new layer for example in frame 4 of my timeline above layer 4 (which is the only visible layer in this frame) and merged it back down onto layer 4 (by selecting it and pressing the shortcut CTRL+E), the resulting layer inherited all the exposure settings of layer 4, but did contain the merged visual content of layer 4 and the previously new layer above it. This is what I want.
    Now in Photoshop CC, when doing the very same action, the layers are merged and keep the naming of layer 4, however the visibility flag is not inherited properly. The resulting layer is exposed (visible) on all frames in the timeline, whereas it actually should only be exposed in frame 4.
    Also note that the timeline option "New layers visible in all frames" is deactivated. So even if Photoshop treated the merged layer as an actual new layer, it shouldn't expose it's visibility in all other frames.
    The only workaround I've found so far is enabling "unify layer visibility", hiding the layer, then disabling "unify layer visibility" again. This is annoying however, and the entire new behavior seems like a bug to me. Can any of the developers comment on this? Thank you.
    Regards,
    Hannes Drexl

    My only solution so far is to avoid using CC and sticking with CS6.  Thanks Adobe for not letting me enjoy the other great features of the PS version you seem to care about updating and improving.  Since PS is the main reason I even subscribed to creative cloud, it would be nice to at least know this problem is being resolved in the future.

  • Flash Timeline Animation to Edge Animate CC?

    I have a client with an old Flash CS4 Presentation file that uses Forms and Slides and they want to update their presentation to HTML. I am not concerned about the presentation functionality or shell as my developer will create a new one... But, the presentation contains a bunch of timeline animations that demo their product.
    I don't want to export the animations out using the Canvas tag, or as a movie or image sequence.
    I am new to Edge, but I am thinking this is the solution for the animations.
    Is there a way to export/import these Flash timeline animations into Edge? Or even, at the very least, import the assets into Edge?
    Thanks,
    Carol

    What kind of animations do you have? If you have scenes in Flash you can reproduce that in Edge Animate with symbols. For small animations like a runner for example you can create a spritesheet with Flash and use it in Animate. You will have to use the clip tool and display on/off to set it up. Rigth now it takes several tools to go from Flash to Animate but Animate is quite adequate to reproduce what was done in Flash.

  • Convert To Timeline Animation Button doesnt appear.

    Convert To Timeline Animation Button doesnt appear and its driving me crazy.
    in the animation window its in frame animation mode and this button im talking about doesnt appear!.
    Can someone please help me?!.

    Timeline animation is only available for Photoshop Extended. You don't have Extended so you don't get to make timeline animations

  • Best Option for Simple Animations?

    I create cartoons in Illustrator 8.0. I want to move into
    animating simple cartoons i will draw myself. They will range from
    5 seconds to a few minutes. All will have audio.
    I don't want to buy more than i need. What is the minimum
    software program that i need, and what could i use that may cost a
    little more but would be worth it in the long run?
    Thank you so much for your opinion.

    Depends on your style and your training as an animator, and
    what your project goals are: straight animation? interactivity?
    e-cards? Traditional animators used to drawing frame-by-frame with
    exposure sheets will feel more comfortable with Toon Boom Studio
    (www.toonboom.com). It has far superior drawing tools and color
    pallette management and timeline management than Flash. But if
    you're used to Illustrator, that may make no difference to you. It
    appears that the upcoming Flash CS4 will narrow the gap, as the
    interface appears to include enhancements that will be more
    familiar to traditional animators, not to mention IK, which Toon
    Boom Studio doesn't have (the highly expensive Toon Boom Solo does
    have it).
    That said, I think Flash is a great program for creating
    cartoon animation. You may not think you're interested in
    ActionScript programming at this point. I use Flash mainly for
    cartoon animation and I resisted ActionScript for a few years. But
    once you get used to Flash as an animation tool, and then decide to
    dip your little toe into ActionScript, you'll find out what an
    astounding tool it is, even for traditional animation, enabling you
    to do things impossible in more traditional-oriented programs. Plus
    now Flash and Illustrator are fairly well integrated, so you'll be
    able to import and export between the two.
    On balance, I'd go for Flash.

  • Timeline animation events

    Hello Forum
    I learning how to use Flex Builder 3 to build a as3 project.
    I prepared a timeline into animation in Flash CS4 which I've exported as a .swc file.
    What options do I have to gain access to the timeline animation?  I'd like to know when the intro animation has finished playing for example...  What kind of events do I have to register to that would listen to manually created timeline animations?
    Thanks for guiding me through this adventure...
    sk

    Thank you Justin.  That's very helpful.  The class looks interesting.  I started  using it.  So far so good.
    The onEnterFrame event could work as well.  It seems like a lot of unnecessary overhead though...
    Thank you.
    sk

  • Logic for carry forward of previous stock to current period stock.

    Hi Experts,
    Client is using already MC.9 for see the stock analysis report, however as per there requirement we are exploring BOM as well as fetching quantity from table level as well. in my report I am experiencing  difficulty to carry forward previous period closing stock quantity to current period stock quantiy, if there is no received for current period, however the same is happens in MC.9
    Could any one tell me what is the logic behind MC.9 which is do carry forward previous period closing  stock to current period stock quantity in report.
    As per the requirement I am using S031, S032,S033, however unable to get logic for carry forward the previous month stock quantity to current month.
    have a requirement of creating a report of showing material stock period wise for each plant in below mention format.
    Header 1
    Header 2
    Header 3
    Header 4
    LFGJA/LFMON
    ROH (MT)
    HALB (MT)
    FERT (MT)
    11.2013
    100.000
    121.000
    121.00
    12.2013
    50.000
    12.000
    123.00
    01.2014
    23.231
    .23.234
    45.342
    02.2014
    23.231
    34.094
    45.098
    03.2014
    34.098
    98.983
    00.000
    04.2014
    00.000
    69.093
    98.098
    05.2014
    00.000
    89.098
    00.000
    For Example Break up of ROH material plant wise in below mention format.
    LFGJA/LFMON
    WERKS
    MENGE (MT)
    11.2013
    P001
    30.000
    11.2013
    P002
    50.000
    11.2013
    P003
    20.00
    Thanks in advance,
    SKN

    Hi,
       The last period closing stock = current period opening stock. You may get the details from MBEWH and S032 tables. Refer the doc: Material Stock and Valuation History tables - how to read them
    Regards,
    AKPT

  • In MVC, do i need a View or Page with flow logic for POPUP window

    Hi All,
    I have the below scenario using the MVC pattern.
    I have a main view with 3 trays, each tray has two buttons, for example first tray has Create Order button. When I click on this button, I need a popup window to come with a tableview and a button(Create), where I select some rows and click on the button Create  to create order.
    But as per the MVC pattern I canu2019t call the view (popup) from another view(main view).  So should I create a VIEW or PAGE WITH FLOW LOGIC for the popup? .
    I need 6 popup to be called from the main view and once the function is done close the popup.
    Please suggest me the flow for this scenario.
    Cheers,
    Srini.

    Srini,
    1. You can call the view in pop-up because you will be calling the controller using open.window.
    Here is the sample code:
    method DO_REQUEST .
      data:
            li_vw           type ref to   if_bsp_page,
            lv_form_field   type          string,
            li_md           type ref to   zcl_model01.
      dispatch_input( ).
      li_md ?= get_model( 'm01' ).
      lv_form_field = request->get_form_field( 'invoice_create' ).
      if lv_form_field is initial.
    *------ Request to display main page
        li_vw = create_view( view_name = 'main.htm' ).
        li_vw->set_attribute( name = 'model' value = li_md ).
        call_view( li_vw ).
      elseif lv_form_field eq 'true'.
    *------ Request to display Invoice page in pop-up
        li_vw = create_view( view_name = 'invoice.htm' ).
        li_vw->set_attribute( name = 'model' value = li_md ).
        call_view( li_vw ).
      endif.
    endmethod.
    Layout:
          function do_Invoice()
          { var s=0; r=1; w=300; h=300; x=screen.width/2;
            x=x-w/2;
            var y=screen.height/4;
            y=y-h/2;
            popUp=window.open('main.do?invoice_create=true','win','width='+ w
            +',height='+ h +', left=' + x +',top='+ y +');
    Option2:
    Ofcourse you can't bind the model in page becos those are 2 different things. But all you need to do is access the model to get some value. To know how to access the model from Page w/flow logic look at [this link|Passing model reference to a page in a Popup].
    Raja
    Edited by: Raja Thangamani on Apr 14, 2009 11:22 AM

Maybe you are looking for

  • I find I have software that needs 10.5, how should I upgrade?

    10.5 is needed for many new iApp based devices, yet Apple no longer offers it on their web based store.  For people who have compatible computers they need to consider the following: 1. iTunes latest version that works on 10.4.11 is 9.2.1, available

  • Dynamic flat file name based on selected date range

    Hi, I have created mapping which load data into file, i have to create file with the range specified for the data to be pulled. e.g if i have to load data from 01-sep-12 to 15-sep-12 the file name should be ext_rio_15-sep_to_15_sep. how can i achive

  • Java EE 5 Tools Bundle Beta

    Does anyone know if the Java EE 5 Tools Bundle Beta will be updated with NetBeans 5.5 Beta 2 (release just today).

  • Word document links not converting to WebHelp

    I have an Word 2007 document that contains hyperlinks to send an email and to jump to another place in the same document. I imported the document into my RoboHelp project and all looks fine. But when I create the WebHelp the links do not work. This i

  • How do I not automatically download photos in Apple Mail?

    How do I not autmatically download photos when I open Apple Mail. I lve on a boat and internet by the satellite gets expensive. I would like to know how to turn off automatic photo downloads.