Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-10-2004, 08:34 AM   #1
LocoDave
Member
 
Join Date: Feb 2003
Location: Down Under
Posts: 99
Exclamation Animation using actionscript

Hi Guys, just wondering if anyone know how i can animate sumpin like the fla provided by using actionscript instead of frame animation!

I just want an object to go across the screen and then loop again once it has reached the end point again.

Ive looked at the grass tutorial (kirupa sample), but couldnt get my head around it.

Thanks for ur help
Attached Files
File Type: zip animate.zip (2.1 KB, 248 views)
LocoDave is offline   Reply With Quote
Old 05-10-2004, 08:38 AM   #2
pom
Allez les Bleus!!!
 
pom's Avatar
 
Join Date: Oct 2002
Location: Paname
Posts: 2,493
Default

Hi,

I didn't look at your file, but you could do something like that:
Code:
from = 50 ;
to = 400 ;
speed = 10 ;
theClip.onEnterFrame = function () {
    this._x += speed ;
    if (this._x > to) this._x = from ;
} ;
pom is offline   Reply With Quote
Old 05-10-2004, 08:43 AM   #3
pom
Allez les Bleus!!!
 
pom's Avatar
 
Join Date: Oct 2002
Location: Paname
Posts: 2,493
Default

This might work too:
Code:
from = 50 ;
to = 400 ;
speed = 10 ;
theClip.onEnterFrame = function () {
    this._x = (this._x + speed) % (to - from) + from ;
} ;
I said might work
pom is offline   Reply With Quote
Old 05-10-2004, 10:28 AM   #4
LocoDave
Member
 
Join Date: Feb 2003
Location: Down Under
Posts: 99
Default hey thanks

thanks for ur code! got it working! just one thing, it flashs every now and then? why is that? it's not a full smooth animation, is that because it is actionscript rather then animated??

Thanks for ur help

here is the fla if u wanna see the flash im talking about!!
Attached Files
File Type: zip animate2.zip (2.3 KB, 244 views)
LocoDave is offline   Reply With Quote
Old 05-10-2004, 10:35 AM   #5
cobo
everyday looser...
 
cobo's Avatar
 
Join Date: Jul 2002
Location: Austria
Posts: 647
Default

maybe your frame rate is to low...

if you use onEnterFrame, speed will always depend of your personal frame rate...

give it a try with setInterval to launch the function by time intervals...

cobo
__________________
....want some more TNT, birdie... !?! ...
cobo is offline   Reply With Quote
Old 05-10-2004, 10:40 AM   #6
LocoDave
Member
 
Join Date: Feb 2003
Location: Down Under
Posts: 99
Default

hey there, i tried the setInterval, and it didnt work, the mc didnt scroll across the page, it just flashed on the other end!!
LocoDave is offline   Reply With Quote
Old 05-11-2004, 07:20 AM   #7
pom
Allez les Bleus!!!
 
pom's Avatar
 
Join Date: Oct 2002
Location: Paname
Posts: 2,493
Default

Yes, use a higher frame rate, or decrease the speed
pom is offline   Reply With Quote
Old 07-16-2004, 04:55 PM   #8
arch
Registered User
 
Join Date: Jul 2004
Posts: 1
Default

it's flashing because the circle movie clip has a single frame where you set it way off center.
arch is offline   Reply With Quote
Old 07-23-2004, 11:37 AM   #9
jsam
Registered User
 
Join Date: Jun 2004
Posts: 59
Question ur animation bug is fixed

Hi,
Edit ur circle mc,
remove all the frames except frame 1
run ur movie.
Now ur bug is fixed.


Yeee.......
jsam is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:30 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.