This site is optimised for Firefox 2.0 or Internet Explorer 7.

Carousel

lanky_bob has no avatar
lanky_bob
 
Post Count: 3
Joined: Tue Dec 11, 2007 11:44 pm
Location: stoke-on-trent, England

Carousel

Postby lanky_bob on Tue Dec 11, 2007 11:52 pm

Hi i'm a newb to flash and forums.

I'm trying to followthe great tutorial on the carousel but when i get to test the movie after i have got to the point were i should have one item in the carousel and it should rotate. I get one item in the top left hand corner that does not move.

i am using flash 8

here is my code

var numOfItems:Number = 1;
var radiusX:Number = 250;
var radiusY:Number = 75;
var centreX:Number = Stage.width/2;
var centreY:Number = Stage.height/2;
var speed:Number = 0.05;

for (var i = 0;i<numOfItems;i++)
{
var t = this.attachMovie("item1","item1"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
}

function mover()
{
this._x = Math.cos(this.angel)* radiusX + centreX;
this._y = Math.sin(this.angel)* radiusY + centreY;
var s:Number = this._y / (centreY+radiusY);
this._xscale = this._yscale = s * 100;
this.angle += this._parent.speed;
}

hoping that you may help as i'm tearing my hair out!

Bob

User avatar
nebutch
Site Admin
 
Post Count: 3395
Joined: Wed Apr 05, 2006 12:36 am
Location: Earth, Milky Way
Flash Version: Adobe Flash CS4

Re: Carousel

Postby nebutch on Tue Dec 11, 2007 11:59 pm

Code: Select all
this.angel


should be
Code: Select all
this.angle

(this typo happens twice in your code)

Also, please use the "Code" button when posting code...

HTH :)
Trust me, I know what I'm doing...

Image

Did this post help? If so, please consider a donation! Just click the "Donate" link at the top-right of this page.

lanky_bob has no avatar
lanky_bob
 
Post Count: 3
Joined: Tue Dec 11, 2007 11:44 pm
Location: stoke-on-trent, England

Re: Carousel

Postby lanky_bob on Wed Dec 19, 2007 7:12 pm

thank you!!
sometimes it just needs another pair of eyes! plus my dyslexia doesn't help! this could be fun lol

sorry i didn't see the code button, i will use it if i post again.

thanks at least if goes round now just on it's own!

i will try again!

cheers

Bob


Return to General Flash

Who is online

Users browsing this forum: No registered users and 2 guests