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.
Actionscript 2.0
Posted on: Thu Oct 05, 2006 7:33 pm
View Complete Forum Thread with Replies
Sponsored Links:
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
View Replies !
View Related
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.
View Replies !
View Related
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.
View Replies !
View Related
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
View Replies !
View Related
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
View Replies !
View Related
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 !
View Replies !
View Related
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.
View Replies !
View Related
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!
View Replies !
View Related
[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?
View Replies !
View Related
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.
View Replies !
View Related
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!
View Replies !
View Related
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?
View Replies !
View Related
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.
View Replies !
View Related
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
View Replies !
View Related
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>
View Replies !
View Related
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.
View Replies !
View Related
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
View Replies !
View Related
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;
}
View Replies !
View Related
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.
View Replies !
View Related
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.
View Replies !
View Related
Carousel/Panning Camera Tutorial
Had fun doing the Carousel Tutorial in flash 8,
Was wonder:
1-How do I make it show Many different images
2-When mouse runs over images as buttons it does funky things
Can anyone help or does anyone know of a more commercial use of that tutorial?
Thanks
Osiyo
View Replies !
View Related
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.
View Replies !
View Related
Animating Dynamically Loaded Mcs/lee Brimlows Carousel Tutorial/calling The Pros
hiya,
i followed lee brimlows excellent carousel tutorial and i am wondering how to animate dynamically loaded mcs in that tutorial before the main animation, which is basically a carousel of dynamically loaded icons that rotate in a circle depending on where the mouse is, starts.
what i am aiming at is to have a sort of fountain-like animation before the main thing starts; in that way that the icons not just 'appear' on the stage, but are animated from 0, 0 to their position on the carousel.
i have the proper classes for the curved fountainlike animation (MCTween classes), but i don't know where to put the code in the actionscript, for i am not that good at actionscript to grasp what is going on.
i know that this:
Code:
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.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}
is the part of the code where the icons are dynamically created and the functions are called, and i guess i have to squeeze this code (created by myself; probably wrong), which i think could be the correct one to achieve what i am looking for, into:
Code:
function fountain()
{
this.xposition = Math.cos(this.angle) * radiusX + centerX;
this.yposition = Math.sin(this.angle) * radiusY + centerY;
this.bezierSlideTo(0, 200, this.xposition, this.yposition, 1, "easeInOutQuint", 1, undefined, undefined, undefined);
}
the problem is i don't know where to put it in.
though i don't have a problem with the tween class, i thought i might give reference to it:
the bezierSlideTo is a MCTween class. the syntax is:
<MovieClip|TextField>.bezierSlideTo(control point x, control point y, x, y [, seconds, animation type, delay, callback, extra1, extra2]);
http://hosted.zeh.com.br/mctween/
i attached the original tutorial files from gotoandlearn.com. due to filesize limitations, i split the folder in three. just put everything in one folder and you'll be shiny.
this is the link to the video tutorial:
http://www.gotoandlearn.com
i am not letting you do the work; this is just a desperate call for help. i tried everything i know to get this idea to work, but due to my limited knowledge can't come up with the solution (which is probably pretty easy); and i decided to ask for help before pulling any more hair out...
the guys at the gotoandlearn forum couldn't help, by the way.
any help is greatly appreciated!
cheers,
dual
this is the actionscript used in the tutorial:
Code:
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 75;
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.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}
function over()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sover");
sou.start();
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 released()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
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,320,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()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
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;
}
xml.load("icons.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (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;
}
View Replies !
View Related
Photo Gallery Tutorial Turned Into Photo Carousel
i've taken the tutorial on this site on how to create an flash photo gallery that loads the content from an xml file. i'd like to alter the output of this fine tutorial and would appreciate any help in doing so.
i would like to create gallery, but instead of only showing one picture at a time, i would like to have a carousel effect where more than one picture is shown at a time, and the buttons control the turn of the carousel. i'm thinking in order to do this i'll need to have the as create a movie clip for each picture (maybe during the for loop). each mc instance would have to have a unique name, and then the buttons could play with the properties of each created mc instance.
here's the code from the tutorial on this. any help would be much appreciated....
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
View Replies !
View Related
Help On "creating 3d Carousel" Tutorial
Hey guys!
This site is awesome! I am no AS expert, so I am learning (or at least trying to learn) a lot!
I´ve got some problems regarding the "creating a 3d carousel" tutorial. I would like it to be vertical, and I´ve managed it to do so. However, when I´ve rotated it, the balls are upscalling when they are through the middle-right section of the orbit. I can´t make it upscale when they are on the middle-left section of the orbit...
can you guys give me a hand?
Here is the code so far.
Code:
var numOfBalls:Number = 10;
var radiusX:Number = 150;
var radiusY:Number = 250;
var centerX:Number = Stage.width / 4;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
for(var i=0;i<numOfBalls;i++)
{
var t = this.attachMovie("ball","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._x /(centerX+radiusX);
this._yscale = this._xscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._yscale) + 100);
}
this.onMouseMove = function()
{
speed = (this._ymouse-centerY)/1500;
}
Thanks in advance!!!
View Replies !
View Related
To The Tutorial Writing Staff: XML Portfolio Tutorial
Hi guys!
I'm a basic actionscript user which knows the basics of xml and actionscript. I've been seaching for a tutorial for a long time now how to make a portfolio which is dynamic and loads info from an external .xml file.
Since i couldn't find any tutorial like this i've tryed to make my own script out from this xml file:
Code:
<portfolio thumburl="thumbs/" imgurl="images/">
<project hdline="my first project" client="none" date="2007-01-02" category="website" weburl="http://website.com">
<image url="image1.jpg"/>
<image url="image2.jpg"/>
<image url="image3.jpg"/>
<description><![CDATA[This describes my first project]]></description>
</project>
</portfolio>
I have hade in mind that you should see a bunch of thumbnails first in a table format (like 6 cols and 3 rows) on each page, then you should be able to select page with next and prev buttons. When you press on a thumnail a box with the bigger image shuld pop-up and you should be able to read the other information in the xml file (such as client, date etc etc).
I've tryed to make this but it's to advanced. And my version is very buggy, aswell.
Here is what i've done sofar:
www.vmgcomputers.com/xml/portfolio3.swf
I don't know if this helps but here is a "multiple loader" i found:
http://www.johnnyslack.com/content/d...der_jslack.zip
I think there are many guys who are looking for a tutorial about this so please consider to make one, all professionals out there!
View Replies !
View Related
Carousel Help
i am creating a Carousel effect (found here: www.gotoandlearn.com), but am not implementing any mouse interaction with it, it is a straight forward loop. i need help in two areas.
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)?
Q2: Is it possble to make the objects pause at the front for a short period of time?
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.
View Replies !
View Related
Could Someone Please Help With Carousel
hey, i have downloaded this free carousel:
http://www.flashmo.com/preview/flashmo_056_carousel
i have customized it all fine with the way i would like it,
however, when clicking on a different button to go to a different frame, the initial frame that loads the icons and text in, still shows up on all frames, yet it is only on one frame,
Can anyone help me to unload or remove it so that it only loads once on that frame i put it on>?
im fairly new to flash so sorry if im stupid
thanks heaps,
here is the action script, it's 2.0
Code:
stop();
var total:Number = 6;
var label_list:Array = new Array( "1", "2", "3", "4", "5");
var radiusX:Number = 300;
var radiusY:Number = 70;
var centerX:Number = 400;
var centerY:Number = 110;
var speed:Number = 0.005;
tn_group_mc._visible = false;
info.text = ""; fm_label.text = "";
this._y = centerY + 230;
this._x = centerX - 400;
fm_label._y = centerY + 270;
fm_label._x = centerX - 340;
for( var i = 0; i < total; i++)
{
var t = tn_group_mc.duplicateMovieClip("tn"+i, i);
t.tn_mc.gotoAndStop(i+1); t.tn_shadow_mc.gotoAndStop(i+1);
t.fm_label = label_list[i];
t.angle = i * ((Math.PI*2)/total);
t.onEnterFrame = mover;
t.tn_mc.onRollOver = function()
{
fm_label.text =this._parent.fm_label;
}
t.tn_mc.onRollOut = function()
{
info.text = ""; fm_label.text = "";
}
}
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*130;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX) * 0.0001;
}
PLEASE HELP ME IT"S URGENT
View Replies !
View Related
2D Carousel
Right, I'm needing some help here folks, basically I'm setting up a website and I would like a sliding window effect in flash as part of the navigation in one area.
This is the idea http://www.htc.com/www/product.aspx
So far It's nearly working perfectly using some code from another project but it needs tweaked, I've looked Google to see about X/Y coordinates etc but can't find the right code or even know what to look for.
Basically the page consists of 2 arrows one on the right and one on the left, these slide pages from right to left or left to right depending on the arrow clicked. Unfortunately the code I'm using relied on 4 buttons to change the X Coordinates to slide the windows into place under the masked area. I now only have two buttons to do the same job and they only let me go between page 1 & 2, so I don't want to specify coordinates but rather add/subract to/from the current coordinates to get to the next/last window.
Anyone able to help me out or point me towards a tutorial?
Here is the code:
onClipEvent (load) {
_x = 0;
_y = 0;
spd = 4;
}
onClipEvent (enterFrame) {
_x += (endX-_x)/spd;
_y += (endY-_y)/spd;
_root.leftclick.onRelease = function() {
endX = 0;
endY = 0;
};
_root.rightclick.onRelease = function() {
endX = -800;
endY = 0;
}
}
Thanks in advance
View Replies !
View Related
Carousel
I'm working on a simple 3d carousel, reading from an xml file, but i cannot get the text tags that pop above the pictures to rotate with the items in the carousel. I'm following a tutorial based on MX, and believe it might be a problem with the mx.utils.Delegate function that i'm importing. help a brother out...
the function that is not working, as well as the code concerning delegation are bolded below, everything else is functioning properly.
Code:
import mx.utils.Delegate;
var numOfItems:Number = 10;
var radiusX:Number = 250;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2 - 35
var centerY:Number = Stage.height/2
var speed:Number = 0.02;
var perspective:Number = 0;
var home:MovieClip = this;
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.icon.inner.loadMovie(nodes[i].attributes.image);
t.reflection.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;
}
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) /3500;
}
View Replies !
View Related
Carousel
hi all,
I've built up a carousel from Lee's tutorial. What he has done is he's fetching images from an XML file and when you click on a thumbnail it shows up the details.
Instead of this I want to fetching images by passing a query to the swf file.
eg:carousel.swf?pic1=1.jpg&pic2=2.jpg&... and so on. And when you click on a thumbnail instead of showing up the details I want to direct it to it's corresponding page.
Please download the source files.
Dowload the source files
Your help is highly appreciated.
Thanks very much.
Regards,
Soulfly
View Replies !
View Related
Carousel...
Hi!
I'm trying to make a vertical carousel and another horizontal working at the same time.
I've followed a tutorial on the net and now it works horizontally with this code:
import mx.utils.Delegate;
var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 50;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.05;
var perspective:Number = 50;
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("item","item"+i,i+1);
t.angle = i*((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
};
xml.load("icons.xml");
function mover() {
this._x = Math.cos(this.angle)*radiusX+centerX;
this._y = Math.sin(this.angle)*radiusY+centerY;
var s = (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)/8000;
};
When I change X and x for Y and y it works on vertical and it's ok.
The problem is that I can't put both of them working together at the same time...what is the problem? I was thinking that probably was because of the var home:MovieClip = this;but I don't know how to solve it.
Thanks a lot.
View Replies !
View Related
3D Carousel Bug?
http://www.celestrialrealms.com/indextest.html
The FACTIONS link.
Why's the <item> movieclip appearing for an instant in the upper left?
Code:
var numOfItems:Number = 4;
var radiusX:Number = 210;
var radiusY:Number = 156;
var centerX:Number = 420;
var centerY:Number = 313;
var speed:Number = 0.05;
var perspective:Number = 200;
for (var i=0;i<numOfItems;i++)
{
var t=this.attachMovie("item","item"+i,i+1);
t.angle=i*((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
}
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = (this._y - perspective) / (radiusY + centerY-perspective);
this._xscale = this._yscale = this._alpha = s * 100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale)+100);
}
The carousel is an external swf being loading into an empty movieclip.
Help
View Replies !
View Related
Carousel
Hello. Im trying to make a carouse for my website, in that carousel i want a picture in the middle and the icons around it to move in a way that they look 3d, meaning they never show the side but only the front. I am using the code from other carousel but that carousel when the icons are in the far right or far left turn and show the sides and look like plain pictures. How can i make them 3d? this is part of the code, i think this is what makes the carousel, i will appreciate a lot your help. Thanks!
// user transforms
if (pressv!=0) {
this.panel+=pressv;
pressv=pressv*.9;
if ((pressv<.2) && (pressv>-.2)) {
pressv=0;
}
}
// 3d transforms
theta+=_parent.speed;
xbit=Math.sin(Math.PI/180 * theta);
ybit=Math.cos(Math.PI/180 * theta);
this._xscale=ybit*this.panel;
this._x=xbit*this.radius;
this._alpha=20+(ybit+1)*50;
this._yscale=this.panel+ybit*1;
stack=Math.round((ybit+1)*radius*.5);
if (stack==100) {
stack=100;
}
this.swapDepths(stack);
View Replies !
View Related
Carousel
I have a photo scroller built with CS3 and actionscript. It uses XML to load images for the thumb-scroll portion. I'd like to know if there is a quick fix to make the picstrip seem to a carousel - in other words, the strip would just continue to scroll whether you moused left or right.
View Replies !
View Related
Another Carousel
Here
For a client, added distance blur, enhanced reflections, blah etc. Recently updated to use similar code from gotoandlearn, since that carousel was moderately better written than mine *ouch* in some parts, particularly the onEnterFrame model (hence it's about 50% faster too)
Reckon it's too fast? Tell me how badly this needs a stabbin'
PS. It's not actually this size in the clients interface, this merely shows that it's totally vector.
View Replies !
View Related
Carousel Help
Hello,
I've been working with the carousel tutorial from gotoAndLearn(). I understand the math after a lot of effort not being a programmer, but I still need help. Instead of the default continuous scrolling of the icons dependent on the mouse position, I want a button navigation system to move through each icon. So the bottom arrow buttons on the attached .fla would navigate and scroll each icon one at a time (each click). Any ideas on how to do this? thanks in advance
View Replies !
View Related
Carousel Help
Hello all!
I'm hoping you can help me out. I've done a carousel tutorial and everything is working fine except that I'm playing with the depth. And now one of my movies which is supposed to work, comes out below the other... see here for example go to Articles:
http://www.africandancelady.com
Can anyone help with it and tell me how to make the depht of the object come forward over the other?
Any help would be greatly appreciated! Thanks
View Replies !
View Related
Carousel Help
One request, I just want to know how to put an object in the center of this so it truly looks 3D. Right now, I've only figured out how to put the object either in front of or behind the carousel. Any advice would be great, thanks.
As well, if anyone has any input for things to make the carousel more unique, I'm open for suggestions. This script has been making the rounds on the web, it's useful, but I want to push it further. I'm just not very good with AS yet...
View Replies !
View Related
AS3 Carousel Help
Hi,
I have been doing the carousel tutorial by Lee Brimelow from gotoAndLearn.com, 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:
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);
}
Many thanks
Chris
View Replies !
View Related
Carousel
Hi everybody
I have seen a great "animation" on this website : www.finaref.fr/etapes-du-credit.asp
I wish use it for my personel website, could you help me to creat it, could you please give me steps?
You can see what i want with this link : www.finaref.fr/etapes-du-credit.asp
Thank you in advance
Josiane (sorry for my poor inglish)
View Replies !
View Related
Carousel Help
I have used the tutorial from gotoandlearn.com to create a carousel. I have modified it so that it does not spin until the mouse actually moves however its terribly chunk and I have realised that it doesn't really do what I want it to do.
so
I have a circle of items and I want it so they dont move until you click on one of the words it moves to the front in a clock wise motion, im totally lost, here is the action script.
items contains a dynamic textfield with the word in it.
Quote:
var numOfItems:Number = 10;
var radiusX:Number = 232;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.05;
var moving:Boolean = true;
var boxes:Array = new Array();
//math.PI is equal to the radium of 360 degrees devided by the number of items.
for(var i=0;i<numOfItems;i++)
{
var t = this.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = setPos;
boxes.push(t);
t.onRelease = clicked;
}
//cos = angle which presents the ratio of the sides of item x axis
//sin = angle which presents the ratio of the sides of item y axis
function clicked()
{
trace("pos"+this.angle);
}
function stopMoving()
{
moving = false
trace("timer")
clearInterval(stopTimer);
}
function mover()
{
for(var i=0;i<numOfItems;i++)
{
boxes[i].angle += boxes[i]._parent.speed;
}
}
function setPos()
{
if(moving)
{
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.swapDepths(Math.round(this._xscale) + 100);
}
}
this.onMouseMove = function()
{
mover();
speed = (this._xmouse-centerX)/1500;
}
var stopTimer = setInterval(this, stopMoving, 100);
View Replies !
View Related
Carousel Help
I am following the tutorials on gotoLearn.com and I need some help loading a large image and transitioning. In the last tutorial I followed I got the small thumb nail image in the carousel to slide off to the left and some text to appear. But now when the thumb nail image slides over I need a larger image to appear. Has anyone worked on this tutorial and might be able to help?
View Replies !
View Related
Carousel As2 To As3
hi
first of all i'd like to thank you for all the tutorials i can find here.
lastly i've been playing with your carousel tut and been porting it to as 3. i'm somewhere in the middle of 3rd video and i cant get the animation to work properly erm i think that link will just fit nice you'll see what im talking about.
http://szela93.0fees.net/Flash/Carousel2/
and here's the code
Code:
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 400;
var radiusY:Number = 150;
var centerX:Number = stage.stageWidth/2;
var centerY:Number = stage.stageHeight/2;
var speed:Number = 0.05;
theText.x = stage.stageWidth;
theText.y = stage.stageHeight;
theText.alpha = 0;
var tooltip = addChild(new ttip());
tooltip.name = "tooltip";
tooltip.scaleX = tooltip.scaleY = 0.4;
tooltip.alpha = 0;
var follower:MovieClip;
stage.addEventListener(MouseEvent.MOUSE_MOVE, setSpeed);
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("list.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void {
myXML = new XML(e.target.data);
numOfItems = myXML.*.length();
for (var it=0;it<numOfItems;it++)
{
var t=stage.addChild(new item());
t.name = "item" + it;
trace(myXML.ICON[it].@URL);
t.ref.mask = t.masker;
t.angle = it*((Math.PI*2)/numOfItems);
t.addEventListener(Event.ENTER_FRAME, mover);
var i =new Loader();
i.load(new URLRequest(myXML.ICON[it].@URL));
t.icon.addChild(i)
var i2 =new Loader();
i2.load(new URLRequest(myXML.ICON[it].@URL));
t.ref.addChild(i2)
t.tooltext = myXML.ICON[it].@TIP;
t.acttype = myXML.ICON[it].@CLICKEFFECT.toString();
t.actcontent = myXML.ICON[it].@CLICKCONTENT;
t.btnPuppet.addEventListener(MouseEvent.ROLL_OUT, out);
t.btnPuppet.addEventListener(MouseEvent.ROLL_OVER, over);
t.btnPuppet.addEventListener(MouseEvent.MOUSE_UP, released);
}
}
function released(e:MouseEvent)
{
switch (follower.acttype)
{
case "navigate":
navigateToURL(new URLRequest(follower.actcontent));
break;
case "description":
tooltip.alpha=0;
tooltip.x=stage.stageWidth;
tooltip.y=stage.stageHeight;
for (var i = 0;i<numOfItems;i++)
{
out(null);
var t:Object = stage.getChildByName("item" + i);
t.xPos = t.x;
t.yPos = t.y;
t.theScale = t.scaleX;
t.removeEventListener(Event.ENTER_FRAME, mover);
t.btnPuppet.removeEventListener(MouseEvent.ROLL_OUT, out);
t.btnPuppet.removeEventListener(MouseEvent.ROLL_OVER, over);
t.btnPuppet.removeEventListener(MouseEvent.MOUSE_UP, released);
if (t != e.target.parent)
{
var twe1:Tween = new Tween(t,"scaleX",Strong.easeOut,t.scaleX,0,1,true);
var twe2:Tween = new Tween(t,"scaleY",Strong.easeOut,t.scaleY,0,1,true);
var twe3:Tween = new Tween(t,"alpha",Strong.easeOut,1,0,1,true);
}
else
{
var tw1:Tween = new Tween(t,"scaleX",Strong.easeOut,t.scaleX,1,1,true);
var tw2:Tween = new Tween(t,"scaleY",Strong.easeOut,t.scaleY,1,1,true);
var tw4:Tween = new Tween(t,"x",Strong.easeOut,t.x,167.3,1,true);
var tw5:Tween = new Tween(t,"y",Strong.easeOut,t.y,313.0,1,true);
var tw6:Tween = new Tween(theText,"alpha",Strong.easeOut,0,1,1,true);
theText.x = 307;
theText.y = 146.5;
theText.text = t.actcontent;
t.addEventListener(MouseEvent.MOUSE_OVER, twMotionFinishEvt);
}
}
break;
}
}
function twMotionFinishEvt(e:MouseEvent)
{
e.target.removeEventListener(MouseEvent.MOUSE_OVER, twMotionFinishEvt);
e.target.addEventListener(MouseEvent.MOUSE_UP, unreleased);
}
function unreleased(e:MouseEvent)
{
e.target.removeEventListener(MouseEvent.MOUSE_UP, unreleased);
var tw:Tween = new Tween(theText,"alpha",Strong.easeOut,1,0,.5,true);
for (var i = 0;i<numOfItems;i++)
{
var t:Object = stage.getChildByName("item" + i);
if (t != e.target.parent)
{
var twe1:Tween = new Tween(t,"scaleX",Strong.easeOut,0,t.theScale,1,true);
var twe2:Tween = new Tween(t,"scaleY",Strong.easeOut,0,t.theScale,1,true);
var twe3:Tween = new Tween(t,"alpha",Strong.easeOut,0,1,1,true);
}
else
{
var tw1:Tween = new Tween(t,"scaleX",Strong.easeOut,1,t.theScale,1,true);
var tw2:Tween = new Tween(t,"scaleY",Strong.easeOut,1,t.theScale,1,true);
var tw4:Tween = new Tween(t,"x",Strong.easeOut,167.3,t.xPos,1,true);
var tw5:Tween = new Tween(t,"y",Strong.easeOut,313.0,t.yPos,1,true);
t.removeEventListener(MouseEvent.MOUSE_UP, unreleased);
for (var it = 0; it < numOfItems; it++)
{
var te:Object = stage.getChildByName("item" + it);
te.addEventListener(Event.ENTER_FRAME, mover);
te.btnPuppet.addEventListener(MouseEvent.ROLL_OUT, out);
te.btnPuppet.addEventListener(MouseEvent.ROLL_OVER, over);
te.btnPuppet.addEventListener(MouseEvent.MOUSE_UP, released);
}
theText.x = stage.stageWidth;
theText.y = stage.stageHeight;
theText.alpha = 0;
}
}
}
function out(e:MouseEvent)
{
tooltip.removeEventListener(Event.ENTER_FRAME, moveTip);
tooltip.alpha = 0;
tooltip.tiptext.text="";
}
function over(e:MouseEvent)
{
tooltip.tiptext.text = e.target.parent.tooltext;
tooltip.x = e.target.parent.x;
tooltip.y = e.target.parent.y - e.target.parent.height/2;
tooltip.addEventListener(Event.ENTER_FRAME, moveTip);
follower = e.target.parent;
tooltip.scaleX = tooltip.scaleY = 0.7 * (follower.y / (centerY + radiusY));
tooltip.alpha = 1;
}
function moveTip(e:Event)
{
tooltip.scaleX = tooltip.scaleY = 0.7 * (follower.y / (centerY + radiusY));
tooltip.x = follower.x;
tooltip.y = follower.y - follower.height/2;
}
function mover(e:Event)
{
var t = e.target;
t.x = Math.cos(t.angle) * radiusX + centerX;
t.y = Math.sin(t.angle) * radiusY + centerY;
var s:Number = (t.y / (centerY + radiusY));
t.scaleX = t.scaleY = s;
t.angle += speed;
parent.setChildIndex(t,1);
sortItems()
}
function sortItems():void
{
for( var i:int = 0; i < numOfItems - 1; i++)
{
for(var j:int = 1; j < numOfItems; j++)
{
var temp1:DisplayObject = stage.getChildAt(j);
var temp2:DisplayObject = stage.getChildAt(j-1);
if( temp1.scaleX < temp2.scaleX )
{
stage.swapChildren(temp1, temp2);
}
}
}
}
function setSpeed(e:MouseEvent)
{
speed = (stage.mouseX - centerX)/(radiusX * 15);
}
i've tried to make it like tutorial says (i mean adding eventlistener to tween) but that gave me even more glitches and bugs so im stuck now.
thanks in advance
View Replies !
View Related
|