Attach Movie Clips To A Circular Path - Spaced Equally
Hi,
Does anyone know if it's possible to attach movie clips to a circular path? (see attached)
cheers
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-02-2008, 10:24 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamically Adding Spaced Out Movie Clips From The Library [renamed]
I would like to do something i've never tried before so i am seeing if anyone has any ideas on how to do it.
What I would like to do is to create duplicate movieclips based on the number of jpegs I have in my libary for a picture gallary I am creating. (I have like 600 of them so I dont want to load them manually). For example I have jpegs 001 thru 012. I would like to have these jpeg files in my flash libary and then have them load up into the movieclips automaticly 001 thru 012. Each of these movie clips will need to load up spaced out horizonally beside each other. and in turn each movieclip will also be a button to load up the picture into a larger view area. I just dont want to have to insert all of the mini jpeg pictures so I would like to have them load in automaticly thru coding upon start of the flash exe.
I am guessing I will need to use duplicate movie clip with a counter and load the jpeg in sequence from the libary. But I am just not sure on the code to do this.
Thanks for any help
Path Problems Using Attach Movie
with the help of a few of you here is have gotten this far. what i am trying to do is have this function below attach a movie clip and position it, using a function executed by different buttons. so far it works:
PHP Code:
//this works, attached clip, and moves it
function setNames(theClip, NewName, xPos, yPos) {
_root.attachMovie(theClip, NewName, 5);
_root[NewName]._x = xPos;
_root[NewName]._y = yPos;
}
button1.onRelease = function() {
setNames("linkName1", "newClipName", 40, 257);
}
the clip it attached has another button inside that one. the clip attached should have the name "newClipName", right? the following does not target the button inside the attached clip:
PHP Code:
newClipName.nestedClip.onRollOver = function() {
this.alphaTo(55, 1);
};
doesnt work. am i using correct path here? i traced to see if the clip exists on stage and it does.
thanks for your help!
Multiple Clips Keep Horizontally Evenly Spaced After Change Speed
I've been struggling with this for days.
I am trying to imitate the text effect from this website:
http://www.bale.com.au/home.php
I can't keep the movie clips spaced evenly once I change the speed of movement on the x coordinate.
This my code:
Quote:
/////////////////////////////////// Text related scripst
function placeText(target:MovieClip, x:Number, y:Number, banner:String, tFormat:TextFormat, effectFunction:Function, delay:Number):Void {
// For each character...
var my_array:Array = banner.split("/");
for (var i = 0; i<my_array.length; i++) {
// Create a clip and place the current
// character in the text field inside it.
var char:MovieClip = this.attachMovie("letter", "char"+i, textNumber+i);
//char.field.text = banner.substr(i, 1);
//char.field.autoSize = true;
char.field.text = my_array[i];
char._x = x;
char._y = y;
// Add the width of the current text character to the
// next letter's x position.
x += (tFormat.getTextExtent(char.field.text).width)-40;
//
var theTextLength:Number = tFormat.getTextExtent(this["char"+(i-1)].field.text).width;
var theArrayLength:Number = my_array[i].length;
trace(theTextLength);
// Here is the effect function call, passed in as a parameter
// Here is the effect function call, passed in as a parameter
effectFunction(char, i*delay);
}
}
function slideText (target:MovieClip, delay:Number):Void {
target.interval = function() {
target.visible= true;
clearInterval (target.intervalID);
target.onEnterFrame = function() {
target._x -= acceleration;
if (Math.abs(target._x-target.startX)<1) {
acceleration = 4;
//delete target.onEnterFrame;
}
if (target._x<150) {
textSlide3(target, 0,-200);
//delete target.onEnterFrame;
}
};
};
target.intervalID = setInterval(target, "interval", delay);
target.startX = target._x;
target._x = 800;
//target._visible = false;
var acceleration:Number=(target._x-target.startX)/9;
}
function textSlide3(target:MovieClip, delay:Number,targetX:Number):Void {
target.interval = function() {
target._visible = true;
clearInterval(target.intervalID2);
target.onEnterFrame = function() {
target._x -= 20;
if (target._x < -200 ) {
//target._x -= (target._x-target.startX )/6;
//target._x=target.startX;
//target._x -= 2;
//textSlide2(target, 0);
delete this.onEnterFrame;
counter++;
trace(counter);
if (counter == 11){
placeText(TextHolder,650, 200,"help/I/am/struggling/with/this", format, slideText,600);
}
}
};
};
target.intervalID2 = setInterval(target, "interval", delay);
//target._x = 0;
target.startX = target._x;
//target._x =targetX;
}
var format:TextFormat = new TextFormat();
format.font = "Arial";
format.size = 24;
format.color = 0xffffff;
var counter:Number=0;
var TextHolder:MovieClip=this.createEmptyMovieClip("Te xtHolder", this.getNextHighestDepth());
var TextHolder2:MovieClip=this.createEmptyMovieClip("T extHolder2", 7000);
placeText(TextHolder,650, 200,"help/I/am/struggling/with/this", format, slideText,600);
stop();
Any advice would be greatly appreciated
Attach Movie Clips Over Interval
I'm looking for a way to attach (or duplicate) movie clips so that they appear at an inteval...like MC (.5 sec)--MC (.5 sec)....basically a .5 sec delay before each clip appears. I'm creating a dynamic 5x10 grid where I would like each clip to appear one after the other. I've figured out how to do the grid when the movie loads...but can't figure out how to have the clips appear at an interval and not all at once.
Attach Variables To The Movie Clips
hey guys,
is there a way to attach variable to the movie clip. The deal is that i am generating my content by duplicating the movie clip using attachMovie. When i attachMovi and give it a unique instance name is there a way to attach variable to that duplicate so i can reference it through this.myVar or _root.duplicatedMc.myVar Here is the loop that i am using.
//loop is working
while (++i<=12) {
b = 4;
j = 0;
while (++j<=b) {
d = (((j-1)*12)+(i-1))+1;
_root.attachMovie("d_mc","drive_id"+d,d);
_root["drive_id"+d]._x = j*25;
_root["drive_id"+d]._y = 100+(i*25);
_root["drive_id"+d].drive_txt.text = d;
//this is the place where i need to attach
d_en = 0;
//attach d_en tp ["drive_id"+d];
}
}
Attach A Line Between 2 Movie Clips?
Hi,
I'm making a game. I need to know how to make a straight line appear between 2 movie clips, or a point on the screen and a movie clip. I want to be able to have this line begin at a constant anchor point on the stage, and extend to where my mouse is clicking (mouse has a cursor movie clip attached to it). The line can be a symbol or just the line tool, it doesn't matter. Anyone know how to accomplish this?
Thanks,
Craig
I Cant Attach Movie Clips For Some Reason
hi, im new to actionscript and this site, but ive read and reread and tried everything on the attachMovie tutorial but for some reason i cant attach movies. here's the script im using:
ActionScript Code:
function getClip1() {
_root.attachMovie("clip1_mc","clip1",1);
clip1._x=550;
clip1._y=350;
}
ive compared it to other scripts that ive seen work and i don't know why mine doesn't.
Attach Function To Multiple Movie Clips
ActionScript newbie here, so pardon a very basic question...
I have a ball movie clip (loaded into the library, this is being used
to simulate a bunch of bubbles floating on the stage, when a user
clicks the "bubble" i'd like it to pop and go away.
So there are 30 copies of the ball movie clip created on init()...
var numBalls:Number = 30;
init();
function init()
{
for (var i = 0; i < numBalls; i++)
{
var ball:MovieClip = attachMovie("ball", "ball" + i, i);
ball._width = ball._height = Math.random() * 40 + 20;
ball._x = Math.random() * Stage.width;
ball._y = Math.random() * Stage.height;
ball.vx = 0;
ball.vy = 0;
}
}
What I'd like to do is add a handler for onPress for each of these
clips...
The only thing I found that works is this...and this is crap, there's
gotta be a better way!
ball0.onPress = ball1.onPress = ball2.onPress = ball3.onPress =
ball4.onPress = ball5.onPress = ball6.onPress = ball7.onPress =
ball8.onPress = ball9.onPress = ball10.onPress = ball11.onPress =
ball12.onPress = ball13.onPress = ball14.onPress = ball15.onPress =
ball16.onPress = ball17.onPress = ball18.onPress = ball19.onPress =
ball20.onPress = ball21.onPress = ball22.onPress = ball23.onPress =
ball24.onPress = ball25.onPress = ball26.onPress = ball27.onPress =
ball28.onPress = ball29.onPress =
function()
{
removeMovieClip(this);
}
Thanks!
Attach Movie Clips To ScrollPane Using AttachMovie
Hi
I tried to attach movie clips to scrollPane using attachMovie
but could not do it
I tried the following code:
sp.contentPath="emptyMovieClip"
sp.content.attachMovie("boxesRow","boxesRow1",1)
trace(sp.content.boxesRow1)
Im able to trace the sp.content.boxesRow1 , but not seen in the scrollPane
Can any one suggest me , how can I do this Pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Thank you very much
Attach Movie Clips Using Seperate Functions
I'm having a little trouble with the following code. I'm calling two functions: init() and inittwo() to attach some movie clips to the stage. If I comment one of them out, the other works fine and the movement is okay. But as it is, only the "cloud" movie clips are being attached. I need for the clips in the "dreamarray" to be attached, and then for the "clouds" to be attached with a second function. I'm probably not going about this the right way, but I could sure use some help!
It would also be cool if I could attach the dreams at set "x" values instead of random distribution. I'm not sure how to set a seperate x value for each item in the array being attached.
var numClouds:Number = 10;
var fl:Number = 250;
var gravity:Number = .5;
var vx:Number = 0;
var vy:Number = 0;
var vz:Number = 0;
var friction:Number = .97;
var vpX:Number = Stage.width / 2;
var vpY:Number = Stage.height / 2;
var vpY:Number = 400;
var dreamarray:Array = new Array();
dreamarray[0] = "dreamone";
dreamarray[1] = "dreamtwo";
dreamarray[2] = "dreamthree";
init();
inittwo();
function init() {
for (var i:Number = 0; i<dreamarray.length; i++) {
var dream:MovieClip = attachMovie(dreamarray, "dreamarray" + i, i);
//var dream:MovieClip = attachMovie("dreamone", "dreamone" + i, i);
dream.x = Math.random() * 1600 - 800;
dream.y = 50;
dream.z = Math.random() * 800;
//trace("functioncall");
//tree.x = Math.random() * 2000 - 1000;
//tree.y = 50;
//tree.z = Math.random() * 10000;
}
}
function inittwo() {
for (var j:Number = 0; j<numClouds; j++) {
var cloud:MovieClip = attachMovie("cloud", "cloud" + j, j);
//tree.x = 400;
cloud.x = Math.random() * 1600 - 800;
cloud.y = 50;
cloud.z = Math.random() * 800;
}
}
function onEnterFrame():Void {
if(Key.isDown(Key.UP))
{
vz -= 1;
}
else if(Key.isDown(Key.DOWN))
{
vz += 1;
}
if(Key.isDown(Key.LEFT))
{
vx += 1;
}
else if(Key.isDown(Key.RIGHT))
{
vx -= 1;
}
if(Key.isDown(Key.SPACE))
{
vy += 1;
}
vy -= gravity;
vx *= friction;
vy *= friction;
vz *= friction;
for (var i:Number=0;i<dreamarray.length;i++) {
//i think there is a error here
var dream:MovieClip = this["dreamarray" +i];
dream.x += vx;
dream.y += vy;
dream.z += vz;
if(dream.y < 200)
{
dream.y = 200;
vy = 0;
}
if (dream.z <= -fl) {
dream.z += 1000;
}
else if(dream.z > 1000 - fl)
{
dream.z -= 1000;
}
var scale:Number = fl / (fl + dream.z);
dream._xscale = dream._yscale = scale*100;
dream._x = vpX + dream.x * scale/2;
dream._y = vpY + dream.y * scale/2;
//dream._x = dream.x * scale/2;
dream._alpha = scale * 60 + 40;
dream.swapDepths(-dream.z);
}
for (var j:Number=0;j<numClouds;j++) {
var cloud:MovieClip = this["cloud" + j];
cloud.x += vx;
cloud.y += vy;
cloud.z += vz;
if(cloud.y < 50)
{
cloud.y = 50;
vy = 0;
}
if (cloud.z <= -fl) {
cloud.z += 500;
}
else if(cloud.z > 10000 - fl)
{
cloud.z -= 10000;
}
var scale:Number = fl / (fl + cloud.z);
cloud._xscale = cloud._yscale=scale*200;
cloud._x = vpX + cloud.x * scale;
cloud._y = vpY + cloud.y * scale;
cloud._alpha = scale * 60 + 40;
cloud.swapDepths(-cloud.z);
}
}
Attach Movie Clips Then Play With Delay
I'm looking for a simple method to control the fade in animation of dynamically attached clips. In other words a menu where the attached items (xml driven) attach and then the first menu button fades in and then the second, third, etc. (the animation/fade would simply be frames in each clip)
I imagine there's a simple way to do this but I haven't been able to figure out how.
thanks for any input!
Attach Events To Runtime-loaded Movie Clips
Hello,
I am trying to attach some events to a movieclip which i load at run-time:
Code:
var cardBack:MovieClip=this.createEmptyMovieClip("cardback", 999);
cardback.loadMovie("http://www.xshaped.com/cards/cardback.png");
cardback.onRollOver = function() { trace("test");}
But nothing happens on mouseover.
Any ideeas?
Thanks.
Circular Path To X,Y Coordinates?
I need to duplicate a series of movies on a circular path. To do so requires Trig, which I don't know. Could somebody please point me to the right Math?
Thanks for your help,
-PiXELWiT
http://www.pixelwit.com
Circular Path For Text
I am trying to make a movie in which the text comes from the left side of the stage, goes to the center and then goes round in a quick circle and then comes to a stand still. How can I make the text follow a circular path. I drew a circle on the guide layer and then on the text layer I attached it to the cicle at the starting frame. After a few frames I inserted a keyframe(F6) and attached the text to the circle once again. However, this technique did not work. I would be grateful for any guidance.
Thanking in anticipation.
Copying Dynamically Created Movie Clips To Attach To New Container
I've been searching this for hours:
How do I copy all the dynamic objects(ie: textInput) and all it's attributes created by attachMovieClip() at containerMovie1 to attach to containerMovie2 and display all of them? I don't find any solutions using duplicateMovieClip() so what's your solution?
thanks!
Stupid But - How To Animate Something Around Circular Path?
I've tried earlier, and had a fix for it, but now I'm stuck again: please, how do I move something around a closed path like f. i. a circle?
I've tried to search the tutorials, but all I could find was something for 3D Max...
Please help me out, I'm sure there's a simple solution to this.
Masking Circular Path Problem
Hi,
I've got an interactive component that looks like a radar so it's a circle and it's divided into 3 sectors like a pie chart where each sector slightly has darker and darker colour. So what I need to do is find a way to dynamically mask these sectors so that when I use controls - two sliders the mask moves and reveals new parts of the circle area untill it reaches 360 degrees or if I use other slider goes the other way around and hides area anticlockwise. I have all the graphics in place and I've done similar things with slider I have them working .. but for this case I don't know how to make mask do the circular motion so tha I can control it with sliders. so the mask has to do this motion somehow.. put your thumb and your forefinger on the desk now keep thumb central and don't move it and move your forefigner so it makes circular motion.That's the motion I need to do.... I can do it as a single line rotating but I need it as a mask like filled area ....Any ideas ???
Cheers
Text Scroller With Circular Path - HELP
HI GUYS -
go to:
http://www.26gordonstreet.com
click view view showeroom
then click menu (litte motion sensitive thing at the top)
then click features -
and youll be taken to an area with beatuful renderings and a text scroller with a semi circular path. how is this done? can anyone help?
I have a fair idea that the actual scrollbar is invisible, and moves vertically as normal, but that also triggers an animation which moves around a circular path. Then again maybe im COMPLETELY wrong!
Any help would be greatly appreciated guys.
Cheers
Rotating Text On A Circular Path - How To Do It?
Hello,
New Flash user here. I have a customer who is interested in a having a banner made that has a circular text on a path type effect in it. He has a round logo would like words/sentences rotating around the circumference. Each sentence will change to a new sentence after a short time, but I have not gotten that far.
Thanks in Advance!
R. Seider
Constrain Dragging To A Circular Path?
I am designing an interface where a person will drag a circular measurement tool (called a goniometer) over part of an image, and then rotate two different arms on the tool to measure an angle.
The entire tool itself needs to be draggable by its center. So far I have the arms rotating by means of pressing the arrow keys on the keyboard, but it would be more realistic to have the user drag the arms to rotate them. I can't think of how to accomplish that, though.
Please see this example to get an idea of what I am doing:
http://interactive.elon.edu/goniometer.html
My other question is, why is it that you have to click the mouse somewhere on the screen before the key arrows will work?
TIA!
Animating A Mask In A Circular Path
Hey there. this is more a animation based question.
I know that you cannot use motion guides on mask so i was wondering how i can create a animation to reveal a pen style highlight.. like when you circle a piece of paper to indicate something of importance.
what i have tried is the obviously frame by frame animation of cutting out the shape to reveal a section of it each new frame, but thats just time consuming and well you dont have speed control (easing as well).
I have tried using a graphic in a graphic animated by a motion guide and using that graphic as a mask and that sorta works but it dosent really help since you need to make that motion guide graphic reveal as well, so its actually double the work.
just wondering if any one has some method that would be helpful.
:oh i tried shape tweens and while im pretty good at them, they seem more trouble than help with a circular motion. shape hints helps but it again is too much work for such a simple graphic element.
Rotating A Textfield In A Circular Path
Hi,
I'm having a problem with a movieclip that contains an object (a circle) in the middle. Off to the side is a text field. I want to rotate the whole movie clip at pre-determined degree increments and have the text field follow along. Although it does rotate, it will not follow a concentric circular path about the center--it's path is skewed by something--perhaps a transformation point that I can't locate. Other objects within the same movie clip do rotate properly.
I've attached a sample fla that demonstrates the problem by clicking the button to rotate the clip 90 degrees with each click.
Here is the stage code:button_mc.addEventListener(MouseEvent.CLICK, onClick);
function onClick (event:MouseEvent):void
{
circle_mc.rotation +=90;
var currentRotation:Number = circle_mc.rotation;
circle_mc.dt_txt.text = currentRotation;
circle_mc.dt_txt.rotation = -currentRotation;
trace("current rotation = " + currentRotation);
}
button_mc.buttonMode = true;
Thanks!
Constrain Dragging To A Circular Path?
I am designing an interface where a person will drag a circular measurement tool (called a goniometer) over part of an image, and then rotate two different arms on the tool to measure an angle.
The entire tool itself needs to be draggable by its center. So far I have the arms rotating by means of pressing the arrow keys on the keyboard, but it would be more realistic to have the user drag the arms to rotate them. I can't think of how to accomplish that, though.
Please see this example to get an idea of what I am doing:
http://interactive.elon.edu/goniometer.html
My other question is, why is it that you have to click the mouse somewhere on the screen before the key arrows will work?
TIA!
AttachMovie - Looping Thru An Array To Attach 6 Movie Clips Into An Empty Clip
Heres my issue...
Im loading in 6 different external icon button images using an XML file into an movieclip. well now i dont want external images to load from an xml file, i want the images to be inside flash in the library. I gave them a linkage name and made an array of them called menuIcons.
how do i get my icon images to load into flash without loading external images from an xml file...
heres my code..
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItem = nodes.length;
for (var i=0; i<numOfItem; i++)
{
menuIcons = ["healthySkin", "environMoist", "lowerSkin", "drySkin", "waterInfusion", "healthyCellular"];
var t = home.attachMovie("item", "item" + i, i + 1);
t.angle = i * ((Math.PI * 2)/numOfItem);t.onEnterFrame = mover;
t.nameClip = (nodes[i].attributes.nameClip);
t.content = (nodes[i].attributes.content);
t.icon.inner.loadMovie(nodes[i].attributes.image);t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}
thanks
slalonde44
Any Tutorials On Spinning Distorted Bars Around Circular Path
hey just wondering if anyone has tutorials on making those little spining bars you see everywhere..
ex http://www.xeofreestyle.com/
next to loading.. than on the girls eye.. than n zoom out on the left of her head.
I imgagine this could probably be done by distorting a square, lowering the alpha and putting it on a motion path of a cicle line. Just wondering if there are any tutorials on it. Thanks
Move Objects On A Semi-circular/elliptical Path
Hi guys,
I'm stumped ... I need to move a bunch of attached movieclips along a concave elliptical path to the left and right. It should stop when the extreme left and right movieclips hit the stage center point while moving left or right.
Really need your help ... in a jam ... or maybe a soup .. HELP !!!!!!!
- Oz
A Movieclip Move Along Circular Path When Moving The Mouse
How do I get a movieclip move along circular path when the mouse is moving in AS3?
The MovieClip's instance name is object.
Here is how I did it in AS1.
Code:
stop ();
startDrag ("/drag", true);
/:width = 200;
/:height = 200;
/:ox = eval("/:width") / 2;
/:oy = eval("/:height") / 2;
/:radius = 52;
Regards,
Glen Charles Rowell
Attach Clips From Xml, Reload Xml Attach Clips Again
i'm trying to figure out how to reset or refresh clips that are dynamically attached to another clip based on records returned through xml.
basically if the user chooses a different filter for the database query I need to be able to refresh a scrolling list made up of clips which will be different based on the filter.
this is what I have for a function. I try to use "attachEmptyMovieClip" but to no avail. any help would be great!
Code:
getAll=function(){
members = getMembers.firstChild.childNodes;
for (var i=0; i<members.length; i++) {
holder.createEmptyMovieClip("new_mc", 10);
item = holder.new_mc.attachMovie("listClip", "listClip" + i, i);
item._y = 23*i;
item.index = i;
trace(item.index);
item.memberName = members[i].attributes.last+", "+members[i].attributes.first;
item.first= members[i].attributes.first;
item.last= members[i].attributes.last;
item.listButton.tabEnabled=false;
item.listButton.onRelease=function(){
_root.triggeredClick="detail";
_root.selectedFirst= members[this._parent.index].attributes.first;
_root.selectedLast= members[this._parent.index].attributes.last;
_root.getDetails();
_root.firstLoad=false;
}
}
}
Dynamic Path's To Movie Clips In Flash 5
Hello All,
I have, with the help of this forum, developed an application that
functions very much like a calendar. I had a question once before where I
wanted to be able to address a certain movie clip that would read:
_root.day(whatever the variable "m1_d1" is). The forum helped me out with
the syntax of: _root["day"+m1_d1]
Now, I am trying to address a movie clip that is nested inside of the movie
clip I was adressing originally. The movie clip instance name is "multi". I
am trying to adress this movie clip to tell it to go to a certain frame
label, "open" within itself.
So It would essentailly say:
_root.day(whatever the variable "m1_d1"is).multi.gotoAndStop("open");
I am stumped on how to write that.
I have tried:
_root["day"+m1_d1+".multi"].gotoAndStop("open");
_root["day"+m1_d1["multi"]].gotoAndStop("open");
_root["day"+m1_d1]+".multi".gotoAndStop("open");
None seem to work.
Any help would be greatly appreciated as I am stuck
Thanks,
Daryl
Stuffing A Path Of Movie Clips Into A Variable.
Im trying to clarify my script in FlashMX by using variables as paths within a fuction like this:
pathToClip = "rollToReliance_mc.relianceBG_mc";
myFunction = function() {
leftReel_mc[pathToClip].gotoAndPlay("win");
};
I've tried doing this without using a string, and minus the array notation "[]" and it still doesn't work. I've also tried using _root (everything is on one level).
Thankyou Thankyou.
2 Part Q: Button Events, And Cursor/circular Path Scripting
Hi There, I am building a clock where the minute hand functions as the menu selector, i.e., 12 o'clock loads 'menuitem 1' to the left of the screen in a space reserved for it, 1 o'clock loads 'menuitem 2' there, etc--on Rollover. OnClick it should load a movie into the main frame.
Currently, I have 12 'pie shaped buttons with just the hit area defined, so that if someone is over 1 o'clock, it's affecting that button's hit area. So in theory, I've defined the mouseover and clicking areas, but I haven't any scripting yet, nor an arm.
First problem: I can't figure out how to attach any events to the buttons! They are 12 buttons (for 12 hours) each in a layer of a movie clip that has them, and the clock itself as the first layer. I want to go 'on Rollover goto and play (proper frame label in other movie clip)' and 'on click goto and play (proper movie clip) for each of the 12 hours/hit areas in the 12 buttons.
But I can't even get the actions to go from gray to black in the action panel?
Second problem: I need to build an arm that properly follows the mouse as it goes around the clock. I'm guessing I need to have a script that notes where the mouse is, and I need to have a script that includes a bunch of MATH stuff like PI and atan etc. I've no idea how to do that--to create a sequence where you can have the arm track properly around the circle of the clock when the mouse is over the face...?
Any help here would be much appreciated.
shawn
[F8] Scoping / Path From Movie Clips To Main Timeline
I've got a interactive movie that let's a user choose different combinations to customize an item. Each category is it's own movie clip (a total of five movie clips) with buttons that update it's own dynamic text box with a value. This works fine...
On the main timeline, there's a "total" dynamic text box with a "calculate" button that is supposed to get the sum of each value from all five of the dynamic text fields within the movie clips. It worked when everything was in the same movie, but now that the dynamic text boxes are broken up into separate movie clips, I'm not getting anything in the main movie's "total".
From what I understand, it's something to do with setting the right path... How can I fix the code?
Here's what I currently have on the "calculate" button in the main timeline:
on (release) {
total.text = Number(a.text) + Number(b.text) + Number(c.text) + Number(d.text) + Number(e.text);
}
Thanks
[F8] _rotation Issues Calculating Orientation On A Circular Path, Scalextric/slot Car
Hi guys,
Basically I'm attempting to build a scalextric (slot car) race game - simple 2d top-down style.
The basics are easy - for now I'm using a timeline motion guide/path and adjusting the frame depending on speed etc. - this works well and I'm happy with it (although eventually I'll upgrade to dynamic paths and track builder)
The problem I'm having is that of getting the car to 'realistically' skid out on corners depending on speed - I'm doing a little calculation where I work out the difference between the car's previous _rotation and the car's current _rotation and then multiply this value by the current velocity and smooth out the result using a method very similar to the old 'smooth preloader' tutorial - this new rotation value is applied to the _rotation property of a movieclip inside of the movieclip that is following the path/guide.
This works great - except there is one point on the track where the the car does a full 360 (or just twitches) - on the demo press the UP key to accelerate and just go 'full pelt' round the track and you'll see it happen in the top left (just past the top left corner)
The problem is something to do with how i'm calculating a setting rotations (incidently i found that flash uses -180 to 180 instead of 0 to 360)
can anybody understand what is going wrong? and how to fix it?
Thanks,
Jon
_rotation Issues Calculating Orientation On A Circular Path (scalextric/slot Cars)
Hi guys,
Basically I'm attempting to build a scalextric (slot car) race game - simple 2d top-down style.
The basics are easy - for now I'm using a timeline motion guide/path and adjusting the frame depending on speed etc. - this works well and I'm happy with it (although eventually I'll upgrade to dynamic paths and track builder)
The problem I'm having is that of getting the car to 'realistically' skid out on corners depending on speed - I'm doing a little calculation where I work out the difference between the car's previous _rotation and the car's current _rotation and then multiply this value by the current velocity and smooth out the result using a method very similar to the old 'smooth preloader' tutorial - this new rotation value is applied to the _rotation property of a movieclip inside of the movieclip that is following the path/guide.
This works great - except there is one point on the track where the the car does a full 360 (or just twitches) - on the demo press the UP key to accelerate and just go 'full pelt' round the track and you'll see it happen in the top left (just past the top left corner)
The problem is something to do with how i'm calculating a setting rotations (incidently i found that flash uses -180 to 180 instead of 0 to 360)
can anybody understand what is going wrong? and how to fix it?
Thanks,
Jon
_rotation Issues Calculating Orientation On A Circular Path (scalextric/slot Cars)
Hi guys,
Basically I'm attempting to build a scalextric (slot car) race game - simple 2d top-down style.
The basics are easy - for now I'm using a timeline motion guide/path and adjusting the frame depending on speed etc. - this works well and I'm happy with it (although eventually I'll upgrade to dynamic paths and track builder)
The problem I'm having is that of getting the car to 'realistically' skid out on corners depending on speed - I'm doing a little calculation where I work out the difference between the car's previous _rotation and the car's current _rotation and then multiply this value by the current velocity and smooth out the result using a method very similar to the old 'smooth preloader' tutorial - this new rotation value is applied to the _rotation property of a movieclip inside of the movieclip that is following the path/guide.
This works great - except there is one point on the track where the the car does a full 360 (or just twitches) - on the demo press the UP key to accelerate and just go 'full pelt' round the track and you'll see it happen in the top left (just past the top left corner)
The problem is something to do with how i'm calculating a setting rotations (incidently i found that flash uses -180 to 180 instead of 0 to 360)
can anybody understand what is going wrong? and how to fix it?
Thanks,
Jon
Attach A Line To Two Movie Clips. So The Line Moves And Adjusts To The Positionning
Hey
ok I'm working on a project, I have two movie clips moving to different locations, and I want a line connecting both clips.
The line will need to adjust dynamically to the mouvement of both clips.
Can someone give me a heads up on how to accomplish such task.
If more information is needed, post areply saying so, and I will add more information about what I am trying to accomplish.
Thanks
Jean
Attach Text To Path
ok this is really stupid. I had done this in the past but its been a while. I have a circle and I want my text to wrap around it, simple right? Just select circle and text then go to text and select attach text. Well that is how I did it in the past. Even found a tutorial to prove it http://www.cbtcafe.com/flash/3dtext/3dtext.html
Well in MX there is no attach to path. Can some one help and tell me where they put it or whow to in MX
thanx a ton dave
Attach Mc While Moving Along A Path
Hello all, i have a mc that moves along a path and i have a mc in my library that does a little falling animation. i used the attach movie function to attach it to the tween ed object on the stage. it attaches it mc but it doesn't play past the first frame. is there a way i can make the attached mc appear as the tween ed object moves along the path.(think of tinker bell as she flies the dust falls behind her)
i attached a mock up fla.
Thanks,
kool
Attach Text To Path
Can someone please tell me how to attach text to a path. I need to type some text and have it follow the curve of a circle. I'm using Flash MX 6.0.
Thanks
Attach Text To Path On Flash
this is your misssion (if you want accept it):
I need know how archieve that text can attached to any path (for example a circle). in other words, a similar effect at a property on CorelDraw (attach to path.
any answer, thanks
Attach Sound Path Problems
I've been reading these boards for 2 days before writing this and I can't solve my problem. I know what the problem is, I just can't fix it. Please help!!!
I have my main timeline that loads another swf into layer 5. Within layer 5 I have several swf files that load into a particular mc.
One of these swf files has audio clips in it that are linked and attached to the first frame of the swf. When I play this file alone, without being loaded into layer 5 and inside another mc, it works perfectly.
So, how do I call a sound that happens in layer 5 and inside another mc?
I know the problem is that the sounds path is _root but that calls back to my original timeline and won't find the audio files there. So, what is that path if it's not _root.
To make matters worse, I don't want all sorts of files floating around so I have those secondary swf files, which are loaded into the mc on layer 5, in a separate folder.
I've searched these boards for 2 straight days and I haven't seen much on this topic at all. I've also noticed that most posts get left behind, forgotten... no response. So, I'm leaving this here in hopes of someone seeing it who is smarter than I.
Want To Enlarge The Stage Size Equally Both Sides
Hi,
I have a project (with about 17 layers and upto 1000 keyframes). I have decided i need the stage to be bigger by about a cm either side - for example. So if i simply enlarge the stage my content won't be in the middle because it enlarges the stage at one end.
What is the best way to make the stage bigger and then center all my content on all my layers (including all the stuff on each layer along the timeline up to 1000 keyframes) please? I know how to do this if the content was on just one keyframe but not sure of the proper way for 1000 keyframes.
Thanks for any advice.
Space Thumbnails Equally On Multi Lines
Space thumbnails equally on multi lines
Hi all,
I looked for an answer to this a while back but had no success but now I really need to find an answer.
I have a group of thumbnails that need to be displayed in a grid, so it could be 3 lines of 5 images. I'm not too sure on the amount in each line because it will be updated dynamically. The image information comes from an xml file so I'm able to update the xml file but still have the thumbs in a grid
The problem is that the thumbs are different widths, but I need to space them equal distances apart on seperate lines.
So what I need to do is space them equally until they come to a certain distance or number of thumbs across and then have them drop down to another line and continue to have the same spacing
Here is code I'm using
ActionScript Code:
//Variables//-------------------------------------var gutter = 4;var btn_spacing = 20;var btnRefs = new Array();////XML//-------------------------------------my_xml = new XML();my_xml.ignoreWhite = true;my_xml.onLoad = function(success) { if (success) { DisplayBands(); } else { trace("XML Not Loaded"); }};my_xml.load("images.xml");////xml function//-------------------------------------function DisplayBands() { one = my_xml.firstChild.childNodes; for (i=0; i<one.length; i++) { two = one[i]; Btn = holder_mc.attachMovie("btn_mc", "btn_mc"+i, i+1); Btn._x = btn_spacing/1.6; Btn._y = btn_spacing*i; Btn.id = two.attributes.name; Btn.txt_txt.text = Btn.id; Btn.three = two.childNodes; Btn.holder_arr = new Array(); for (s=0; s<Btn.three.length; s++) { Btn.four = Btn.three[s]; Btn.five = Btn.four.childNodes; Btn.holder_arr.push(Btn.five); Btn.onRelease = function() { thHolder_mc.SequentialImages(this.holder_arr); }; } }}////Load thumbnail images in sequence//-------------------------------------MovieClip.prototype.SequentialImages = function(images) { this.imgAmount = images.length; this.curImage = 0; this.images = images; this.ImageFromSequence(); //check to see if thumbanil loaded before loading next this.onEnterFrame = function() { clipLoaded = this.imageClip.getBytesLoaded(); clipTotal = this.imageClip.getBytesTotal(); percent = clipLoaded/clipTotal; if (percent == 1) { this.imageClip._alpha = 40 this.imageClip.onRollOver = function() { this._alpha = 100; }; this.imageClip.onRollOut = this.imageClip.onDragOut=function () { this._alpha = 40; }; this.curImage++; if (this.curImage>=this.images.length) { this.onEnterFrame = undefined; } else { this.ImageFromSequence(); } } };};//////loading the images form the holder_arr that comes from the xml file.// MovieClip.prototype.ImageFromSequence = function() { this.imageClip = this.createEmptyMovieClip("thumb"+this.curImage+"_mc", this.curImage); this.imageClip.loadMovie(this.images[this.curImage]+".jpg"); this.imageClip._alpha = 0; this.imageClip.id = this; this.imageClip.idx = this.curImage; this.imageClipPrev = this["thumb"+(this.curImage-1)+"_mc"]; this.cols = 5; this.offSetXTest = this.imageClipPrev._x+this.imageClipPrev._width+gutter; this.offSetX = 85; this.offSetY = 75; //this.imageClip._x = this.offSetXTest*(this.curImage%this.cols); //this.imageClip._x = this.imageClipPrev._x+this.imageClipPrev._width+gutter //SPACE THE THUMBS SO THEY HAVE EQUAL DISTANCE BETWEEN THEM this.imageClip._x = this.offSetX*(this.curImage%this.cols); this.imageClip._y = this.offSetY*Math.floor(this.curImage/this.cols); btnRefs.push(this.imageClip);};
Here is the section for spacing the thumbs:
ActionScript Code:
MovieClip.prototype.ImageFromSequence = function() { this.imageClip = this.createEmptyMovieClip("thumb"+this.curImage+"_mc", this.curImage); this.imageClip.loadMovie(this.images[this.curImage]+".jpg"); this.imageClip._alpha = 0; this.imageClip.id = this; this.imageClip.idx = this.curImage; this.imageClipPrev = this["thumb"+(this.curImage-1)+"_mc"]; this.cols = 5; this.offSetXTest = this.imageClipPrev._x+this.imageClipPrev._width+gutter; this.offSetX = 85; this.offSetY = 75; //this.imageClip._x = this.offSetXTest*(this.curImage%this.cols); //this.imageClip._x = this.imageClipPrev._x+this.imageClipPrev._width+gutter //SPACE THE THUMBS SO THEY HAVE EQUAL DISTANCE BETWEEN THEM this.imageClip._x = this.offSetX*(this.curImage%this.cols); this.imageClip._y = this.offSetY*Math.floor(this.curImage/this.cols); btnRefs.push(this.imageClip);};
From the attached image you can see I have the thumbs on different lines but the spacing the between them is all off.
As always any help would be greatly appreciated
AS2 - Space Thumbnails Equally On Multi Lines
Last edited by cooper10 : 2008-05-09 at 13:36.
Space thumbnails equally on multi lines
Hi all,
I looked for an answer to this a while back but had no success but now I really need to find an answer.
I have a group of thumbnails that need to be displayed in a grid, so it could be 3 lines of 5 images. I'm not too sure on the amount in each line because it will be updated dynamically. The image information comes from an xml file so I'm able to update the xml file but still have the thumbs in a grid
The problem is that the thumbs are different widths, but I need to space them equal distances apart on seperate lines.
So what I need to do is space them equally until they come to a certain distance or number of thumbs across and then have them drop down to another line and continue to have the same spacing
Here is code I'm using
ActionScript Code:
//Variables
//-------------------------------------
var gutter = 4;
var btn_spacing = 20;
var btnRefs = new Array();
//
//XML
//-------------------------------------
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
if (success) {
DisplayBands();
} else {
trace("XML Not Loaded");
}
};
my_xml.load("images.xml");
//
//xml function
//-------------------------------------
function DisplayBands() {
one = my_xml.firstChild.childNodes;
for (i=0; i<one.length; i++) {
two = one[i];
Btn = holder_mc.attachMovie("btn_mc", "btn_mc"+i, i+1);
Btn._x = btn_spacing/1.6;
Btn._y = btn_spacing*i;
Btn.id = two.attributes.name;
Btn.txt_txt.text = Btn.id;
Btn.three = two.childNodes;
Btn.holder_arr = new Array();
for (s=0; s<Btn.three.length; s++) {
Btn.four = Btn.three[s];
Btn.five = Btn.four.childNodes;
Btn.holder_arr.push(Btn.five);
Btn.onRelease = function() {
thHolder_mc.SequentialImages(this.holder_arr);
};
}
}
}
//
//Load thumbnail images in sequence
//-------------------------------------
MovieClip.prototype.SequentialImages = function(images) {
this.imgAmount = images.length;
this.curImage = 0;
this.images = images;
this.ImageFromSequence();
//check to see if thumbanil loaded before loading next
this.onEnterFrame = function() {
clipLoaded = this.imageClip.getBytesLoaded();
clipTotal = this.imageClip.getBytesTotal();
percent = clipLoaded/clipTotal;
if (percent == 1) {
this.imageClip._alpha = 40
this.imageClip.onRollOver = function() {
this._alpha = 100;
};
this.imageClip.onRollOut = this.imageClip.onDragOut=function () {
this._alpha = 40;
};
this.curImage++;
if (this.curImage>=this.images.length) {
this.onEnterFrame = undefined;
} else {
this.ImageFromSequence();
}
}
};
};
//
//
//loading the images form the holder_arr that comes from the xml file.
//
MovieClip.prototype.ImageFromSequence = function() {
this.imageClip = this.createEmptyMovieClip("thumb"+this.curImage+"_mc", this.curImage);
this.imageClip.loadMovie(this.images[this.curImage]+".jpg");
this.imageClip._alpha = 0;
this.imageClip.id = this;
this.imageClip.idx = this.curImage;
this.imageClipPrev = this["thumb"+(this.curImage-1)+"_mc"];
this.cols = 5;
this.offSetXTest = this.imageClipPrev._x+this.imageClipPrev._width+gutter;
this.offSetX = 85;
this.offSetY = 75;
//this.imageClip._x = this.offSetXTest*(this.curImage%this.cols);
//this.imageClip._x = this.imageClipPrev._x+this.imageClipPrev._width+gutter
//SPACE THE THUMBS SO THEY HAVE EQUAL DISTANCE BETWEEN THEM
this.imageClip._x = this.offSetX*(this.curImage%this.cols);
this.imageClip._y = this.offSetY*Math.floor(this.curImage/this.cols);
btnRefs.push(this.imageClip);
};
Here is the section for spacing the thumbs:
ActionScript Code:
MovieClip.prototype.ImageFromSequence = function() {
this.imageClip = this.createEmptyMovieClip("thumb"+this.curImage+"_mc", this.curImage);
this.imageClip.loadMovie(this.images[this.curImage]+".jpg");
this.imageClip._alpha = 0;
this.imageClip.id = this;
this.imageClip.idx = this.curImage;
this.imageClipPrev = this["thumb"+(this.curImage-1)+"_mc"];
this.cols = 5;
this.offSetXTest = this.imageClipPrev._x+this.imageClipPrev._width+gutter;
this.offSetX = 85;
this.offSetY = 75;
//this.imageClip._x = this.offSetXTest*(this.curImage%this.cols);
//this.imageClip._x = this.imageClipPrev._x+this.imageClipPrev._width+gutter
//SPACE THE THUMBS SO THEY HAVE EQUAL DISTANCE BETWEEN THEM
this.imageClip._x = this.offSetX*(this.curImage%this.cols);
this.imageClip._y = this.offSetY*Math.floor(this.curImage/this.cols);
btnRefs.push(this.imageClip);
};
From the attached image you can see I have the thumbs on different lines but the spacing the between them is all off.
As always any help would be greatly appreciated
Equally Helpful Link For Newbie's And Flash Veterans...
Just thought i would share this, as it it a very quick overview (which means VERY LITTLE READING) about how people use websites. It touches on how WE as designers THINK people will use them, in contrast to how they actually use them. It's a good thing to take a look at for those of you just starting to out doing any type of web development, as well as those of you who have been doing it for a while....it helps put things back in perspective.
Anyway.. i hope some of you find it helpful....it certainly started me thinking and has sent me back to the drawing board on a few different projects.
http://www.sensible.com/chapter.html
Loop Through Dynamic Clips, Attach Rollover
I'm trying to apply a rollOver function to 15 movie clip slides without having to manually write a script for each one. I thought I would be able to do this with a simple for loop, and dynamically calling the instance, but no luck. Any thoughts? Many thanks to anyone who can illuminate a solution.
for (i=1;i<=15;i++) {
this["slide" + i].grip_rt.onRollOver = function() { this["slide" +i].rotate_arrow_tr.gotoAndStop(2); }
}
Best Way To Re-attach Dynamic Clips With Updated Database Info
building a dynamic menu with xml via php, mysql. attaching clips from the library for each database row/xml node, etc. No problem there.
my question is how can i rebuild that menu if another database call is made and the list needs to be repopulated?
I imagine i could create a clip on the fly and attach clips, but how could I get rid of the previous one?
i'd like to re-use the xml object just write a function that either rebuilds the clip or creates a new instance of an empty clip and builds the menu with that one?
make sense?
thanks for any input y'all!
Drag Movie And Circular Motion
It is possible that when i drag a movieClip to go only in a circular motion .
The thing is that i need to make a rotation button:
the button in in right corner of a square .i need that when i drag the button , the square to rotate in that direction with that angle
I had tried many thing bunt i didnt manage to solve this problem.
I think that : if make the button to move only on the imaginary circle around the square it would be easy to calculate rotation.But the circle movement is a problem too.
Any Help??
Thanks
Cosmin
|