Multiple Tween Trouble
Ok are you sopposed to have more then 1 dif. kind of tweens on 1 layer....or are u sopposed to make a seperate layer 4 a seperate tween thx alot 4 the help this ? is bothering me
FlashKit > Flash Help > Flash MX
Posted on: 12-28-2002, 05:25 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Tween Multiple MovieClips- Some Tween, Some Don't
Hello Kirupa,
here's the class i use:
Code:
package com.fornicode.tween {
import gs.TweenLite;
import flash.text.TextField;
import com.fornicode.utils.*;
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.events.Event;
public class MultiTween {
var $objList:Array = new Array();
public function MultiTween($target, $duration, $vars:Object)
{
for each ( var $obj:MovieClip in $target ) {
var $props:Array= new Array();
$props["x"] = $obj.x;
$props["y"] = $obj.y;
$props["alpha"] = $obj.alpha;
$props["scaleX"] = $obj.scaleX;
$props["scaleY"] = $obj.scaleY;
$props["rotation"] = $obj.rotation;
$props["width"] = $obj.width;
$props["height"] = $obj.height;
$props["obj"] = $obj;
$objList[$obj.name] = $props;
$vars.onComplete =this.tracer;
$vars.onCompleteParams = new Array($props["obj"]);
$vars.persist = true;
TweenLite.killTweensOf($props["obj"], true);
}
for each (var $obj_t in $objList)
{
TweenLite.to($obj_t["obj"] , $duration, $vars);
}
}
public function backToOrigin($duration, $ease)
{
for each ( var $obj_r:Object in $objList ) {
TweenLite.to($obj_r["obj"], $duration, { ease: $ease });
}
}
}
}
all i do is pass an array of movieClips and some tweenLite vars to it, and it should do a mass-tweenLite move to all clips. the problem is only two of eight clips actually "mass-move" the others do nothing. I've exhausted my scope of actionscript. I've tested all sorts of angles: linkage-all the same; "export to first frame" - all the same; tweenlite vars ( killTweensOf all clips before running, persist=true to all). All mc's are place on the stage.
any ideas whatsoever? Thank you in advance to whomever answers!
_x Tween Trouble
I am unable to tween into a specific position. Here is the code that I am using.
if (_root.arrow._x>330) {
_root.arrow._x-=70;
gotoAndPlay("loop");
} else{
gotoAndStop(1);
}
When I replace "-=70" with "--" I can hit the exact spot that I am going for, but it does not move fast enough.
Any suggestions would be greatly appreciated.
Thanks
Fade In Tween Trouble...
maybe i'm completely crazy... i'm trying to tween a mc symbol... just a simple alpha fade... on the main timeline of a swf... he symbol is made of dynamic text embeded... but of two different text boxes... converted to grapic symbols... on two different layers... in the mc symbol... is there something wrong with me...? it wont tween... i've tried it with one layer... i've tried it grouping them... i need the fonts to be two different sizes in the one symbol...
help... it's probably something silly...
[FCS3] Tween Trouble In CS3
My Flash experience is in using Flash8, and I'm currently using CS3 for the first time. I am however using AS2.0, not 3.0.
I'm using several motion tweens between various keyframes in a layer of a movieclip. Each tween is from a keyframe with a symbol instance set at color: Alpha, 0% and the same symbol with color: Alpha, 100%. These appear to be functioning properly. Below that layer I have a layer with almost identical "static" symbols. The intended effect being part of the swf "fades in."
However, by the second frame as the alpha starts to tween in, the entire image (including the normal static layer) is washed out as if the tween layer has 100% opacity over the static fill layer.
I've done the exact same thing in the past using Flash8, so maybe I'm just forgetting something. Thanks for any help!
Tween Class Trouble
An swf is worth a thousand words, so....
Please go to http://www.datapixel.eu/datapixel.htm
and watch yourself. When you click on "Apri Menu" (Open Menu in english) an animation made with the Tween class shows.
It should enlarge the green panel in order to show the buttons. And IT DOES! .... sometimes.
Instead sometimes the animation stops prematurely and the menu is not correctly viewed. Do you know what's happening?
Thanks.
Trouble With The Tween Class
I'm having trouble with this code, it's for tweening Thumbnails in a photo gallery application I'm building:
Code:
var tween:Tween = new Tween(Thumbnails[Thumbnails.cur_thumbnail], "_alpha", mx.transitions.easing.Strong.easeIn, 40, 100, 1, true);
Thumbnails.cur_thumbnail = new_thumbnail;
What happens is while the tween variable is tweening the value of Thumbnails.cur_thumbnail changes therefore cutting off the tween before it gets started or at least I'm assuming this is what's happening.
How do I get around this? Thanks.
Tween Class Trouble
Well, firstly, excuse my poor english... I guess its not so good, but I hope you can understand me.
Well, I have imported the tween class at my .fla file with:
-------
import mx.transitions.Tween;
import mx.transitions.easing.*;
-------
as everywhere says it must be done. Later, I use:
-------
ROLLOVER:
var tw:Tween=new Tween(plano_mc, "_xscale", mx.transitions.easing.Elastic.easeOut,40, 100, 40, false);
var tw2:Tween=new Tween(plano_mc, "_yscale", mx.transitions.easing.Elastic.easeOut,40, 100, 50, false);
-------
inside a function that i call on the rollover method for the movieClip I want to tween.
The trouble comes in the rollOut method, where I have this code:
-------
ROLLOUT:
var tw:Tween=new Tween(plano_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 100,40, 1, true);
var tw2:Tween=new Tween(plano_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 100,40, 1, true);
-------
After the user rolls out, and even after the rollOut tween is well done, it resizes to the 100%, even if I'm out of the hitArea for the rollOver. All this instead of staying at the 40% of _xscale and _yscale, that is what I wanted the class to do (you can see it in the parameters of the tween).
It only happens in the rollOut method, because the rollOver doesn't get resized after is called as well as the rollOut... It should be logical if it should happen at both methods, but it just happens at RollOut, and even, each time I rollOut, is just one (or both sometimes) property which gets resized (sometimes the _yscale, other times the _xscale....). Is there any explanation for this???
I want to erase this error, that I can't find why happens. My only explanation is that Robert Penner did a bad class, but I don't really trust it because he is a Flash master and I'm just a beginner, so, please
pleeeeeaaaase!, anybody help me!
Thank you very much!
Tween Class Trouble
I have 2 tweens. I want my first one to be around 50% completed to start my second one. How do I do that ?
Code:
var Tween_right:Tween = new Tween(_root.mc_holder.mc_backgroundBlue, "_x", Strong.easeOut, 0, 525, 1, true);
var AlphaUp:Tween = new Tween(obj, "_alpha", Regular.easeOut, 0, 100, 1, true);
AlphaUp.stop();
Trouble With HitTestPoint And Tween
Hi guys,
I'm having a trouble with hitTestPoint and tween. Well, if you look at the code you will understand what I am trying to archive here.
---------------------
var action:Tween;
target01.alpha = 0.6;
target01.addEventListener(Event.ENTER_FRAME, transition01);
function transition01(event:Event):void {
if (target01.hitTestPoint(mouseX, mouseY, true)) {
action = new Tween(target01, "alpha", Strong.easeOut,0.6, 1, 1, true);
} else {
action = new Tween(target01, "alpha", Strong.easeOut,1, 0.6, 1, true);
}
}
---------------------
Yes, that's right. I'm trying to make the movie clip 'target01' to fade in once the mouse pointer roll-overs, and fades out when roll-out. But tween actions don't work...
Yes, I did MouseEvents instead, but it is not the way I want it.. Please help me outta here guys.
Trouble With A Shape Tween
Howdy guys,
I got this problem with a shape tween in my project. Its basically a CBt type of deal. But the problem is when u click on a button and go to the page, a shape tween of a semi-transparent box betting bigger is supposed to happen, it is also a movie clip. It happens inside of it. It happens in the flash file, but when I export it it goes all wierd. The box is supposed to come from the top left and go to the right bottom. But when it plays it only shows the right side line.
Are both the timelines supposed to be the same amount. There both 10 frames. Any kind of help will be greatly appericated.
thanks
Tween Class Trouble
I don't use Tween class often, so don't scold me if this is an obvious question.
When I set up a simple Tween, it works if I assign a specific object's instance name as the object to tween. But when doing it inside a for loop, it doesn't work. Yet everything else within the for loop works. I've tested every variable, and it's the object name that doesn't work. Here is a simplified version of the code. Someone please tell me what I've done wrong.
Attach Code
import mx.transitions.Tween;
import mx.transitions.easing.*;
for (var k:Number = 1; k<15; k++) {
var dakine = this["letter"+k];
dakine.onPress = function() {
this._xscale = this._yscale=90;
this.startX = this._x;
this.startY = this._y;
startDrag(this);
};
dakine.onRelease = dakine.onReleaseOutside=function () {
stopDrag();
this._xscale = this._yscale=100;
var letterUp:Tween = new Tween(this, "_x", Bounce.easeOut, this._x, this.startX, 2000);
};
}
Still Having Trouble W/ Basic Color Tween
ok.
i have flash mx
frame one i create a circele with one color
click on frame 10, cpress f6(to create an identical keyframe to frame one, right)
by doing this the new objest is highlighted so i go to the properties window and change the color....
next i click on any frame between 1 and 10 and creat a motion tween from insert menu..
it still does not work.
the motion tween is dotted ... i know its supposed to be a solid line.
if i click on tframe 10 and create tween it change the objects to the same color.... what in tarnations is goin on here?!
please help.
thank you
Having Trouble With Tween Navigation (New To Flash)
http://douglas.mackenzie.natcoll.net...lash/index.swf
http://douglas.mackenzie.natcoll.net...lash/index.fla
is the link to the flash file.
The problem I am having is that it only tweens once. I wanted to be able to go back and forth - It just doesn't seem to respond after the first click.
Also it always goes the same way no matter where it's clicked. Can anyone work this out?
If anyone has time to read over this code it would be greatly appreciated.
Thanks
Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var xTween:Tween;
var yTween:Tween;
var castMc:cast = new cast;
addChild(castMc);
castMc.x = -580;
castMc.y = 145;
//castMc.buttonMode = true;
var trailerMc:trailer = new trailer;
addChild(trailerMc);
trailerMc.x = 120;
trailerMc.y = 145;
//trailerMc.buttonMode = true;
var datesMc:dates = new dates;
addChild(datesMc);
datesMc.x = 820;
datesMc.y = 145;
//datesMc.buttonMode = true;
castMc.addEventListener(MouseEvent.CLICK, navigate);
trailerMc.addEventListener(MouseEvent.CLICK, navigate);
datesMc.addEventListener(MouseEvent.CLICK, navigate);
var castXposFarLeft:Number = -1280;
var castYposFarLeft:Number = 145;
var castXposLeft:Number = -580;
var castYposLeft:Number = 145;
var castXposMiddle:Number = 120;
var castYposMiddle:Number = 145;
var trailerXposLeft:Number = -580;
var trailerYposLeft:Number = 145;
var trailerXposMiddle:Number = 120;
var trailerYposMiddle:Number = 145;
var trailerXposRight:Number = 820;
var trailerYposRight:Number = 145;
var datesXposFarRight:Number = 1280;
var datesYposFarRight:Number = 145;
var datesXposRight:Number = 820;
var datesYposRight:Number = 145;
var datesXposMiddle:Number = 120;
var datesYposMiddle:Number = 145;
function navigate(event:MouseEvent):void
{
if(event.currentTarget.name == "castMc")
{
setTweenCast(castXposMiddle, castYposMiddle);
setTweenTrailer(trailerXposRight, trailerYposRight);
setTweenDates(datesXposFarRight, datesYposFarRight);
}
else if(event.currentTarget.name == "trailerMc")
{
setTweenCast(castXposLeft, castYposLeft);
setTweenTrailer(trailerXposMiddle, trailerYposMiddle);
setTweenDates(datesXposRight, datesYposRight);
}
else(event.currentTarget.name == "datesMc")
{
setTweenCast(castXposFarLeft, castYposFarLeft);
setTweenTrailer(trailerXposLeft, trailerYposLeft);
setTweenDates(datesXposMiddle, datesYposMiddle);
}
//trace(event.currentTarget.name);
}
function setTweenDates(tweenX:Number, tweenY:Number):void
{
xTween = new Tween(datesMc, "x", Strong.easeOut, datesMc.x, 0, 4, true);
yTween = new Tween(datesMc, "y", Strong.easeOut, datesMc.y, 145, 4, true);
xTween.begin = datesMc.x;
yTween.begin = datesMc.y;
xTween.finish = tweenX;
yTween.finish = tweenY;
xTween.start();
yTween.start();
}
function setTweenCast(tweenX:Number, tweenY:Number):void
{
xTween = new Tween(castMc, "x", Strong.easeOut, castMc.x, 0, 4, true);
yTween = new Tween(castMc, "y", Strong.easeOut, castMc.y, 145, 4, true);
xTween.begin = castMc.x;
yTween.begin = castMc.y;
xTween.finish = tweenX;
yTween.finish = tweenY;
xTween.start();
yTween.start();
}
function setTweenTrailer(tweenX:Number, tweenY:Number):void
{
xTween = new Tween(trailerMc, "x", Strong.easeOut, trailerMc.x, 0, 4, true);
yTween = new Tween(trailerMc, "y", Strong.easeOut, trailerMc.y, 145, 4, true);
xTween.begin = trailerMc.x;
yTween.begin = trailerMc.y;
xTween.finish = tweenX;
yTween.finish = tweenY;
xTween.start();
yTween.start();
}
Tween Action Script Trouble
i need to make a tween in flash that repeats its self when it finishes. it needs to be 1 frame and be in action script 2.0 i have managed to make the tween but it wont play again.
Could any one give me and hand
Thanks
Stupid Saint
Trouble With 1st Kirupa Flash 8 Tween Tutorial
Hi,
I'm on a Mac and a Flash MX 2004 user. I attempted to do Kirupa's very basic animation tweening tutorial to get myself going with Flash 8, but I cannot get it to work.
The motion works fine, but when I introduced the alpha part, it started behaving erratically. It just won't fade IN.
I am familiar and comfortable with animation tweens involving motion and fades in MX 2004...
I tried just doing a fade in for a single letter, not even inside a movie clip (as the tutorial has you do), and didn't use motion -- just a fade in: Can't even get that to work.
Any ideas? Some silly thing I overlooked??
Thanks!
SL
Tween Class Trouble (based On The Tutorial)
Hey hey hey.
I was gonna have a fiddle with this tutorial http://www.kirupa.com/developer/actionscript/tween.htm
so I downloaded, unzipped, saved and published it. I didn't have a chance to fiddle with anything and it's already broken! I get this:
**Error** Scene=Scene 1, layer=actions, frame=1:Line 5: There is no property with the name 'onMotionFinished'.
xScaleT.onMotionFinished = function() {
**Error** Scene=Scene 1, layer=actions, frame=1:Line 8: There is no property with the name 'onMotionFinished'.
xPosT.onMotionFinished = function() {
Total ActionScript Errors: 2 Reported Errors: 2
Any ideas why guys? Cheers in advance.
<"))))><
Edit: MX04 by the way.
Scope Trouble... Unregister/ Remove Object / Tween ?
Hi,
I hope somebody can help with the following problem.
I'm trying to make a powerpoint kind of projector:
- Main flash movie: works as a container to load different flash files.
reacts on the left and right arrow buttons to go to the next or previous movie, which is loaded in a movieClip.
- Several external swf files all exported from the same: slide.fla only adjusting xml node settings make the differences in text and pictures.
This works, but after loading into the container I use to show the images the tween of my images gets messed up. (Not in the first loaded movie, but sure after around the third)
Please can anybody look at my code and tell me what could be the problem?
I'm sure it has to do with the scope after loading into the container.fla, and all the objects having the same name, for the submovies. (exported from the same .fla)
Do I have to unregister/ remove these objects after usage - I think this might be it, but don't know how.
In the container.fla I already set:
clipLoader_mc._lockroot = true;
but this doesn't solve the problem.
Code:
/// **************************** ///
/// START TWEEN METHODS FOR SCREENS ///
/// **************************** ///
var mcl_obj:Object = new Object();
mcl_obj.onLoadInit = function(target_mc:MovieClip):Void {
target_mc._width = 500;
target_mc._height = 395;
target_mc._x = 500;
var distance:Number = 5;
var angleInDegrees:Number = 45;
var color:Number = 0x000000;
var alpha:Number = 75;
var blurX:Number = 7;
var blurY:Number = 7;
var strength:Number = 1;
var quality:Number = 3;
var inner:Boolean = false;
var knockout:Boolean = false;
var hideObject:Boolean = false;
var filter:DropShadowFilter = new DropShadowFilter(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject);
var filterArray:Array = new Array();
filterArray.push(filter);
target_mc.filters = filterArray;
var tween_target:Object = new Tween(target_mc, "_y", Back.easeInOut, Stage.height, 300, 1, true);
tween_target.onMotionFinished = function() {
intervalClearScreenId = setInterval(ClearScreen, 8000, counter);
};
screenCounter++;
//initiated on top of the page.
};
function ClearScreen():Void {
var tween_screen:Object = new Tween(mover_mc, "_x", Strong.easeInOut, mover_mc._x, 1250, 1, true);
tween_screen.onMotionFinished = function() {
if (screenCounter<screenMaxCount) {
ShowScreens();
} else {
screenCounter = 0;
ShowScreens();
}
clearInterval(intervalClearScreenId);
};
}
ShowScreens = function ():Void {
// Create a movie clip instance.
this.createEmptyMovieClip("mover_mc", getNextHighestDepth());
var img_mcl:MovieClipLoader = new MovieClipLoader();
img_mcl.addListener(mcl_obj);
// Load an image into the movie clip
img_mcl.loadClip(imageArray[screenCounter], mover_mc);
};
//load XML voor screens on the left:
function loadScreensXML(loaded) {
if (loaded) {
_rootNode = this.firstChild.childNodes[imageNodeNr].childNodes[0];
trace(_rootNode);
total = _rootNode.childNodes.length;
for (i=0; i<total; i++) {
//add images to imageArray:
imageArray[i] = _rootNode.childNodes[i].firstChild.nodeValue;
}
screenMaxCount = imageArray.length;
//initiated on top of the page
//Show the screens:
ShowScreens();
} else {
content = "file not loaded!";
}
}
xmlScreens = new XML();
xmlScreens.ignoreWhite = true;
xmlScreens.onLoad = loadScreensXML;
xmlScreens.load(urlImagesXML);
/// **************************** ///
/// END TWEEN METHODS FOR SCREENS ///
/// **************************** ///
I'm trying all day already to solve this so please can anybody help?
Thanks in advance!
Do I Use Multiple Tween Or Just One?
I'm creating a slide show. When the image slides in, I want the image to slowly slide in, slowly zoom out to fill the stage, and then zoom out again to totally disappear from the stage. For the effect, do I need to use multiple tween? What do I need to do to accomplish this?
[F8] Tween With Multiple Objects?
Okay, so i figured out how to motion tween, simple enough. My only problem now is doing it with more than one object. for instance, i have a ball which has moved across the screen: now i want a sort of laser thing to pop out of the side and scan a wall. S o made the pooping out in frame by frame cuz i could, but when i try to make the laser scan the wall, it does, but the ball dissapears...
what do i do?
separate question:
when i made the laser pop out, i just did it fbf. however, i want to be able to use a tween for that. the laser's "gun" is sorta like this:
ball Gun
O C
so, yea, its like part of the ball that comes out. I want to have it just rotate, with its point of rotation being on the circles outer line, but that didnt work. what do i do?
Tween With Multiple Mc's At The Same Time.
Ok, to preface this. My goal here is to create a card matching game that has all the cards in their correct order. Then when you click on 'start' they flip over and will move to a shuffled order.
The reason why is because I want to learn how to take advantage of the new Tween engine.
My problem is that when I click on 'Start', everything moves- but only one or sometimes 2 movie clips actually end up to where they're supposed to be.
Here's my code:
Code:
import fl.transitions.Tween;
var deckOrderX:Tween;
var deckOrderY:Tween;
for (var i:Number = 1; i <= totalCards; i++) {
// CREATE ALL THE PLACEHOLDER MC NAMES (THIS IS WHERE THE CARDS // ARE SUPPOSED TO END UP)
var placeholderOrder:MovieClip;
placeholderOrder= game_mc["placeholder" + i];
// THIS WILL BE FIXED, BUT THE NAMES FOR THE CARDS ARE ONE OFF
var h:int;
h = i -1;
// THE DECK OF CARDS, THERE ARE 12 TOTAL
var deckOrder:MovieClip;
deckOrder= game_mc["card" + randomOrder[h]];
// TWEEN ENGINE: TAKE EACH CARD AND MOVE IT TO THE RANDOM
// ORDER FROM RANDOMIZING ALGORITHM.
deckOrderX = new Tween(deckOrder, "x" , None.easeNone, deckOrder.x, placeholderOrder.x, 1, true);
deckOrderY = new Tween(deckOrder, "y" , None.easeNone, deckOrder.y, placeholderOrder.y, 1, true);
// WE DON'T NEED PLACEHOLDERS AFTER THE CARDS ARE MOVED.
placeholderOrder.visible = false;
}
So, my question is... Do I need to do this out of the loop? Also, should I create 12 individual Tween variables (deckOrderX & deckOrderY)?
My thoughts as to why this isn't working is because it's a loop, it'll animate the thing until we need to use that tween for the next card. The last one is the one that makes it - basically because it's the last one being needed.
But that raises the question, how do I do what I want to do with efficient code?
Tween Multiple MCs At Once Or Duplicate MC Into Another.
I've been working on a problem for all of today, but have yet to find a solution/answer to it. I’m hoping that one of the Actionscript gurus could help me out.
My questions are:
Is it possible to use duplicateMovieClip() to duplicate movieclips into another movieclip? For example, is it possible to modify the code below so that the "duplicated + i" movieclips will be inserted into the "container" movieclip?
_root.createEmptyMovieClip("container", getNextHighestDepth());
for(i=0;i<10;i++) {
_root.MC_TO_DUPLICATE.duplicateMovieClip("duplicated" + i, getNextHighestDepth() , {_x:orig_xPos + 20});
}
Or, alternatively, is it possible to use the TWEEN class so that I can move all the duplicated movieclips down when I RollOver a button?
var yDown1:Tween = new Tween("duplicated1, "_y", Elastic.easeOut, 20, 50, 30, false);
var yDown2:Tween = new Tween("duplicated2, "_y", Elastic.easeOut, 20, 50, 30, false);
var yDown3:Tween = new Tween("duplicated3, "_y", Elastic.easeOut, 20, 50, 30, false);
But I don't know how many movieclips I'll be duplicating at authoring time because I'll be pulling that value from an XML file that will change often...
I've been scratching my head for hours now, and I'm getting close to the date in which my boss wants this completed.
Multiple Mc's Using Same Tween Code
I have 10 different movie clips that I all want to use the same tween code
Code:
function grow(who) {
var tw:Tween = new Tween(who, "_xscale", Strong.easeOut, myMovieClip_mc._xscale, 92, 1, true);
var tw2:Tween = new Tween(who, "_yscale", Strong.easeOut, myMovieClipl_mc._yscale, 92, 1, true);
}
function shrink(who) {
var tw:Tween = new Tween(who, "_xscale", Strong.easeOut, myMovieClip_mc._xscale, 80, 1, true);
var tw2:Tween = new Tween(who, "_yscale", Strong.easeOut, myMovieClip_mc._yscale, 80, 1, true);
}
Is there an easier way to just have this code written once rather than copying and pasting the code 10 times for all 10 instances of my clip. myMovieClip_mc is where each instance would have it's unique name. Thanks!
Multiple Objects One Tween
Hello.
Say i've got multiple clips on stage and i want to move them all say 20pixels to the right. I want to do this with one Tween and have a nice elegant mathematical solution (i don't want to have to take position stamps etc etc unless its absolutely necessary). Here's an example. 4 clips randomly dragged on the stage and put in an array, Then one tween to move them all (for performance reasons):
ActionScript Code:
import mx.transitions.Tween;import mx.transitions.easing.*;var disTraveled = 0var ball_array = new Array(ball0_mc, ball1_mc, ball2_mc, ball3_mc)var obj = new Object()obj.x = 20var xTween = new Tween(obj, "x", Regular.easeOut, obj.x, 0, 20)xTween.addListener(this)function onMotionChanged(event:Object):Void{ var it = ball_array.length for (var i=0; i < it; i++) { ball_array[i]._x += obj.x } disTraveled += obj.x}function onMotionFinished(event:Object):Void{ trace(disTraveled)}
obviously this code doesn't work as it is iteratively adding the value of obj.x (not the val - prev val to get the difference). There must be a nice solution to this and wandered if anyone had come accross this problem before
cheers
jimmy
Tween Function For Multiple Mc's...help
Hello,
I'd like to get several MC's to tween from point a to b and repeat. I wrote the function below which works fine with on e MC.
However if I use the function with more than one, all of the MC's tweens become the same, which is the last function I call -linkrun(square5, 400, 400).
How can I fix this?
Thanks for any help.
-E
ActionScript Code:
xloc=250
yloc=250
function linkrun(mc, xstart, ystart){
var xt:Tween = new Tween(mc, "_x", Regular.easeOut, xstart, xloc, framerate, false);
var yt:Tween = new Tween(mc, "_y", Regular.easeOut, ystart, yloc, framerate, false);
xt.onMotionFinished = function() {
xt.start()
};}
yt.onMotionFinished = function() {
yt.start()
}
linkrun(square, 10,10)
linkrun(square2, 400,10)
linkrun(square3, 250, 10)
linkrun(square4, 10, 250)
linkrun(square5, 400, 400)
Trouble Calling Multiple MCs
I have a move which contains a menu of buttons. Two of the buttons call their own movie clip. I want the movie clips to show up exactly in the same location. But when I click one button i want it to close the other button's movie clip, if it is opened up.
Basically, I have two buttons:
Butt1 opens MC1
Butt2 opens MC2
But i want the Butts to open their MCs in the exact same location.
I need a way that Butt1 can detect if MC2 is open and if so, close it before opening MC1 and visa versa.
for both my buttons I am using the following code:
************************************************** ************
onClipEvent (mouseDown) {
if (this.hittest(_root._xmouse,_root._ymouse,true)) {
this.play();
}
}
************************************************** *************
for both my MCs, I have a stop frame at frame 1.
Still Having Trouble Embedding Multiple .swf's
I made a really simple example of what I am trying to do: http://www.jocci.com/indio.htm
Attach Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<STYLE type=text/css></STYLE>
<SCRIPT src="swfobject.js" type=text/javascript></SCRIPT>
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV id=flashcontent>
<TABLE height=768 cellSpacing=2 cellPadding=1 width=1024 border=1>
<TBODY>
<TR>
<TD vAlign=top width=508 height=762>
<P>
<DIV id=flashcontent>This text is replaced by the Flash movie. </DIV>
<SCRIPT type=text/javascript>
var so = new SWFObject("movie.swf", "mymovie", "575", "90", "8", "#000000");
so.write("flashcontent");
</SCRIPT>
<P></P></TD>
<TD width=500 height=762>
<DIV id=flashcontent>This text is replaced by the Flash movie. </DIV>
<SCRIPT type=text/javascript>
var so = new SWFObject("collins.swf", "collins", "400", "300", "8", "#000000");
so.write("flashcontent");
</SCRIPT>
</TD></TR></TBODY></TABLE></DIV></BODY></HTML>
Using The Same Shape Tween On Multiple Images
i have a symbol (movie clip) in a flash intro i am making. I have created a cool effect with a shape tween to the image and now i want to be able to have the same exact tween applied to other pictures that follow behind the first one. how can i apply the same tween to multiple images?
Applying The Same Tween To Multiple Layers?
So Ive split my text into seperate layers, and i would like all of them to come in with a weird fade effect that i would keyframe in
i wanted to know if its possible to apply the same effect to multiple layers without doing it over for each layer?
[CS3] Multiple Function For Tween Reversing
Hi everyone,
Something is driving me nuts, I have a menu with 4 buttons,
when pressing one of the buttons for the first time, a mc slides out using a tween.
When you click THE SAME button for the second time, the mc slides back again using the excisting tween by .yoyo
Same function for the other buttons, so far so good!
BUT at the moment when you click one of the buttons, it should check first if one of the other mc's are still slided out,
and if so, have to slide back first before sliding out the mc of the pressed button....
So I made a variable called n_status for each button, which tells if the mc is slided out (zichtbaar) or not slided out (onzichtbaar).
The other buttonfunctions should check these variables if they are "zichtbaar" and then slide the mc back first.
This part kinda works, but when clicking randomly on the buttons a few times,
something goes wrong... but I can't figure out what!!!
This is my actionscipt so far (I only made 2 of the 4 buttons yet to test):
PHP Code:
stop();
personal_selected._visible = false;
network_selected._visible = false;
import mx.transitions.Tween;
import mx.transitions.easing.*;
// PERSONAL //
var incrP = 0;
var p_status = "onzichtbaar";
personal_but.onRelease = function() {
incrP++;
if (incrP>1) {
incrP = 0;
reversingP();
p_status = "onzichtbaar";
}
if (incrP == 1) {
forwdP();
p_status = "zichtbaar";
}
};
var personal;
function forwdP() {
//Reversing other mc's
if (n_status == "zichtbaar") {
reversingN();
}
//Forwarding network mc
_root.personal_mc._visible = true;
personal_selected._visible = true;
personal = new Tween(_root.personal_mc, "_y", Strong.easeInOut, 80, 300, 32, false);
};
function reversingP() {
personal_selected._visible = false;
personal.yoyo();
};
// NETWORK //
var incrN = 0;
var n_status = "onzichtbaar";
network_but.onRelease = function() {
incrN++;
if (incrN>1) {
incrN = 0;
reversingN();
n_status = "onzichtbaar";
}
if (incrN == 1) {
forwdN();
n_status = "zichtbaar";
}
};
var network;
function forwdN() {
//Reversing other mc's
if (p_status == "zichtbaar") {
reversingP();
}
//Forwarding network mc
_root.network_mc._visible = true;
network_selected._visible = true;
network = new Tween(_root.network_mc, "_y", Strong.easeInOut, 80, 300, 32, false);
};
function reversingN() {
network_selected._visible = false;
network.yoyo();
};
Please, give me the golden tip! Any help is very much appreciated
Thanx
Tween Class - Multiple Instances
Hey everyone,
This is a novice question, but please bare with me...thanks in advance(!)
I've built a simple tween class animation which drops a card (on a slight angle, randomized) onto the screen.
my code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var random_num:Number = Math.round(Math.random()*80) + (-40);
//trace(random_num);
var xScaleT:Tween = new Tween(badge_mc, "_x", Strong.easeOut, 100, 150, .7, true);
var xScaleT:Tween = new Tween(badge_mc, "_y", Strong.easeOut, 100, 60, .7, true);
var xScaleT:Tween = new Tween(badge_mc, "_height", Strong.easeOut, 2000, 123, .7, true);
var xScaleT:Tween = new Tween(badge_mc, "_width", Strong.easeOut, 2000, 133.6, .7, true);
var xScaleT:Tween = new Tween(badge_mc, "_rotation", Strong.easeOut, 0, random_num, 1.2, true);
Right now one single card is animated in, then disappears and another animates in.
I wish to have each card remain on the screen.... to have one animate in and remain on screen, then another animate down on top of the first and remain, etc until I have perhaps 15 cards on screen at once.
I think the listener object is my route, but I don't understand the syntax.. I've tried a ton of different code attempts with little success.
my source: block_tweenClass_test.fla
any help would be greatly, greatly appreciated. Cheers!!
Applying AS Tween To Multiple Movieclips
I have several movieclip buttons that I want to apply AS tweened rollover and rollout actions to. I am able to create the functions and tweens for 1 and get them working fine, but am having trouble with applying this same functions to multiple movieclips. I am learning and trying to make my code as tight as possible, but I think I am confused.
Here is what I have so far:
Code:
var NewsArray:Array = [News1, News2, News3, News4];
var i = 1;
function over () {
var tw:Tween = new Tween(NewsArray[i],"_xscale",Strong.easeOut,NewsArray[i]._xscale,NewsArray[i]._xscale+5,0.5,true);
var tw2:Tween = new Tween(NewsArray[i],"_yscale",Strong.easeOut,NewsArray[i]._yscale,NewsArray[i]._yscale+5,0.5,true);
}
function out () {
var tw:Tween = new Tween(NewsArray[i],"_xscale",Strong.easeOut,NewsArray[i]._xscale,NewsArray[i]._xscale-5,0.5,true);
var tw2:Tween = new Tween(NewsArray[i],"_yscale",Strong.easeOut,NewsArray[i]._yscale,NewsArray[i]._yscale-5,0.5,true);
}
for (var i = 1; i <= NewsArray.length; i++) {
NewsArray[i].onRollOver = over;
NewsArray[i].onRollOut = out;
}
Tween/Ease On Multiple Buttons
workin on learning AS and having trouble with tween/easing. I'm trying to apply a tween/ease to each of my buttons so that when the user clicks the button a subtitle scrolls (tweens) onto the stage. The code i have works great for the first button...but when i apply it to the other buttons the only one that it actually works on is the last...here's my AS
stop();
home_btn.onRelease = function (){
gotoAndStop(3);
tweenBall(mx.transitions.easing.Bounce.easeOut);
}
function tweenBall(easeType) {
var begin = -200;
var end = 111;
var time = 20;
var mc = ball_mc;
ballTween = new mx.transitions.Tween(textWel_mc, "_x", easeType, begin, end, time);
}
portfolio_btn.onRelease = function (){
gotoAndStop(4);
tweenBall(mx.transitions.easing.Bounce.easeOut);
};
function tweenBall(easeType) {
var begin = -200;
var end = 111;
var time = 20;
var mc = ball_mc;
ballTween = new mx.transitions.Tween(textPort_mc, "_x", easeType, begin, end, time);
}
So if i had only these two buttons with the tween/ease...the portfolio_btn would only have the tween on it...if anyone could help out that'd be awesome...thnx
Multiple Movie Clip Tween
I'm creating a field of bubbles (~1,000 total) and would like all of them to pulse on the initial load but do not want to manually go in to each movie clip and write the tween (of growing and then reducing back to original size). Is there an actionscript that can apply this scale effect to each bubble in the file? Also, each bubble is a different, original size...thanks...
Tween Class - Multiple Instances
Hey everyone,
I've built a simple tween class animation which drops a card (on a slight angle which is randomized) onto the screen.
my code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var random_num:Number = Math.round(Math.random()*80) + (-40);
//trace(random_num);
var xScaleT:Tween = new Tween(badge_mc, "_x", Strong.easeOut, 100, 150, .7, true);
var xScaleT:Tween = new Tween(badge_mc, "_y", Strong.easeOut, 100, 60, .7, true);
var xScaleT:Tween = new Tween(badge_mc, "_height", Strong.easeOut, 2000, 123, .7, true);
var xScaleT:Tween = new Tween(badge_mc, "_width", Strong.easeOut, 2000, 133.6, .7, true);
var xScaleT:Tween = new Tween(badge_mc, "_rotation", Strong.easeOut, 0, random_num, 1.2, true);
Right now one single card is animated in, then disappears and another animates in.
I wish to have each card remain on the screen. have one animate in and remain on screen, then another animate down on top of the first and remain, etc until I have perhaps 15 cards on screen at once.
I think the listener object is my route, but I don't understand the syntax.. I've tried a ton of different code attempts with no success.
you can see my source here: block_tweenClass_test.fla
any help would be greatly appreciated. Cheers.
Multiple Motion Tween Optimisation
Ive been using Flash and Kirupa for some time now, Kirupa is awesome, but i never got around to using your forums.
Anyway, here is my code:
Code:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
logo_tp._alpha = 0;
homebtn1._alpha = 0;
homebtn1_opt1._alpha = 0;
homebtn1_opt2._alpha = 0;
homebtn2._alpha = 0;
homebtn3._alpha = 0;
homebtn4._alpha = 0;
var logoalpha:Tween = new Tween(logo_tp, "_alpha", None.easeNone, 0, 100, 15, false);
var logoxin:Tween = new Tween(logo_tp, "_xscale", Back.easeOut, 50, 100, 30, false);
var logoyin:Tween = new Tween(logo_tp, "_yscale", Back.easeOut, 50, 100, 30, false);
logoyin.onMotionFinished = function(){
var ease:Function = new Function(Back.easeOut);
var frames:Number = new Number(30);
obj = homebtn1
var num:Tween = new Tween(obj, "_alpha", None.easeNone, 0, 100, frames / 2, false);
var num:Tween = new Tween(obj, "_xscale", ease, 50, 100, frames, false);
var num:Tween = new Tween(obj, "_yscale", ease, 50, 100, frames, false);
obj = homebtn2
var num:Tween = new Tween(obj, "_alpha", None.easeNone, 0, 100, frames / 2, false);
var num:Tween = new Tween(obj, "_xscale", ease, 50, 100, frames, false);
var num:Tween = new Tween(obj, "_yscale", ease, 50, 100, frames, false);
obj = homebtn3
var num:Tween = new Tween(obj, "_alpha", None.easeNone, 0, 100, frames / 2, false);
var num:Tween = new Tween(obj, "_xscale", ease, 50, 100, frames, false);
var num:Tween = new Tween(obj, "_yscale", ease, 50, 100, frames, false);
obj = homebtn4
var num:Tween = new Tween(obj, "_alpha", None.easeNone, 0, 100, frames / 2, false);
var num:Tween = new Tween(obj, "_xscale", ease, 50, 100, frames, false);
var num:Tween = new Tween(obj, "_yscale", ease, 50, 100, frames, false);
obj = homebtn_shad
var num:Tween = new Tween(obj, "_alpha", None.easeNone, 0, 100, frames / 2, false);
var num:Tween = new Tween(obj, "_xscale", ease, 50, 100, frames, false);
var num:Tween = new Tween(obj, "_yscale", ease, 50, 100, frames, false);
}
homebtn1.onPress = function() {
homebtn1_opt1._alpha = 100;
homebtn1_opt2._alpha = 100;
var homebtn1xover:Tween = new Tween(homebtn1, "_x", Bounce.easeOut, homebtn1._x, 630, 20, false);
var homebtn1yover:Tween = new Tween(homebtn1, "_y", Bounce.easeOut, homebtn1._y, 473, 20, false);
var homebtn1_opt1x:Tween = new Tween(homebtn1_opt1, "_x", Bounce.easeOut, homebtn1_opt1._x, 200, 20, false);
var homebtn1_opt1y:Tween = new Tween(homebtn1_opt1, "_y", Bounce.easeOut, homebtn1_opt1._y, 120, 20, false);
var homebtn1_opt2x:Tween = new Tween(homebtn1_opt2, "_x", Bounce.easeOut, homebtn1_opt2._x, 200, 20, false);
var homebtn1_opt2y:Tween = new Tween(homebtn1_opt2, "_y", Bounce.easeOut, homebtn1_opt2._y, 180, 20, false);
}
homebtn1.onRelease = function() {
var homebtn1xout:Tween = new Tween(homebtn1, "_x", Bounce.easeOut, homebtn1._x, 650, 20, false);
var homebtn1yout:Tween = new Tween(homebtn1, "_y", Bounce.easeOut, homebtn1._y, 493, 20, false);
var homebtn1_opt1x:Tween = new Tween(homebtn1_opt1, "_x", Bounce.easeOut, homebtn1_opt1._x, 440, 20, false);
var homebtn1_opt1y:Tween = new Tween(homebtn1_opt1, "_y", Bounce.easeOut, homebtn1_opt1._y, 280, 20, false);
var homebtn1_opt2x:Tween = new Tween(homebtn1_opt2, "_x", Bounce.easeOut, homebtn1_opt2._x, 440, 20, false);
var homebtn1_opt2y:Tween = new Tween(homebtn1_opt2, "_y", Bounce.easeOut, homebtn1_opt2._y, 280, 20, false);
}
homebtn1.onReleaseOutside = function() {
var homebtn1xout:Tween = new Tween(homebtn1, "_x", Bounce.easeOut, homebtn1._x, 650, 20, false);
var homebtn1yout:Tween = new Tween(homebtn1, "_y", Bounce.easeOut, homebtn1._y, 493, 20, false);
var homebtn1_opt1x:Tween = new Tween(homebtn1_opt1, "_x", Bounce.easeOut, homebtn1_opt1._x, 440, 20, false);
var homebtn1_opt1y:Tween = new Tween(homebtn1_opt1, "_y", Bounce.easeOut, homebtn1_opt1._y, 280, 20, false);
var homebtn1_opt2x:Tween = new Tween(homebtn1_opt2, "_x", Bounce.easeOut, homebtn1_opt2._x, 440, 20, false);
var homebtn1_opt2y:Tween = new Tween(homebtn1_opt2, "_y", Bounce.easeOut, homebtn1_opt2._y, 280, 20, false);
}
Most of it is useless or repeated over and over again. As you can see I tried some optimisation in the middle but I wanted to incorporate loops etc. and i couldn't get it to work. I just want to make the code shorter overall, should save me some time adding the other 3 buttons. I'm not demanding you rewrite for me either, just give me a suggestion or maybe enhance a part of it so i get the gist.
Any tips?
If you need more information tell me, I may have missed something...
CS4: Motion Tween With Multiple Eases?
In Flash CS3, IT WAS possible to give an easing instruction to each segment (keyframes) of an animation. In Flash CS4, in between two frames of an Motion Tween, isn't it possible anymore? I'm trying but the easing instruction applies only for the entire Motion Tween.
Could anybody share workarounds?
CS4: Motion Tween With Multiple Eases?
In Flash CS3, IT WAS possible to give an easing instruction to each segment (keyframes) of an animation. In Flash CS4, in between two frames of an Motion Tween, isn't it possible anymore? I'm trying but the easing instruction applies only for the entire Motion Tween.
Could anybody share workarounds?
Trouble Changing _alpha On Multiple MC's
I'm having a bit of difficulty with this script, and I'm in over my head.
The concept is that there is one button (Graphics_mc) that is at 20% _alpha, and when it is rolled over- it goes to 100%. There is another movieclip (GraphicsSubtitle_mc) that I want to load at 0% _alpha, and go to 100% when you rollOver "Graphics_mc"
here is the script I have so far. What happens is BOTH clips load at 20% opacity, and fade back to 20%. Any ideas?
This is the Script on "Graphics_mc"
code:
{
dir = 0;
speed = 6;
this._alpha = 20;
GraphicsSubtitle_mc._alpha = 0;
}
this.onRollOver = function()
{
this.dir = 1;
GraphicsSubtitle_mc.dir = 1;
}
this.onRollOut = function()
{
this.dir = -1;
GraphicsSubtitle_mc.dir = -1;
}
useHandCursor = true;
_root.Graphics_mc.onEnterFrame = function(){
temp = _alpha + speed*dir;
Graphics_mc._alpha = Math.min(100,Math.max(temp,20));
GraphicsSubtitle_mc._alpha = Math.min(100,Math.max(temp,00));
}
Trouble Preloading Multiple .swf Files
Hello-
I've been banging my head against a wall trying to get a preloader that preloads multiple .swf files into an empty clip while a preloading animation/counter runs, but it's not working properly and I'm just mangling the code. I could really use some help. Here's what I've got going:
stop();
mcLoader = new MovieClipLoader();
loadListener = new Object();
mcLoader.addListener(loadListener);
mcLoader.loadClip("GMWEB_NIKER.swf", loader_mc);
mcLoader.loadClip("GMWEB_E4.swf", loader_mc);
mcLoader.loadClip("GMWEB_MONO.swf", loader_mc);
mcLoader.loadClip("GMWEB_adiO.swf", loader_mc);
mcLoader.loadClip("GMWEB_ASIMBA.swf", loader_mc);
mcLoader.loadClip("GMWEB_SUGAR.swf", loader_mc);
mcLoader.loadClip("GMWEB_TS.swf", loader_mc);
loadListener.onLoadStart = function() {
loader_mc.stop();
};
loadListener.onLoadProgress = function(loadTarget, loadedBytes,
totalBytes) {
preloaded = Math.floor(loadedBytes/totalBytes*100);
loaderText_txt.text = preloaded+"% loaded into "+loadTarget;
bar_mc._yscale = preloaded;
};
loadListener.onLoadComplete = function() {
loaderText_txt._visible = false;
bar_mc._visible = false;
gotoAndPlay("meat",1);
};
//
I have this all running in a scene called "preloader", with my main content timeline in a second scene called "meat". It seems to run the preloader for just long enough for the byte count of the preloader
scene to load and then jumps to the next scene, and then the .swf files are not cached and take a while to show up. Help! TIA.
Having Trouble With Multiple Instances Of The Same Object
I'm relatively new to Flash Actionscript but I've been programming in OOP for years so it only took a few days to get up to speed, however I've ran into a few weird quirks that make me wonder if I'm doing something wrong.
I've got a single scene, a main timeline within that scene and within certain frames of the main scene I've got mc's that play based on Actionscript commands. All of that works fine until I get into one of the mcs. Within them I have buttons defined on certain frames and I've assigned instance names to those buttons.
The problem is when I try to reuse an instance name on two different key frames. Within the parent scene it works fine, within the child mc only the first instance works. If I target a different frame that has the same button and instance name in the ActionScript, it does not work unless I rename the instance name in the second key frame. It sounds confusing so here is an example:
//Example_mc.Frame1 (keyframe1)
//Goes to frame 5 in Example_mc
this.button1_btn.onPress = function() {
gotoAndPlay(5)
}
//Example_mc.Frame10 (keyframe2)
//Should go to frame 5 in Example_mc but does not
this.button1_btn.onPress = function() {
gotoAndPlay(5)
}
//Example_mc.Frame10 (keyframe2)
//Properly goes to Frame5 after renaming button1 instance to button1a
this.button1a_btn.onPress = function() {
gotoAndPlay(5)
}
In the example above, when button1_btn is pressed frame 1 is properly displayed. When I try to reuse the button and button instance in frame 10, the button does not work until I rename the instance name to a unique name.
However, in the main scene, all of my navigation is done through re-usable button instances which is why I do not understand why it is not working in the child mcs.
My main question is, shouldn't I be able to re-use instance names in a child mc? If so, then what am I doing wrong?
Actionscript Animation; Trouble With Multiple Mc's.
I'm trying to have one button's scripting (button1_btn) command two mc's to move to seperate coordinates. The problem is, this code won't work on two different mc's at once. Here's what I'm putting on the mc's:
Code:
onClipEvent (load) {
_x = 341.5;
_y = 346.4;
div = 5;
}
onClipEvent (enterFrame) {
_x += (endX-_x)/div;
_y += (endY-_y)/div;
_root.background_mc.button1_btn.onRelease = function() {
endX = 121.5;
endY = 346.4;
};
}
How do I manipulate this to allow both mc's to be moved?
Trouble Making Multiple Bullets
im trying to make a top down scoller, with a ship that shoots when u press spacebar. so far, if i press the spacebar once, two bullets come out(one from each wing of the ship) and fly across the screen, but if i press the spacebar again, or hold it down, the last bullets that shot out dissappear, and new ones shoot out, i haven't the slightest idea of how to make it work. Any advice or modifications to the code would be greatly appreciated. SLX is the instance name of the ship
if(Key.isDown(Key.SPACE)){
//create bullets
attachMovie("m60_bullet","m60_bullet",1,{_x:SLX._x +41.5,_y:SLX._y-40});
m60_bullet.duplicateMovieClip("m60_bullet2",2,{_x: SLX._x-41.5,_y:SLX._y-40});
//moves bullets
}
m60_bullet._y -= m60bullspeed;
m60_bullet2._y -= m60bullspeed;
if(m60_bullet._y < upper_bound-40) {
removeMovieClip("m60_bullet");
removeMovieClip("m60_bullet2");
}
Trouble Creating Multiple Scenes
Hello all,
I am relatively new to actionscripting, so I have a question about a task that I want to complete but I do not know if it is do-able or not.
I have attached the .fla file if you would like to look at it. Here is my problem:
If you notice in the file, I have created a 'tsunami' button list. I want certain actions to happen on the other side of the divider that I created, once one of the 'tsunami' buttons are pressed. I cannot figure out if this is do-able or not.
For instance, once I press 'Contact' I would like a little animation to happen in that box and then have my contact info appear right next to it. Can somebody please help me figure out how to get this going correctly? Thanks a bunch.
-Will
IE V Firefox Multiple Preloader Trouble
Hi!
I was trying to use a preloader based on Jesse Stratford's "Sequential Preloader" tutorial, but:
On Mozilla Firefox it works beautifully on IE it doesn’t budge
Could you please help me!
Thanks
Trouble Organising Multiple Sounds...
Hey there
Ive got 2 sound files (on different layers), and i wanted one on a volume of say 75%, and the other on 35%. Whenever i change the sound volume on one, the other changes as well! how do i solve this?
Thanks
Trouble With Multiple Object Animation
I'm new to Flash Basic 8, and am getting very frustrated trying to make an animated gif to use as a background on my website.
1. Do you really need to create a separate layer and motion guide for each object? I wanted to have some 20 or so stars falling along separate paths, maybe 2 or 3 per path, but it seems you can't have more than one object per path, and only one path per layer.
2. It's okay if I have to create 20 regular layers and 20 motion guide layers, however, after 3 layers I noticed the gif slows down on the website. I published the fla to an animated, loop continuously gif. I then set the background of my asp.net website to the gif. It starts out with the stars falling normally, but they start slowing down half way down. By the time the last ones reach the bottom they're barely moving at all. When the first ones begin again at the top, they speed back up to normal and begin slowing down again.
Any help greatly appreciated - or I'm not buying this thing!
Trouble Changing Alpha On Multiple Mc's
I'm doing a menu on a site- and instead of making true roll overs- I have set the buttons (in white), onto a black background, and am using AS to alter the alpha when I roll in and out. The main buttons start at 20% alpha, go to 100% on RollOver, and back to 20% on rollOut- Thats not the problem. The problem comes next.
As the user rolls onto the instance of "Graphics_mc", I want another MC (GraphicsSubtitle_mc) appear and disappear (alpha going from 0% to 100%), right now its just going from 20% and back, with the original RollOver, and I'm sure its just a scripting error, but i can't figure it out. I'll attach the script, can anyone help?
on (release) {
_root.contents.loadMovie("Graphics.swf");
}
onClipEvent(load)
{
dir = 0;
speed = 6;
this._alpha = 20;
_parent.GraphicsSubtitle_mc._alpha = 0;
}
on (rollOver)
{
this.dir = 1;
_parent.GraphicsSubtitle_mc.dir = 1;
}
on (rollOut) {
{
this.dir = -1;
_parent.GraphicsSubtitle_mc.dir = 1
}
useHandCursor = true;
}
onClipEvent(enterFrame)
{
temp = _alpha + speed*dir;
_parent.GraphicsSubtitle_mc._alpha = Math.min(100,Math.max(temp,0));
this._alpha = Math.min(100,Math.max(temp,20));
}
And if thats more difficult than it needs to be- feel free to take liberties. Any help is appreciated. Thanks.
Trouble Changing Alpha On Multiple Mc's
I'm doing a menu on a site- and instead of making true roll overs- I have set the buttons (in white), onto a black background, and am using AS to alter the alpha when I roll in and out. The main buttons start at 20% alpha, go to 100% on RollOver, and back to 20% on rollOut- Thats not the problem. The problem comes next.
As the user rolls onto the instance of "Graphics_mc", I want another MC (GraphicsSubtitle_mc) appear and disappear (alpha going from 0% to 100%), right now its just going from 20% and back, with the original RollOver, and I'm sure its just a scripting error, but i can't figure it out. I'll attach the script, can anyone help?
on (release) {
_root.contents.loadMovie("Graphics.swf");
}
onClipEvent(load)
{
dir = 0;
speed = 6;
this._alpha = 20;
_parent.GraphicsSubtitle_mc._alpha = 0;
}
on (rollOver)
{
this.dir = 1;
_parent.GraphicsSubtitle_mc.dir = 1;
}
on (rollOut) {
{
this.dir = -1;
_parent.GraphicsSubtitle_mc.dir = 1
}
useHandCursor = true;
}
onClipEvent(enterFrame)
{
temp = _alpha + speed*dir;
_parent.GraphicsSubtitle_mc._alpha = Math.min(100,Math.max(temp,0));
this._alpha = Math.min(100,Math.max(temp,20));
}
And if thats more difficult than it needs to be- feel free to take liberties. Any help is appreciated. Thanks.
Trouble With StartDrag() And Dragging Multiple MCs
Hello,
I understand that only one MC may be dragged at any time. What I have are two different MCs on the Main Stage, each of which have in them a MC to be draggable while the mouse is in that MC's area. I don't need them to both be draggable at the same time (which is impossible); but what I DO want is to be able to have the clips automatically switch back and forth.
I was thinking of a rollOver event on the MC with an IF condition to check if it's dragger is being dragged or not. I don't know how confusing I am making this sound, so I will try to illustrate below:
"navMC" has within it a MC called "myDragScale" which should be dragged (attached to mouse) while mouse is over the navMC.
"sampleMC" has within it a MC called "dragger" which should be dragged (attached to mouse) while mouse is over the sampleMC.
Is there a way to have a conditional statement in the navMC to say "if the mouse is over me, and myDragScale isn't currently being dragged, make it drag"?
I know how to initially set a MC to drag: startDrag("myDragScale", true); but I don't know how to go about "wording" the conditional statement.
Any ideas?
MTIA
|