Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Flash Player - AnimationEvent

Discussion in 'Flash' started by wallis2xk, Dec 22, 2011.

  1. wallis2xk

    wallis2xk

    Joined:
    Dec 22, 2011
    Posts:
    34
    Hi, I'm just trying to export to Flash Player a section which deals with AnimationEvents in code. I see it says that Animations are in the Supported section, "AnimationEvents that carry arguments" are not supported, but I'm not sure where this falls (I'm not using any arguments in my events). Is it just that AnimationEvents are not supported in code?
     
  2. Lucas Meijer_old

    Lucas Meijer_old

    Joined:
    Apr 5, 2008
    Posts:
    436
    AnimationEvents should work, as long as the receiving method does not have an argument.
    normally in unity you're allowed to have the event pass some data. and int,float,string, etc.
    if you do not do that, they should work, allthough I wrote support for that right before we shipped,
    so it hasn't had a lot of testing.
     
  3. wallis2xk

    wallis2xk

    Joined:
    Dec 22, 2011
    Posts:
    34
    Sorry, I forgot to give the error I was getting:

    Assets/Game/Scripts/Characters/AnimationManager.cs(26,41): error CS0246: The type or namespace name `AnimationEvent' could not be found. Are you missing a using directive or an assembly reference?

    Edit: which was on a line which was just

    AnimationEvent endEvent = new AnimationEvent();
     
    Last edited: Dec 22, 2011
  4. Lucas Meijer_old

    Lucas Meijer_old

    Joined:
    Apr 5, 2008
    Posts:
    436
    Looks we didn't include the ability to create animation events at runtime. If you make them in the editor as part of an animationclip they should work, as long as it has no argument
     
  5. wallis2xk

    wallis2xk

    Joined:
    Dec 22, 2011
    Posts:
    34
    Ok cool, will have to rework some stuff then :)
     
  6. LD

    LD

    Joined:
    Nov 6, 2009
    Posts:
    40
    Ha! I was just looking for this. I too was wondering why I couldn't do this at runtime. Doh! I have a huge project that I'd love to get exported to Flash.

    Will there be support for this at some point?
     
  7. Lucas Meijer_old

    Lucas Meijer_old

    Joined:
    Apr 5, 2008
    Posts:
    436
  8. tolosaoldfan

    tolosaoldfan

    Joined:
    Sep 14, 2012
    Posts:
    92
    Hi,

    I would like to have some news about the AnimationEvent in the Flash version with Unity4.
    Is it included ?
    Because our software is based on a intensive use of "AnimationEvent" and we want to know if the Flash version will include this feature.
    It's very important for a proposal we made to a prospect, and it's the key point of the final decision for our prospect.

    Thanks for your response, Unity Team !

    Laurent
     
  9. DDowell

    DDowell

    Joined:
    Feb 8, 2012
    Posts:
    52
    I spoke with the Flash exporter team at Unite 12 and they confirmed that AnimationEvent (with parameters) is working in Unity 4. Animated script properties is not working though to my dismay.
     
  10. tolosaoldfan

    tolosaoldfan

    Joined:
    Sep 14, 2012
    Posts:
    92
    Hi,

    Thanks DDOwell for this invaluable information.

    What do you mean precisely by "animated script properties" ? the property like AnimationEvent.time, AnimationEvent.State
    or animation[XXX].time, animation[XXX].length, animation[XXX].speed ?

    Thanks for the word "dismay", I didn't know it. If you're right, +1 to "dismay". I will miss a big contract due to that ! :((