Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Can't Find A Simple Image Rotator Tutorial (not Carousel)



Hi,I need to make a simple movie that rotates through images/swfs, in order, and has a small navigation to select any of the images in the rotator. Probably will only contain 3 - 6 images/swfs at a time. I have come across many pre-made flash image rotators, but I need something a bit more open that I can customize to my liking. I'm not necessarily looking for ease of use or automated. I know enough AS that I understand it, I just need help writing it sometimes. Kinda like when you can read a language, but you're not fluent in writing it. Anyway, I'm not asking for someone to write AS for me, but if anyone has something already on hand that they don't mind sharing or if you know of a tutorial that may help, I would appreciate it. Thanks.



General Flash
Posted on: Sat Feb 09, 2008 7:07 pm


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Where Can I Find A Tutorial To Build A 3D Carousel In AS 3.0?
Anyone know where I can find good a tutorial to help me build a 3d flash carousel in AS 3.0?
Or anywhere I can download a flash file or anything I can play around with to figure it out?
I would prefer it to be XML driven.

I would like to build a carousel like this:

Carousel in 2.0

Only I would like to learn to build it in action script 3.0.

I appreciate it.

Real Simple Image Rotator/dafe In/out
I'm looking for a really simple image rotator/slideshow that will cycle through my images one at a time and fade in/out between.

eg

show image 1 for 5 secs, fade out, fade in image 2 and show for 5 secs (in place of 1st, same size), and continue in loop... Preferabley images/size set via xml as i don't have flash!!

I found one, but the size is 80k, and i'm looking for something smaller. It does has loads of settings that i don't require like music/captions/etc...

TIA

Anyone Know Any Image Carousel Tutorial?
Hi,

I'm looking for an image carousel (rotating like those found in carnival rides) done in Flash5. Preferably horizontally rotating and customizable...

Anyone seen one lately? Somewhat looks like this except this one is done with java applets and is more like a ferris wheel rather than a carousel.


Thanks!

Can't Find ONE Tutorial On How To Do This Simple Thing
I've seen tute after tute on how to make a preloader by detecting if all the frames of scene 'x' is loaded, and if loaded, it goes to play that scene.

BUT, I have a movie with like 7 scenes, so how in the world do I make sure all of them are loaded before it starts to play them entire movie? Because all I can do now, is make sure the first scene is loaded, but that doesn't do me any good when the next 6 scenes start trying to play, but aren't pre-loaded.

PLEASE HELP !!!

Thanks a bunch.

A Image Scrolling Tutorial I'm Trying To Find...
There is this tutorial i stumbled upon several weeks back which i thought i could use in this site i was developing. It was simple but i could not get it right when i tried to make my own version. The tutorial is about scrolling serveral images one by one by clicking the two direction buttons depending which way you want the images to scroll. It's like a terrain scrolling tutorial except you have different images and you control it by clicking the buttons. the images also decelerate when you select them.(ie: the image slows down, until entirely inside the viewing window, to a halt.

If you know of this tutorial, please post a link to it here or send via email to:

Viking.no1@gmail.com

Many thanks.

Where Can I Find Simple Flash Play/stop Button Tutorial
Can anyone help me where can i find simple flash play/stop button tutorial. All i need to import a icon play/stop button, when click it load wav file.

How can i attach media.fla

when u click btn

on(release) {
CodePlayer.start();
}

on(release) {
CodePlayer.stop();
}

action script
CodePlayer = new Sound();
CodePlayer.loadSound("ContactUs.wav",true);

Trying To Find A Simple Horizontal Image Slider
hey everyone,
trying to find something similar to this http://www.blog.noponies.com/archives/110. Noponies is a great site, but when I started looking at the code, I got a bit scared...I'm not a AS3 guru . I don't need xml and fancy classes, etc. Thanks for your time.

Video Rotator Tutorial
Does anyone know of a good tutorial that shows how to create the type of video thumbnail, video rotation apps seen basically everywhere?

example:
http://abc.go.com

is it a mixture of javascipt and flash? I've really been unable to find anything.

Thanks in advance

-j

AS Image Rotator Help
Hi all, Im wondering if anyone could lend a hand
Im wanting to make a ActionScripted Image rotator that changes image MC from an array randomly after a certain amount of "frames" fade the image out and fade the new image in.
I could do this no sweat on the timeline, but well, AS seems the better route if it can be done.

Thanks to anyone who can share some higher flash knowledge with me

Mark

Image Rotator
Im not sure where to post this so I will see if you have any ideas. I am looking to create an image rotator that brings and image to the front and rotates them to the back. I was hoping to modify something that is in the downloads on Flashkit.

Here is a sample:
http://www.pellareplacement.com/#/getting_started/

Any help is appreciated.

Xml/as2 Image Rotator
I've got an Image Rotator that uses xml and as2 to pull images from a folder - What is the action script code to create an "alpha in" (alpha=0% to alpha=100%) effect on images that are being pulled from the Images folder and placed into the flash file?

Any help would be appreciated!

Thanks

Xml/as2 Image Rotator
I've got an Image Rotator that uses xml and as2 to pull images from a folder - What is the action script code to create an "alpha in" (alpha=0% to alpha=100%) effect on images that are being pulled from the Images folder and placed into the flash file?

Any help would be appreciated!

Thanks

Image Rotator - Please Help
http://www.jeroenwijering.com/?item=JW_Image_Rotator

Can someone please help me,
i want to change the place of the next and previous buttons,
to the upper left corner..

when i change the position of the controls in .fla file,
that ain't working

i assume that i need to change one of the .as files,
but what....???

my goal is to make it like this..

http://www.index.hr/xmag/

you can see it changing pictures and headlines...

thanks

Xml/as2 Image Rotator
I've got an Image Rotator that uses xml and as2 to pull images from a folder - What is the action script code to create an "alpha in" (alpha=0% to alpha=100%) effect on images that are being pulled from the Images folder and placed into the flash file?

Any help would be appreciated!

Thanks

Random Image Rotator.
How would I go about having about 6 images on a page load random images at random times. For example, each image would rotate every 20-30 seconds and would rotate to 1 of 18 random images.

I know there is probably an easy sollution to it, and it has probably been done 1000 times, but I cant figure it out.

Image Rotator Issue
I'm working on an image rotator but when it rotates images there is a split second when the images disappears and we see the background before the next image is loaded.

The code for the image rotating function:

Code:
function rotateImages():Void
{
if (imageCounter >= images.length) imageCounter = 0;

trace("Rotating image " + imageCounter);
var loaded:Boolean = loader.loadClip(images[imageCounter], mcImageHolder); // load slide

if (loaded == true)trace("Loading image " + imageCounter);
else trace("Error loading image " + imageCounter);

imageCounter++;
setTimeout(rotateImages, rotationRate * 1000);
}


Any ideas on what I need to do to resolve this issue?

Flash Image Rotator Help
Hi, cool forum! I just signed up, am a frequent reader of the posts and stuff though. I need some help, and was wondering if you guys might be able to help me out.

What I'm trying to get done is to make something similar to the rotator on the right here.

I was going to do switch statements for the different versions. something like this...


Code:

var leftCounter:Number = 0;

switch (leftCounter) {

case 1:
//object move left 10 pixels and downscales
break;
case 2:
//object move behind and visible = false;
break;

// .... etc etc.... until it loops around

}
Would anyone know of a better way of doing this?

Here is my current code:


Code:
var xmlPics:XMLList;
var xmlLoader:URLLoader = new URLLoader();
var urlRequest:URLRequest;
var xmlData:Array = new Array();
var xmlImgHolder:Sprite = new Sprite()

stage.addEventListener(Event.ENTER_FRAME, getXML, false, 0, true);
stage.addEventListener(Event.ENTER_FRAME, constructPlaceholders, false, 0, true);
btnRollLeft.addEventListener(MouseEvent.CLICK, onRollLeftClick, false, 0, true);
btnRollRight.addEventListener(MouseEvent.CLICK, onRollRightClick, false, 0, true);

/* ----------- begin stage on ENTER_FRAME ------------ */
function getXML(e:Event):void {

xmlLoader.load(new URLRequest("flashconnect.xml")); // pulls in xml data as text
xmlLoader.addEventListener(Event.COMPLETE, onXMLcomplete, false, 0, true);


function onXMLcomplete(e:Event):void {
xmlPics = new XMLList(e.target.data);// converts XML text back into XML
xmlPics = xmlPics.COVER.COVER_FILE_LOC.children();//finds the children of xmlPics.COVER.COVER_FILE_LOC
for (var i:uint = 0; i < xmlPics.length(); i++) {//loads the boxes with images
urlRequest = new URLRequest(xmlPics[i]);
var picLoader:Loader = new Loader();
picLoader.x = picLoader.y = -45;
picLoader.load(urlRequest);
xmlData.push(picLoader);// pushes picLoader into array xmlData
}

xmlLoader.removeEventListener(Event.COMPLETE, onXMLcomplete);//removing Listener from memory
}

stage.removeEventListener(Event.ENTER_FRAME, getXML);
}
function constructPlaceholders(e:Event):void {
createImgHolder();
addImgHolderData();
stage.removeEventListener(Event.ENTER_FRAME, constructPlaceholders);
}

/* ----------- begin button functionality ------------ */

var leftCounter:Number = 0;
var rightCounter:Number = 0;

function onRollLeftClick(e:MouseEvent):void {//Button Left

if (leftCounter == xmlData.length) {
leftCounter = 0;
}
}
function onRollRightClick(e:MouseEvent):void {//Button Right
//blank space for now
}

function rotatePicLeft(leftX:Number, leftY:Number, sclX:Number, sclY:Number):void {
xmlImgHolder.x -= leftX;
xmlImgHolder.y = leftY;
xmlImgHolder.scaleX = sclX;
xmlImgHolder.scaleY = sclY;

}

/* ----------- constructing functions for stage, xml data, etc... ------------ */

function createImgHolder():void {

with (xmlImgHolder.graphics) {
lineStyle(0, 0x000000);
drawRect(225,175,94,120);
}
}

function addImgHolderData():void {
xmlData[0].x = 225;
xmlData[0].y = 175;
xmlImgHolder.addChild(xmlData[0]);
stage.addChild(xmlImgHolder);

}
PS: I am going to change this to OO later after I get it to work. however at this time I'm tasked with getting this up and running....

Dynamic Image Rotator
How would I go about building something like this flash loader http://www.utilitytrailer.com and have it load the main image, and both vertically moving images, through an xml file...then rotating left?

Xml Image Banner Rotator... Help
Hi,

I'm a noob AS'er and I am stuck at this point... I don't know exactly what I'm doing wrong... Please help.

I have 2 empty mc's that get images from xml.
I'm trying to make the mc's into "buttons" so on mc.onRelease, url from xml will be linked.

Problem:
onRelease starts working from second image.
URL link is adURLindex = 2, when it should be adURLindex = 1.

Please help... I'm attaching my fla and xml files. Thank you in advance.

edit: i think i found the answer:
http://www.kirupa.com/forum/showthre...ovie+onRelease

kirupa forum rocks

Random Image Rotator
Hey everyone. First of, I would just like to say you have an amazing site here. I've only attempted to design in flash in the last month and your tutorials have helped me tremendously. Now, I'm really hoping you can help me with this query. I'm looking to do an image rotator like seen on the right side of this page http://www.deltagoodrem.com/lyrics/home.do I will be looking to use 5 - 8 images perhaps, set on random. Can someone please do a tutorial or help me on this. If it can be fixed soon enough, I will do my best to paypal a small fee at the end of the month. Thank you in advance

Random Image Or Swf Rotator
I needed this because i didn't want to have to use php. Its basically just a preloader+random number generator. It could be much more advanced if you want to use arrays and stuffz. Its probably pretty messy too. I'll comment it a bit, its using tweenmax. Its commented well you should be able to figure it out, i tried to post the source but all the freaking smilies owned it

Could a mod change this to AS3 tags peeze

Live demo http://simpleheartmedia.com/clientde...ndom/index.swf


Thats it, pretty simple and saxx like.

source ---_--_--_-_-__-__-__-_____
http://www.mediafire.com/download.php?osnbimbuftk


Babababam my first contribution

Flash Image Rotator
Anyone offer any advice on some software that will easily rotate a series of images into flash format? Freeware or up to maybe 100USD.

I used something a couple of years ago that did some great transitional efects and I think it also converted powerpoint presentations.

Any ideas where to start? By the way I do not want to learn how to use Flash!!

MP3 Player With Image Rotator
Hi,

I'm new to flash, very new, about 4 days! My programming experience is solely within php. Firstly these forums and the video tutorials have been amazing! Using them I've managed to create an MP3 player with volume and position scrubber, a dynamic text field for the mix name as well as links to other mixes. All the info is passed from a php generated xml page and works fine in AS2.

But I've realised I need to migrate the project to AS3 to take advantage of the setTimeout method. When a mix loads there should be a series of photos passed to an array. The first photo is displayed for 10 seconds then they change through altering their alpha properties.

I've tried to migrate it to AS3 but it's proving difficult. I know I can't use loadMovie and have to use loaders and that I can't use _global anymore so I've tried to create public static variables in a class. Has anyone got any suggestions on the best way to go about creating this.

Here is the code for the image display (I've omitted the mp3 player code because it's immaterial) and hardcoded the array to reduce the unnecessary code.

var pa:Array = new Array();

pa[0] = "13.jpg";
pa[1] = "14.jpg";
pa[2] = "17.jpg";
pa[3] = "18.jpg";
pa[4] = "19.jpg";
pa[5] = "20.jpg";

_global.image1 = pa[0];
_global.i = 1;
_global.imageone = photo2;
_global.imagetwo = photo1;

loadMovie(image1, imageone);
photo1._alpha = 100;

// Function 1 Loads Next Movie Clip
// Will call function 2 at the end

function oneLoadPhoto() {
loadMovie(pa[i], _global.imagetwo);
_global.imageone._alpha = 100;
_global.imagetwo._alpha = 0;
_global.fadeout = _global.imageone._alpha;
_global.fadein = _global.imagetwo._alpha;
twoDelayBlend();
}

function twoDelayBlend() {
_global.alphaInterval;
_global.alphaInterval = setInterval(alphaChange,0.1);
setTimeout("_global.alphaInterval", 10000);
}

function threeHouseKeeping() {
if (_global.imagetwo == photo1) {
_global.imagetwo = photo2;
_global.imageone = photo1;
} else {
_global.imagetwo = photo1;
_global.imageone = photo2;
}
if (i<pa.length) {
_global.i++;
} else {
_global.i="0";
}
oneLoadPhoto();
}

function alphaChange() {
if (_global.fadeout > 0) {
_global.fadeout += (-0.05);
_global.fadein += (+0.05);
_global.imageone._alpha = _global.fadeout;
_global.imagetwo._alpha = _global.fadein;
} else {
clearInterval(_global.alphaInterval);
unloadMovie(imageone);
threeHouseKeeping();
}
}

oneLoadPhoto();

Any help or suggestions greatly appreciated!! I'm a flash novice so explain in simple terms!! Thank you in advance.

Stuart

Dynamic Image Rotator Graphic?
Hey guys, I need help building something likeTHIS LINK . I need it to load the images dynamically, either from an XML file...or I can probably even get by with it loading jpg's (like image1.jpg, image2,jpg...etc). I just haven't been having much luck. Does anyone have any idea's how they built this?

Thanks in advance!

Show Case: Explode Image Rotator
This is an advanced image rotator effect. If you always use fade in/out effect only, you probably have to look into this one. It included both Flash and Silverlight version with complete source codes. This is just one of the rotator effects in my hand, I will continue to post more in the coming days.

http://www.shinedraw.com/animation-e...image-rotator/

News Scroller/Rotator With Image, Caption & Title Like Mlb.com?
Anyone know how to create the samething like mlb.com as well as sohh.com

I been trying to find the name for this and cant seem to find the script anywhere. please help?

Carousel Tutorial
Hi

wheer can i find the best (video)tutortial on the internett for making spin carousel in flash with as3?
(ps. I'm newbee)

Carousel Tutorial AS3
Hi,

I've been trying to find / figure out how to make an AS3 carousel, but all I can find are snippets of code, files that don't work or files with classes that I can't figure out. Does anyone know of a AS3 tutorial that will show me how to build a carousel, like lee's from scratch?

Thanks

Carousel Tutorial
I would like to say thank you for the amazing tutorila was just about to buy a versionof it to get he code, (i know super lazy) when i came accross this which i must say has helped me a lot.

I have come accross one problem and i am sure its is my fault. I have just finished your 3rd tutorial all up until this point has been good but when i preview it now and click on an icon where it is suppose to make it become the one picture with the text box next too it i get this error(see attachment)

any ideas what this means.

Carousel Tutorial And XML
Is there anyway to include a link inside the text description of the xml file? What I'd like to do is describe the picture in the carousel and have a link that will link to another page with more information.

I'm not familiar with xml, so if anyone can help me I'll really appreciate it.

Thanks.

The Carousel Tutorial
hello, i a having trouble with the carousel tutorial, i have reviewed it over and over, but it isnt working.
so i downloaded the FLA, and it doesnt let me open in my version of flash
(Flash MX 2004)
please help me im desperate!
i understand the majority of the code and i dont understand why it wont work

AS3 Carousel Tutorial Help
Hi,

I have been doing the carousel tutorial, but have been trying to convert it to AS3.

I have gotten stuck and am hoping someone can help me out.

The problem is I'm trying to place four instances of the clip "item" onto the carousel, four of them are there but they are all in the same position.

you can see the swf and source fla here:
http://www.thelightdivided.co.uk/flash/index.html
http://www.thelightdivided.co.uk/flash/carousel.fla

The code I have so far is:

Code:

var numOfItems:Number = 4;
var radiusX:Number = 200;
var radiusY:Number = 50;
var centerX:Number = this.stage.stageWidth / 2;
var centerY:Number = this.stage.stageHeight / 2;
var speed:Number = 0.02;

var t:item;

// attach icons to the stage
for (var i = 0; i < numOfItems; i++) {
t = new item();
t.name = "item_"+i;

// place each item equally around the circle
t.angle = i * ((Math.PI*2) / numOfItems);
t.addEventListener(Event.ENTER_FRAME, mover);

// add to stage
addChild(t);
}

function mover(evt:Event):void {
this.x = Math.cos(evt.target.angle) * radiusX + centerX;
this.y = Math.sin(evt.target.angle) * radiusY + centerY;
var s:Number = this.y / (centerY + radiusY);
this.scaleY = this.scaleX = s;
evt.target.angle += this.speed;
trace(evt.target.name);
trace(this.x);
}
Code:

[code][/code]

Many thanks
Chris

Carousel Tutorial
I made a flash movie using Lee,s carousel totorial II , all works well on
the hard drive, But when i upload it to the server it will not work, I uploaded
the SWF plus the XML and the icon files. Anyone know what it could be ?
Is XML like PHP, where it has to be enabled on the server? My server is
a free service , and does not support PHP.Not sure if I am on the right track
or not, Can anyone HELP !

3D Carousel Tutorial
Hi,
Is there a way to make the icons show a bigger version of a graphic when selected?
Or show a different graphic when selected.
I am trying to create a photo gallery out of it.

Thank you.

Carousel Help? (but Not With The Tutorial)
btw.. i just saw the "Stop asking for carousel help" i will do further searchs to confirm that this problem has not been addressed, sorry! Forum Search seems to be bugged.

i am creating a Carousel effect (found on http://www.gotoandlearn.com), but am not implementing any mouse interaction with it, it is a straight forward rotating loop. i need help in two areas.

Code:
Code:

var numOfBalls:Number = 3;
var radiusX:Number = 375;
var radiusY:Number = 100;
var centerX:Number = 400;
var centerY:Number = 400;
var speed:Number = 0.005;

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

function mover()
{
   this._x = Math.cos(this.angle) * radiusX + centerX;
   this._y = Math.sin(this.angle) * radiusY + centerY;
   var s = this._y /(centerY+radiusY);
   this._xscale = this._yscale = s*100;
   this.angle += this._parent.speed;
   this.swapDepths(Math.round(this._xscale) + 100);
}



Q1: How would i go about inserting 3 DIFFERENT library objects (ie ball_1, ball_2, ball_3)? (i do not want to use external or dynamic array/objects) answered see below

Q2: Is it possble to make the objects pause at the front for a short period of time and then continue on?

thanks for ANY help i can get on this. i am not a pro-actionscripter by any definition of the word, but i AM learning.

i can attach a sample file if you like.

[CS3] [AS2] 3D XML Carousel Using GotoAndLearn Tutorial
I am slowly building up a small carousel based on the gotoandLearn videos, but I've reached a point that I'm stumped. This is the tutorial itself:

http://www.gotoandlearn.com/play?id=33

This is my code so far, first is the AS2, second XML:


Code:
var numOfItems:Number;
var radiusX:Number = 320;
var radiusY:Number = 90;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/3.2;
var speed:Number = 0.03;
var home:MovieClip = this;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("icon","icon"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.icon.inner.loadMovie(nodes[i].attributes.images);

}
}

xml.load("icon.xml");

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

this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/9500;
}

Code:
<icons>

<icon images="icon1.png" tooltip = "Knowledge"/>

<icon images="icon2.png" tooltip = "Logic"/>

<icon images="icon3.png" tooltip = "Focus"/>

<icon images="icon4.png" tooltip = "Speed"/>

</icons>
It so far seems to be recognizing the XML file, when it loads there are four rotating "inner" objects... however, the actual .png files are not loading into place like they should. I've followed the tutorial near-exactly, leaving out a few things such as the reflection effect and tooltip which will not be used in my own final version. The outer movie is named "item" with an instance name of "icon", while the inner movieclip is named "inner" with an instance name of "inner" What is going on?

Carousel 2 Tutorial Issue.
Hello everyone and Merry Christmas!(Yeah I know, I'm late)

Well. In order to train and familiarize myself to flash (Macromedia flash professionnal 8 version), I decided to follow and put in application the Carousel 2 tutorial.

Everything worked fine since my last carousel swf build. My main problem is that the text is not displayed in the tooltip box. And I don't know why. My code seems to be nearly the exact copy of the one's which is given in the tutorial, but the tooltip box remains empty. A notice: When I put the text to "static", it is shown, not the case when I check "dynamic". Here is my actionscript code:

Code:

import mx.utils.Delegate;

var numOfItems:Number;
var radiusX:Number = 280;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.05;
var perspective:Number = 100;
var home:MovieClip = this;


var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;

var xml:XML = new XML();
xml.ignoreWhite = true;
xml.load("icons.xml");

xml.onLoad = function()
{
  var nodes = this.firstChild.childNodes;
  numOfItems = nodes.length;
  for(var i=0;i<numOfItems;i++)
   {
     var t = home.attachMovie("item","item"+i,i+1);
     t.angle= i* ((Math.PI*2)/numOfItems);
     t.onEnterFrame = mover;
    t.toolText = nodes[i].attributes.tooltip;
    t.icon.inner.loadMovie(nodes[i].attributes.image);
    t.ref.inner.loadMovie(nodes[i].attributes.image);
    t.icon.onRollOver = over;
    t.icon.onRollOut = out;
   }
}

function over()
{
   home.tooltip.tipText.text = this._parent.toolText;
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y - this._parent._height/2;
   home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
   home.tooltip._alpha = 100;
}

function out()
{
   delete home.tooltip.onEnterFrame;
   home.tooltip._alpha = 0;
}

function moveTip()
{
   home.tooltip._x= this._parent._x;
   home.tooltip._y= this._parent._y - this._parent._height/2;
}

function mover()
{
   this._x = Math.cos(this.angle)* radiusX + centerX;
   this._y = Math.sin(this.angle)* radiusY + centerY;
   var s:Number = (this._y - perspective) / (centerY+radiusY - perspective);
   this._xscale = this._yscale = s * 100;
   this.angle += this._parent.speed;
   this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
   speed = (this._xmouse-centerX)/2500;
}


Here is my xml code:

Code:

<icons>

<icon image="earth.png"   tooltip="Reseau" />
<icon image="add.png"     tooltip="Ajouter" />
<icon image="del.png"     tooltip="Supprimer" />
<icon image="members.png" tooltip="Membres" />
<icon image="seek.png"    tooltip="Rechercher" />
<icon image="help.png"    tooltip="Aide" />
<icon image="email.png"   tooltip="Email" />
<icon image="home.png"    tooltip="Accueil" />

</icons>


Can someone help me find the "bug" please? Thanks in advance and sorry if the problem have already been posed (I made a search but find nothing related to my issue...).

Edit: I searched more and I downloaded the carousel2 version of the tutorial. Seems that the issue was bound to my tooltip movie clip. The way I made it was obviously wrong. I need to train myself more. Sorry to have bothered.

P.S: M.Lee, Thank you very much for your effort. I know this is not so simple to make such tutorials. Hope there were more people like you on the net.

Converting Carousel Tutorial From 2 To 3.0. Help?
Hello,
I am trying to convert the great carousel tutorial on this site (carousel 1:simple found here http://www.gotoandlearn.com/player.php?id=32) from ActionScript 2 to ActionScript 3.0 using classes.

I am at the end of converting the first tutorial from as2 to classes in as3 and I am having one small problem with the individual items not seeing the angle.

Any help in advance would be appreciated, as I am somewhat new to as3.

Oval.as creates a ball and rotates it in an oval.
Ball.as is the ball class.

Ball code:
Code:

package {
   import flash.display.Sprite;
   
   public class Ball extends Sprite {
      private var radius:Number;
      private var color:uint;
      
      public function Ball(radius:Number = 40, color:uint=0xff0099) {
         this.radius = radius;
         this.color = color;
         init();
      }
      public function init():void {
         graphics.beginFill(color);
         graphics.drawCircle(0, 0, radius);
         graphics.endFill();
      }
   }
}

Oval code:
Code:

package {
   import flash.display.Sprite;
   import flash.events.Event;
   
   public class Oval extends Sprite {
      private var ball:Ball;
      private var carousel:Sprite;
      private var numOfItems:Number = 5;
      private var angle:Number = 0;
      private var centerX:Number = 200;
      private var centerY:Number = 200;
      private var radiusX:Number = 200;
      private var radiusY:Number = 100
      private var speed:Number = .1
      
      public function Oval () {
         init();
      }
      private function init():void {
         carousel = new Sprite;
         for (var i:Number = 0; i < numOfItems; i++) {
         ball = new Ball(40, 0xff6600);
         //addChild(ball);
         carousel.addChild(ball);
         //ball.name = (String("ball") + i);
         var angle:Number = i * ((Math.PI * 2) / numOfItems);
         addEventListener(Event.ENTER_FRAME, onLoop);
         }
         addChild(carousel);
         
         
      }
      
      public function onLoop(e:Event):void {
         e.currentTarget.x = centerX + Math.sin(angle) * radiusX;
         e.currentTarget.y = centerY + Math.cos(angle) * radiusY;
         e.currentTarget.angle += speed;
      }
   }
}

If anyone could help it would be greatly appreciated.

thanks!

Expanding The Carousel Tutorial
Hi,

how would I expand the Carousel tutorial to include a link, underneath each descriptive dynamic text box, to take the user to another page/site.
A unique link for each icon.

K

Beginner Carousel Tutorial?
newbie here i would like to find a tutorial to do a simple carousel. i know nothing! is this possible?i can follow directions!

[split by admin]

Button In Carousel Tutorial?
I have used the tutorials to create the carousel. This works great. There is only one thing that I really would like to accomplish but haven't been able to yet:

What happens now is that when you click on an item it moves to your left, and a text box becomes visible (as in the tut.). What I would like is to be able to click on a button there and go to a detailed php or html page on that subject.

So there must be a button, like 'more info' wich has an getUrl action, and that url will also be loaded in thru the xml.
It shouldn't be too hard, but i don't know how.....

any tips?

Carousel Tutorial 1 Question
First off, I must give props for the site; it is wonderful. It's really cool to learn how to do all these neat things with flash! Now, on to my question!

I was following the first carousel tutorial and came to a snag when it was time to start swapping depths. I am using ActionScript 3 and the swapDepths method has been removed. I know there is a swapChildren method now, but it only accepts display objects to swap around, not a specific target depth! I was wondering if anyone could show me a good way to keep the depths properly sorted using ActionScript 3.

I suppose one way would be to loop through all the items on stage and just compare scales and each time I find a new largest, swap it to the top (kind of like a bubble sort), but is there a better way to do it?

Update: well, i used the bubble sort technique and it seems to work pretty well, I just added another enter frame listener (this one to the mainTimeLine object (this)).

Code:

this.addEventListener(Event.ENTER_FRAME, sortItems);

function sortItems(evt:Event):void
{
   for( var i:int = 0; i < numOfItems - 1; i++)
   {
      for(var j:int = 1; j < numOfItems; j++)
      {
         var temp1:DisplayObject = this.getChildAt(j);
         var temp2:DisplayObject = this.getChildAt(j-1);
         if( temp1.scaleX < temp2.scaleX )
         {
            this.swapChildren(temp1, temp2);
         }
      }
   }
}

Adding another enter frame listener may not be the most efficient way of doing this, so I'm still open to any suggestions.

Carousel Tutorial Question
Hello all...

I have used the brilliant 'Carousel' tutorial to create a menu on frame 1 of my movie.

I have adapted it (as suggested on this forum) so that the carousel is populated by an array of 4 movie clips.

Code:

var items:Array = new Array();
items[0] = "option1_mc";
items[1] = "option2_mc";
items[2] = "option3_mc";
items[3] = "option4_mc";

The menu works perfectly and clicking on a different option takes you to a particular frame of my movie.

However, when the viewer returns to the main menu (frame 1) for a second time the carousel starts doing funny things and does not work properly.

Anyone know why? I was guessing that everytime the movie returns to frame 1, the movie clips in the carousel are given a slightly different name - but I'm just a beginner and could be completely wrong.

Here is the complete code on frame 1:

Code:

var items:Array = new Array();
items[0] = "option1_mc";
items[1] = "option2_mc";
items[2] = "option3_mc";
items[3] = "option4_mc";

var radiusX:Number = 250;
var radiusY:Number = 75;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;

for (var i:Number = 0; i < items.length; i++)
{
    var t = this.attachMovie(items[i], "b"+i, i+1);

    t.angle = i * ((Math.PI*2)/items.length);
    t.onEnterFrame = mover;
}

function mover()
{
   this._x = Math.cos(this.angle) * radiusX + centerX;
   this._y = Math.sin(this.angle) * radiusY + centerY;

   var s = this._y /(centerY+radiusY);

   this._xscale = this._yscale = s*100;
   this.angle += this._parent.speed;
   this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
   speed = (this._xmouse-centerX)/1500;
}

Sorry for such a long question and thanks for any help you can give,

David

XML HYPERLINKS In The CAROUSEL 3 TUTORIAL
I want to be able to add a hyperlink to a website that would open in a new window as part of the "content". When you click on one of the icons that spins on the carousel, and you get the larger body of text, i want to be able to embed a hyperlink to a webpage, and if possible add some "bold" and "italic" text styles. Does anyone know how to do this. here is the original code cut a bit out for space:

Code:

<icons>

<icon image="icon1.png" tooltip="LimeWire" content="LimeWire is a peer-to-peer file sharing client for the Gnutella network." />

<icon image="icon2.png" tooltip="Rubik's Cube" content="Rubik's Cube is a mechanical puzzle invented in 1974 by the Hungarian sculptor and professor of architecture Erno Rubik." />

<icon image="icon3.png" tooltip="Widgets" content="A widget (or control) is an interface component that a computer user interacts with, such as a window or a text box." />

</icons>

Carousel Tutorial + Scrollbar
I'm trying to get a scrollbar to work with the carousel tutorial but I can't figure out a way to have the scrollbar work with the XML loaded script. I need help!

Question From Carousel Tutorial 2
Hello all,

after watching Carousel Tutorial 2 I realized i have no idea how to create the XML file Lee was using to import the graphics for the carousel. Can anyone assist me or point me to a good website or tutorial for explanation? Your help is much appreciated. Thanks.

Carousel Tutorial Question
I have the Carousel made up of 3D cubes made in a 3D program. There are 39 frames in the cube itself which reveal each side of the cube in the 39 frames. Now what I'm trying to do is when the Carousel spins it should play through those 39 frames showing each side depending on where it is on its y value. Just like how the scale does it with the s value.
I tried this line of code

Code:

   var s = this._y/(centerY+radiusY);
   this._xscale = this._yscale=s*100;
   var cubeSpin=Math.round(s*this._totalframes);
   trace(cubeSpin);


The problem is "s" does not go from 1 to 39 its numbers are high.
How can I get this to run through the 39 frames smoothly? Showing the correct side of the cube when it?s at the back or the front of the Carousel



Second question

In order for to get my Carousel to be on the correct plane I had to adjust my var radiusY:Number = 30; and my var centerY:Number = 400; numbers. now by doing this the s value now does not scale the cubes at the back. Here is the swf to see what is happening

VIEW SWF FILE

As you can see the back cubes are the same size as the front cubes.

Any help would be appreciated

Question About Carousel Tutorial On GotoAndLearn
there is a three part series tutorial on building a sleek carousel withdrawing icons from xml file (Creating 3D Carousels III - http://www.gotoandlearn.com/download.php )

If you are familiar with this, the tutorial only covers showing text information along with the picture icon. What would be very cool is to have is show a movie clip when you clicked on an icon. Then is would be a full flash site, and a really cool one.

Here I am attaching the full action script that I got from the tutorial, so if you have an idea how to show a movie clip on clicking an icon, it would be great. I am a newbie to actionscript, so any help would be appreciated.


Code:
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;

var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 60;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.05;
var perspective:Number = 130;
var home:MovieClip = this;
theText._alpha = 0;


var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for (var i=0; i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.ref.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}


function over()
{
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2.5;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
}


function out()
{
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}


function released()
{
home.tooltip._alpha = 0;
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,100,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
{
s.onRelease = unReleased;
}
}
}
}


function unReleased()
{
delete this.onRelease;
var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
{
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
t.onEnterFrame = mover;
}
}
}
}
}


function moveTip()
{
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2.5;
}


xml.load("icons.xml");


function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = (this._y - perspective) / (centerY+radiusY-perspective);
this._xscale = this._yscale = s * 100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/10000;
}

Building A 3D Carousel Using A Tutorial As Base
I am building the 3D carousels in the gotoandLearn.com video tutorials, however at the moment I'm utterly stuck. The code is AS2:

Code:
var numOfItems:Number;
var radiusX:Number = 320;
var radiusY:Number = 90;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/3.2;
var speed:Number = 0.03;
var home:MovieClip = this;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("icon","icon"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.icon.inner.loadMovie(nodes[i].attributes.image);

}
}

xml.load("icon.xml");

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

this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/9500;
}
In tests, this works except for a problem - it sees the XML file, but does not load the actual .png graphics. The graphics are located in the same directory, and all the linkage properties are set correctly. I get four floating basic images in the carousel (there are four nodes)..nothing else, however.

Copyright © 2005-08 www.BigResource.com, All rights reserved