![]() |
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
|
|
"Tween" from code? |
Page: 1 | Reply |
Dec 23rd 2003 | #134720 Report |
![]() Posts: 55 |
I want to transform a symbol (rotate, move, scale) in a smooth way. Think of a box that when clicked slowly moves from one end of the screen to the other. Pretty simple using a motion tween. The tricky part is that the sysmbol I want to transform is being created at runtime and I don't think it's possible to use tweens at runtime (it would sure make me happy if it were). Using an interval, I have adjusted the necessary properties of the symbol until I have achieved the 'desired' results. The problem is that the movement looks jumpy (if properties are adjusted by a number that's too large) or is way too slow. Should I keep experimenting with interval settings or is there an easier way around this? Thanks. |
Reply with Quote Reply |
Dec 23rd 2003 | #134721 Report |
![]() Posts: 2333 |
runtime...? care to explaim?
|
Reply with Quote Reply |
Dec 23rd 2003 | #134722 Report |
![]() Posts: 55 |
Let's consider the box example: I have created a rectangle and converted it to a symbol called mySymbol. [php] //create and attach createEmptyMovieClip("clip", 1); clip.attachMovie("mySymbol", "bla", 1); clip.bla._x = 0; clip.bla._y = 0; [/php] [php] //now I want to move the rectangle from (0, 0) to (100, 100) function moveIt(){ ++clip.bla._x; ++clip.bla._y; if( clip.bla._x == 100 ){ clearInterval(intt); } } intt = setInterval(moveIt, 50); [/php] Can this be done in a simpler way? e.g: MoveBoxSmoothly(clip.bla, 100, 100). |
Reply with Quote Reply |
Dec 23rd 2003 | #134730 Report |
![]() Posts: 1977 |
Is there any way that u could duplicate the mc instead of creating it dynmaically? That way you could create your tween off stage and at the specific time in the movie just duplicate it and pull it down. You may have already thought of it.....not sure.....but its an idea. No easy way. Setting the interval will only work within the FPS you have. So if your movie is 12 frames per second and you want to move 100 pixels.....u can guess thats going to be jumpy. You can either crank your fps (if u can afford it and it doesnt affect your movie) or your just going to have to settle with the non-smooth tween. |
Reply with Quote Reply |
Page: 1 | Back to top |
Please login or register above to post in this forum |
© Web Media Network Limited. All rights reserved. No part of this website may be reproduced without written permission. Photoshop is a registered trademark of Adobe Inc.. TeamPhotoshop.com is not associated in any way with Adobe, nor is an offical Photoshop website. |