AS3 3D Tween not working - actionscript-3

I have an animation that is created in flash, I have used the 3d tween changing many angles and rotations over 60 frames
playing this animation works fine by its self, The "snowy Screen is the 3d tween"Below is the object rotating
When I load this SWF into another Main SWF the 3d tween is ignored.Below
is the problem
Im hoping some one can explain if this is a glitch of some sort..
I have exported into different flash versions and have created different loader classes to try and find a solution.
Thanks

I have encountered this before and it killed me. If you load one 3D tween into a different SWF the parent SWF will control the perspective (there can only be one perspective per SWF at least as of Flash 10 player). You will need to set the perspective values identically in both the loaded SWF and the parent SWF. This one aspect of Flash 3D turned me off so much I do not use the feature at all anymore. This even goes for different assets dynamically parented together.

Related

8-direction Figure Animation with Arrow Keys

I've been charged with designing a demo for an isometric video game in ActionScript 3. I have the bitmap spritesheets that show the avatar I'm using standing and walking in each direction. The walking animation is made up of three frames.
My problem, though, is that I need to figure out how to make use of them. I'm not familiar with animation in Flash, and I need input on how to gotoAndPlay() the walking frames for the right direction. I don't think isolating the necessary DIRECTION is going to be a challenge, so much as starting it and keeping it going while the arrow keys are down.
My current code is basically comprised of keyboard handlers for KEY_UP and KEY_DOWN, each containing a switch-case statement that changes the Avatar.currentDirection property. The handler continues to fire while the keys are down, but I need to add animation to the game.
I've seen some examples where they simply embed the animations into an SWF, propagate an array of the various walking stages, and alternate between them using an EnterFrame event handler, but this seems really clunky. I guess in the end I'm trying to make use of Adobe Animate, but I don't know how you're supposed to do that.
Ops, fortunately i'm working with sprites (atlas animations) right now!.
if i'm right, you just needs to use them for playing some animation with functionality.
if you have a well sized sprite which is tiled with isometric slots like it:
(9 frames sized 64x128)
your work is very easy, only create new movieclip from library, inside it, create a borderless rectangle (which is our mask) in a layer (named mask) then import image to the project, and its better to disabling smooth ability from image properties,
now, inside your movieclip, you have to create new layer (under the mask layer) and add your sprite image for each frame, and change its position:
at last, enable masking for mask layer, then its time of coding,
name your animation queries (like image 3) and for loopable animations, insert gotoAndPlay('anim_name') inside last frame. i hope you are familiar with controling movieclip animations which is basic consept of any flash project.
now to extend it for 8 directions support, you just need to play and switch between dirctions according single and multi keypreses,

Possible to Drive Object Properties with Motion Tween?

I'm trying to create a complex parallax effect in Flash video sequence that includes translation and scaling among many layers.
I've been looking for a way to set up my scene to where I could just animate one object (preferably with motion tween) and then apply some percentage of that animation to each background object (or flip values accordingly).
Is there any way to harvest Motion Tween data out of a layer of a MovieClip and translate that into x,y values for objects? [So far I've only created instances of objects and set their positions through actionscript.]
Seems like you need to use a copy motion option of the layer context menu
Also tweening actionscript libraries e.g. TweenMax are capable of tweening any properties of any objects, but they do it with actionscript (which can be easily copied/modified/pasted), not Adobe Flash UI.
So converting every visual element to a movieclip allowed me to position the items in Z as well. That pretty much solved my problem.
Thanks everyone.

easeljs Movieclip vs Sprite

i am new to easel js. When we convert a flash/AS3 project to an HTML5Canvas project using adobe flash cc, the animations and movieclips will become easeljs Movieclip. But in easeljs we can use Sprite to show animation. But using movieclip is easy since flash will generate it.
My question is whether is there any benefit of using easeljs Sprite instead of easeljs Movieclip in terms of performance?
Sprite and MovieClip are totally different in EaselJS.
In Flash, MovieClips extend Sprites, so they have similar functionality.
In EaselJS, a Sprite displays frames of a SpriteSheet, and a MovieClip is a content Container, which understands the concepts of frames, including timelines and frame actions.
MovieClips are generally only used with Flash CC output, although you can make them manually. Ideally, Flash could export Sprites and SpriteSheets as well when it makes sense - however because of the nature of Flash timeline animations, this would be incredibly difficult to determine when and how to export Sprites/SpriteSheets vs MovieClips.
Strictly speaking on performance, Sprites should be better performing because they use a single (or a few) bitmap(s) for all frames, which gets GPU benefits. Multiple, large images (which happens with different sprites, or just single sprites with lots of large frames that span across images) can actually cause performance issues when the GPU switches textures.
There is also a SpriteSheetBuilder class (and example) that you can refer to, which takes Flash CC output, and generates a run-time SpriteSheet, giving you the performance benefits of Sprites, with the complex vector/image output of Flash CC.
Hope that clears things up somewhat.

How to structure code/frames in Flash

I'm working on a Flash game where there are scenes that display a few stages of animation; the animation is controlled by user-clickable buttons (1 through 4) and a progress bar which increases by some amount with a timer.
Right now I have each stage of the animation on a different frame, but I'm not sure how to share the Actionscript and state (e.g. value of the progress var) across the frames.
Should I consolidate these frames into one and let each piece (the buttons, progress bar, and animation) all be three separate movie clips that are controlled by the actionscript of that frame? Or is there another way to do this properly?
What you said is probably the best solution in this case: put everything on one frame and control with ActionScript. The buttons can be their own MovieClips (or Buttons), the progress bar and animation as well. You can then have each stage of the animation on a different frame within the MovieClip, and control which frame appears when using gotoAndStop().
Generally I only use the base frames (i.e. those at the root of an SWF) as animation frames if the SWF is purely animation with no or minimal ActionScript involved. In any other case (games, applications, etc) it's always better to have animations in their own MovieClips, so that you can control and manipulate them easily.

ActionScript 3: Smooth programmatic animation

I want to animate MoviveClips/Sprite objects as smootly as possible. However so far the only method that works is placing the movement code into the EnterFrame event handler. There is one problem with this approach: when the framerate on a specific machine is below the desired framerate then the whole game slows down. I want to be able to do this in a time-independent manner.
There are two ways to do programmatic animation within the Flash player. The first you already pointed out by using a onEnterFrame. However, as you might already have noticed, to get a smooth animation you need to increase the overall frame rate of your movie. Doing this will also increase the CPU load for the entire period of time your SWF runs. This is not something you always want.
The other way of doing programmatic animation is by using a timer. Within a timer handler it is possible to call a function named updateAfterEvent which will update the screen independent from the FPS you'd set for your SWF. Therefore, using a timer leaves a gateway to do smooth animation within the Flash player without increasing the overall frame rate of your SWF.
Two years ago or so I set out to create my own tween libraries for Flash (because of my frustrations with the then existing tween libraries available). I released it under the name Coretween and this library lets you, among other things, choose what type of animation you prefer for every individual tween. On the documentation page I give an example of the difference between frame based and time based animation. The example SWF on that page runs at 12 fps but as you can see, the lower circle tweens much smoother because it's controlled by a timer that ticks at 60 fps and updates the screen in-depended from the SWF frame rate. Do keep in mind though that even the timer ticks at 60 fps in reality the Flash Player will never be able to achieve this frame rate. However, it will try to achieve this frame rate which results in a much smoother overall animation.
Unfortunately until now I've not been able to release a 1.0 version of my library but as far as I know it's pretty stable. You're more than welcome to use it in any way you see fit. I've used Coretween in many commercial productions including this one we did for StGeorge bank here in Australia.
Here are a few Actionscript based animation libraries:
TweenMax
Tweener
They both work well, and should help you with what you need.