Announcement

Collapse
No announcement yet.

I Used 'udk_inventory' Example to Structure My Menu, Then Found This...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I Used 'udk_inventory' Example to Structure My Menu, Then Found This...

    Code:
     * Certain objects in this Flash file are embedded within a hierarchy of containers.
     * This was done to avoid an issue where a MovieClip could not be tweened on the timeline
     * after one of its members had been manipulated via ActionScript. The workaround was to create
     * a new parent MovieClip and manage it with timeline and original MovieClip with ActionScript. 
     * This behavior has since been resolved, but artifacts remain in the Flash file and throughout 
     * this class (see SetupBG()).
    I went through the long and rather arduous process of creating a Scaleform3di menu in Flash, using the udk_inventory sample as a basis for the hierarchy of my objects. When I went to try and replicate the same UnrealScript base class to learn how everything worked behind the scenes, I found this. Now I am left with several questions, I'm hoping somebody would be kind enough to answer because I'm hoping all my work has not been useless.

    What bug does this refer to?
    Does the fact that this was resolved and is now un-needed mean that my hierarchy is incorrect or just unnecessary?
    Is the function SetupBG() now unnecessary?
    Should the majority of my aesthetic animation still be done in ActionScript, using UnrealScript simply to control the parent movieclip?

    Thank you in advance for any help you guys can lend, I've read extensively through the best-practices thread and a number of other Scaleform tutorials and references but a lot of it seems to conflict with what the UDK developers actually did.

    #2
    Are you running into any issues in regards to it?

    I doubt any of it is really very important to worry about. Worst case, test what you would like to do and see if it works. I doubt you will get much of anything in the way of a detailed explanation of this issue if it has indeed been resolved. By and large the only response you should worry about is - does the framework work for you? if not, make some modifications and test it out reporting back any issues you come across, if so... go ahead and continue what you were doing.

    Is it unnecessary? idk, sounds like a judgement call to me. Should your animations be handled in actionscript? no. Neither in Unrealscript. Your animations will perform best in the form of Tweens, AS will allow you a level of interaction but you dont want Unreal or AS being executed on a per frame basis, as it will cost you performance.

    Comment


      #3
      Originally posted by Bob_Gneu View Post
      Are you running into any issues in regards to it?

      I doubt any of it is really very important to worry about. Worst case, test what you would like to do and see if it works. I doubt you will get much of anything in the way of a detailed explanation of this issue if it has indeed been resolved. By and large the only response you should worry about is - does the framework work for you? if not, make some modifications and test it out reporting back any issues you come across, if so... go ahead and continue what you were doing.

      Is it unnecessary? idk, sounds like a judgement call to me. Should your animations be handled in actionscript? no. Neither in Unrealscript. Your animations will perform best in the form of Tweens, AS will allow you a level of interaction but you dont want Unreal or AS being executed on a per frame basis, as it will cost you performance.
      Excellent, thank you for the response you have assuaged many of my fears. One question remains however, what is the preferred way to do Z-tweening? I ask because I was just assuming it was done from within the UnrealScript portion of the menu, as they do in the GFxProjectedInventory sample. Except they directly say in that sample that this method is no longer necessary for z-tweening, so what is necessary? :P

      Comment


        #4
        Technically, even timeline based animation is just ActionScript behind the scenes. The Flash timeline tools are just visual representations of the tweening done by ActionScript.

        Z tweens are best accomplished via ActionScript or UnrealScript.

        Comment


          #5
          Originally posted by Matt Doyle View Post
          Technically, even timeline based animation is just ActionScript behind the scenes. The Flash timeline tools are just visual representations of the tweening done by ActionScript.

          Z tweens are best accomplished via ActionScript or UnrealScript.
          In UnrealScript, after glancing over the files, it appears that the TweenTo(MovieClip, Float, VarName, EndPoint, TweenType, CallBack) is the preffered method to use. How would such a tween be accomplished in Flash? Is it really just as simple as setting an object's _z value to say, 1000 in one frame and then 500 a few frames later? Will that effectively tween between the two values?

          Comment


            #6
            Tweening Animation in ActionScript

            NOTE: Avoid mixing timeline animation with ActionScript tweening, as you may get unwanted results.

            ActionScript 2.0 Sample

            Code:
            _global.gfxExtensions = true; // this line is only necessary if you wish to tween on the Z axis (in 3D).
            import gfx.motion.Tween;
            import mx.transitions.easing.*;
            
            Tween.init(); // this line adds tween functionality to all movie clips.
            
            MyMovieClip.tweenTo(3, {_x:250, _y:250, _z:-5000, _alpha:50}, Strong.easeOut);
            tweenTo(duration in seconds, object containing destination x, y, z, alpha, etc., tween type & method)
            tweenFrom(duration in seconds, object containing source x, y, z, alpha, etc., tween type & method)
            tweeEnd(true)

            tweenTo() tweens FROM the position of the object on the stage TO the position given by the properties in the code.
            tweenFrom() tweens FROM the properties given in the code TO the position of the object on the stage.
            tweenEnd() jumps to the end of the tween, ending it immediately.

            Tween Types:

            Back, Bounce, Elastic, Regular, Strong, None

            Tween Methods:

            easeIn
            easeOut
            easeInOut

            Examples:

            Bounce.easeOut
            Strong.easeIn
            Elastic.easeInOut

            Tweening Animation in UnrealScript

            Code:
            TweenTo(ArsenalMC, 0.5, "_z", -1500.0, TWEEN_EaseOut, "SomeFunction");
            TweenTo(
            MovieClip Reference as a GFxObject,
            duration in seconds as a float,
            property to tween as a string,
            value to tween to as a float,
            tween type as a constant,
            (optional) function to execute when finished as a string
            )

            Some Tween Types


            TWEEN_EaseOut
            TWEEN_EaseIn
            TWEEN_Linear

            Comment


              #7
              Originally posted by Matt Doyle View Post
              Tweening Animation in ActionScript

              NOTE: Avoid mixing timeline animation with ActionScript tweening, as you may get unwanted results.

              ActionScript 2.0 Sample

              Code:
              _global.gfxExtensions = true; // this line is only necessary if you wish to tween on the Z axis (in 3D).
              import gfx.motion.Tween;
              import mx.transitions.easing.*;
              
              Tween.init(); // this line adds tween functionality to all movie clips.
              
              MyMovieClip.tweenTo(3, {_x:250, _y:250, _z:-5000, _alpha:50}, Strong.easeOut);
              tweenTo(duration in seconds, object containing destination x, y, z, alpha, etc., tween type & method)
              tweenFrom(duration in seconds, object containing source x, y, z, alpha, etc., tween type & method)
              tweeEnd(true)

              tweenTo() tweens FROM the position of the object on the stage TO the position given by the properties in the code.
              tweenFrom() tweens FROM the properties given in the code TO the position of the object on the stage.
              tweenEnd() jumps to the end of the tween, ending it immediately.

              Tween Types:

              Back, Bounce, Elastic, Regular, Strong, None

              Tween Methods:

              easeIn
              easeOut
              easeInOut

              Examples:

              Bounce.easeOut
              Strong.easeIn
              Elastic.easeInOut

              Tweening Animation in UnrealScript

              Code:
              TweenTo(ArsenalMC, 0.5, "_z", -1500.0, TWEEN_EaseOut, "SomeFunction");
              TweenTo(
              MovieClip Reference as a GFxObject,
              duration in seconds as a float,
              property to tween as a string,
              value to tween to as a float,
              tween type as a constant,
              (optional) function to execute when finished as a string
              )

              Some Tween Types


              TWEEN_EaseOut
              TWEEN_EaseIn
              TWEEN_Linear
              You could not possibly have cleared up my concerns more succinctly. Whatever they are paying you, Matt is not nearly enough. Thanks so much for your help!

              Comment

              Working...
              X