Web Design Forum: Need help getting this aniamtion as smooth as possible - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Need help getting this aniamtion as smooth as possible Rate Topic: -----

#1 User is offline   couzo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 14-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 16 July 2008 - 09:00 AM

Hi guys,

I have just finished creating our sites flash banner however the movement is still not as smooth as I want. I have the banner at 60fps and the movements still are not as smoother as I would like.

Any thing i can try to smooth the slightly jerky moments?

I would post the banner but don;t want to be thought of as advertising. Is it ok to post the graphic?

Many thanks
0

#2 User is offline   php_penguin 

  • richthegeek
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,471
  • Joined: 06-August 07
  • Reputation: 7
  • Gender:Male
  • Location:Liverpool
  • Experience:Web Guru
  • Area of Expertise:Coder

Posted 16 July 2008 - 10:35 AM

60fps is more than enough - human eyes 'see' at 30fps, and any jerkiness you see is due to :
- too large steps between one frame and the next (eg moving something too quickly)
- moving something once in every 5 or so frame (effective fps for that object being 12)
- the animation is too complex (and so the computer is unable to run it at full framerate)
0

#3 User is offline   couzo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 14-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 16 July 2008 - 01:14 PM

the banner is at the top of our site www.propstore.com could it be i just have to much going on?

Oh and it the flash banner at the very top of the page i am talking about.
0

#4 User is offline   Roberto 

  • Rain Dog
  • PipPipPipPip
  • Group: Members
  • Posts: 532
  • Joined: 19-August 07
  • Reputation: 2
  • Gender:Male
  • Location:Suffolk
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 17 July 2008 - 01:42 PM

Hello

If your using tweens to move the photo's, you will get a smoother movement when you increase the number of frames between keyframes. If you click on a key frame a rectangle appears next to the cursor, you can then click/drag that keyframe further along the timeline. Play around with distance moved for a given frame rate to see what works best.

A better solution is to move the picture with actionscript. If you have two pictures side by side, moving one with tweens and the other with actionscript - you will see that the contents of the picture moved with actionscript do not jerk about like the tweened picture. You also have better control of speed with actionscript, making it easier to get the movement you require.

Rob
0

#5 User is offline   couzo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 14-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 21 July 2008 - 08:00 AM

I will try the action script route. Any good links to action script site?
0

#6 User is offline   Roberto 

  • Rain Dog
  • PipPipPipPip
  • Group: Members
  • Posts: 532
  • Joined: 19-August 07
  • Reputation: 2
  • Gender:Male
  • Location:Suffolk
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 21 July 2008 - 09:16 AM

Hello

Which version of Flash are you using? Are you targeting earlier versions of Flash Player? If your using CS3 + targeting the latest Flash Player, you can use AS3. If not, you can use AS2. Let me know which one your using and I can post a quick how to.

Rob
0

#7 User is offline   couzo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 14-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 21 July 2008 - 09:40 AM

Hi rob,

I use CS3 but the action script i normally use for creating links etc is AS2 if that helps
0

#8 User is offline   Roberto 

  • Rain Dog
  • PipPipPipPip
  • Group: Members
  • Posts: 532
  • Joined: 19-August 07
  • Reputation: 2
  • Gender:Male
  • Location:Suffolk
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 21 July 2008 - 12:20 PM

Hello

The attachments contain CS3 files, that show a way of moving pics with as2/as3.

You need to have your pictures converted to MovieClips - right click picture and select Convert to Symbol - make sure Movie Clip and the top left registration point are selected - give it a name and select ok. The top left registration dot needs to be selected because it makes it easier to keep track of the movieClips position in the actionScript. When the movieClips y position is greater than the height of the stage, then the picture is off the stage. Give each of your pictures an instance name in the properties panel - if you use a name that ends in _mc, you will get code completion hints in the actions panel.

In the example, I started moving three pictures on frame 1 of the movie. This was achieved by inserting a new layer, naming it actions, and selecting the first frame of that layer + openning the actions panel. In the actions panel, you can control the pictures using the instance name you gave them in the properties panel. Each picture is given an speedX/speedY property, which will determine its movement. A positive x value moves the picture from left to right, a negative x value goes from right to left. A positive y value moves the picture down the screen, a negative y value moves the picture up the screen.

Each picture also has its onEnterFrame property linked to a function called movePic. On every frame, each picture will call the movePic function. The onEnterFrame calls the named function on every frame, until the onEnterFrame is deleted.

Within that function the pictures position is changed using:

this._y += this.speedY;
this._x += this.speedX;

This is just saying add my speedY to my current _y position + my speedX to my current _x position.
var ten:Number = 10;
ten += 2; //ten would now equal 12


angry_mc.speedX = 1;
angry_mc.speedY = 2;
angry_mc.onEnterFrame =  movePic;

flasher_mc.speedX = -1;
flasher_mc.speedY = 2;
flasher_mc.onEnterFrame = movePic;


elvis_mc.speedX = 0;
elvis_mc.speedY = -2;
elvis_mc.onEnterFrame = movePic;



In the movePic function, each picture has its speedX added to its _x position and has its speedY added to its _y position, which moves the picture.

On each frame a test is made to see if the picture is still on the stage, if the picture is off the stage, the onEnterFrame is deleted + the picture repositioned back to its original position.

function movePic():Void {

this._y += this.speedY;
this._x += this.speedX;

switch(this._name){

case "angry_mc" : if(this._y > Stage.height){
delete this.onEnterFrame;
this._x = 0;
this._y = -100;
}
break;

case "elvis_mc" : if(this._y < 0 - this._height){

delete this.onEnterFrame;
this._x = 225;
this._y = Stage.height;
}
break;

case "flasher_mc" : if(this._y > Stage.height){
delete this.onEnterFrame;
this._x = 450;
this._y = -100;
}
break;

case "goat_mc" : if(this._y > Stage.height){
delete this.onEnterFrame;
this._x = 225;
this._y = -100;
}
break;

case "gHead_mc" : if(this._y < 0 - this._height){
delete this.onEnterFrame;
this._x = 0;
this._y = Stage.height;
}
break;

case "gFace_mc" : if(this._y < 0 - this._height){
delete this.onEnterFrame;
this._x = 450;
this._y = Stage.height;
}
break;


default: trace("bugger");
break;
}


}

On Frame 229, after the text zooms off, on the actions layer a new Keyframe was added + in the actions panel the following code was added:

gHead_mc.speedX = 1;
gHead_mc.speedY = -2;
gHead_mc.onEnterFrame =  movePic;

gFace_mc.speedX = -1;
gFace_mc.speedY = -2;
gFace_mc.onEnterFrame = movePic;


goat_mc.speedX = 0;
goat_mc.speedY = 2;
goat_mc.onEnterFrame = movePic;



This takes care of moving the second set of pictures. They use the movePic function from the first frame.

If you need this explaining more clearly, let me know.

Rob

Attached File(s)

  • Attached File  As2.zip (126.92K)
    Number of downloads: 2
  • Attached File  As3.zip (203.36K)
    Number of downloads: 3

0

#9 User is offline   couzo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 14-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 05 August 2008 - 01:55 PM

thanks for teh input I will start looking into this to get the flash sorted.

Many thanks for you help on this
0

#10 User is offline   couzo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 14-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 26 August 2008 - 10:38 AM

Hi Rob,

I have finally got some time to sort out my banner. I am now using AS3 for this. I seem to be able to move 2 of 5 mc items but the other 3 never seem to move even though the actions are exactly the same for them. Any ideas on this or I can post up the .fla?

Many thanks
0

#11 User is offline   couzo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 14-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 26 August 2008 - 10:47 AM

Nevermind this post i think i have sorted it :)
0

#12 User is offline   headcoat 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 933
  • Joined: 24-March 08
  • Reputation: 1
  • Location:Londonia
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 26 August 2008 - 11:01 AM

My two bits worth on animation FPS.

TV is only 25 FPS BUT the general consensus amongst animators/designers these days is use more for animation e.g. well above 40 FPS.

It does make a difference.

:flm7:
0

#13 User is offline   couzo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 14-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 26 August 2008 - 01:55 PM

well i have all the script working now. Thank to everyone for the help.

The file still stutters a bit but not as bad as before and i have been able to reduce the file size to which is great. :)
0

#14 User is offline   Roberto 

  • Rain Dog
  • PipPipPipPip
  • Group: Members
  • Posts: 532
  • Joined: 19-August 07
  • Reputation: 2
  • Gender:Male
  • Location:Suffolk
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 26 August 2008 - 02:01 PM

Hello

Glad you got it working. With the flicker problem, the larger amount you move the pictures on each frame - the bigger the amount of flicker. Its just a case of messing around with the speed of picture movement for a given frame rate.

Cheers

Rob
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users