简体   繁体   中英

AS3 Wheel of Fortune spinning

I'm working on wheel of fortune project but i'm currently struggling with the code.

I have attached the design of the wheel. I'm not a coder, i'm a designer and I need to do all the animation and the effects but I want to do it professional and that part is very important.

What I want to do is when you click on the spin button the wheel to rotate for 4-5 seconds with ease in/out effect and to stop each time on different random sector. Ill do different animations for each sector in separate movie clip and when it stops on a sector I want the movie clip related with that sector to start playing.

My idea is to make the wheel as a movie clip and each sector animation movie clips to be nested in it so when it stops that specific movie clip starts. Maybe I need to make each position of the wheel on key frame and to place the animations on these frames, but not sure if that is the right way.

One of the thing is that these movie clips with the effects should be easy for re position. I need to move them on the stage if needed and that's why i don't want them to be triggered with code.

If you can guide me step by step how to do that part I will appreciate your help. wheel design

Ok guys. There is a thread already for that and its something what I'm looking for. I like the example of the last answer in that thread, but I think that the first code will be more useful for my needs after that.

Can someone help me to make the code working, because I couldn't. All I need at the moment is to make the wheel spinning for 4-5 seconds on button pressed with ease in/out and it stops on random sector. Here is the link of the thread. Spinning Wheel in flash AS3

I suggest you not to use keyframes at all. Use only one single frame, and in code, using a main class, instantiate all elements you need. To spin the wheel, you can consider using Greensock TweenMax or embedded tweening classes from Adobe. Also, spinning the entire wheel with all movieclips with nested animations inside, in spite animations are not running, forces to render all nested movieclips at each frame with a very heavy calculation load. I would suggest to either use 2 different clips, and add the animated one only when you need it, or at least to cache tentire wheel as a bitmap, and then uncache it when some animation is running inside.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM