A Question About Tween() Function By Zeh Fernando. Help Please.
Hi, If you are familiar with Fernando's function tween(), can I call the callback function in the middle of the tweening? In this address: http://hosted.zeh.com.br/mctween/index.html I mean for example: MC1 fades in from 0 to 100. I start fading MC2 when the MC1._alpha=50;
Thanks.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 04-01-2005, 06:24 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
A Question About Tween() Function By Zeh Fernando. Help Please.
Hi,
If you are familiar with Fernando's function tween(), can I call the callback function in the middle of the tweening?
In this address: http://hosted.zeh.com.br/mctween/index.html
I mean for example:
MC1 fades in from 0 to 100. I start fading MC2 when the MC1._alpha=50;
Thanks.
Help With Tween Function(s)
Im having trouble with some script that I have written to tween elements in a MC with 3 frames, frame one contains information for tweening in arrays, frame 2 has a tween out function that I have written and frame 3 has a tween in function that I have written.
The tween functions tell the elements in the MC to go to points on the root level (ExpandBox) and to reset to its original state (ContractBox).
The problems I am getting are:
1. If I move the MC on the root level I get differing results
2. If I have more than 1 instance of the MC only one instance works properly.
I have attached the fla file I am working on, If someone could have a look and tell me the problems with my script or offer an alternative using AS I would be very grateful!
Adding _x And _y To A Tween Function
I have the function below that moves portTxtHolder to a position, it is called using:
_root.PTpos1();
function PTpos1()
{
extendTween = new TweenExtended(portTxtHolder,["_x","_y"],
easingType,[portTxtHolder._x,portTxtHolder._y],[600,505],2,true);
}
what i want to do is add or subtract from this start position to save me writing extra functions for each new postion,
to add extra _x value like:
_root.PTpos1()_x+100;
to add 100 to the portTxtHolder, the above eg does not work but i 'm not sure what to do?
[F8] Modify A Tween Function
i'm using the following code functions to control alpha values of my MC's
PHP Code:
function fade90(MC)
{
extendTween = new TweenExtended(MC,["_alpha"],
easingType3,[MC._alpha],[90],0.75,true);
}
function fade0(MC)
{
extendTween = new TweenExtended(MC,["_alpha"],
easingType3,[MC._alpha],[0],0.75,true);
}
function fade40(MC)
{
extendTween = new TweenExtended(MC,["_alpha"],
easingType3,[MC._alpha],[40],0.75,true);
}
i would like to clean my code to combine the function into one, where i can name the alpha value and MC in one single function.
eg
mc1 alpha 10
then
mc2 alpha 40!!!
my scripting skills are poor in that i can not work out how to do this?
cheers
rat
Curious Tween Function
Hi all you beloved AS gurus,
I just came across an unknown form of tweening, it looks like this :
ActionScript Code:
b1.tween("_yscale", 100, 2, "easeInOutBack", 2)
but if you just code it like that it doesn't work, so I suppose it's linked to someone's personal class.
My question is :
Then why does flash put the "tween" word in blue, as if it recognised it ?
Furthermore, when you open a parenthesis, flash gives you the usual tip on how to fill in...
Flash only put's it in blue if it's preceeded by an instance name, if you start the line with tween, flash doesn't recognise it, and when I right click on "tween" to get the help, the help turns up with the typical html error page saying that it can't show the requested page...
Anyone has an idea ?
Cheers,
David
Alpha Value In Tween Function
I think I need some guides in letting me know how the parameters work in the function.
I have the code as below and the result is so strange.
Code:
c.alpha = 0.6;
c.addEventListener(MouseEvent.ROLL_OVER, rO);
function rO(evt:Event):void
{
var alpha1Tween:Tween = new Tween(c, "alpha", None.easeInOut, 0.3, 1, 1.5, true);
trace( "1: " + c.alpha);
var alpha2Tween:Tween = new Tween(c, "alpha", None.easeInOut, 0.5, 0.3, 1.5, true);
trace( "2: " + c.alpha);
}
Code:
1: 0.296875
2: 0.5
Why the values of alpha are so strange?
public function Tween(obj:Object, prop:String, func:Function, begin:Number, finish:Number, duration:Number, useSeconds:Boolean = false)
Shouldn't the value be the same as the value of "finish:Number" ?
Thank you.
How To Kill A Tween Function ?
Hello people !
An easy one :
I was wondering if it if possible to kill a tween class function while flash is achieving it?
my_tween = new mx.transitions.Tween(target1, "_alpha", easing, 0, 100, 8);
let's take this tween for example. It runs over 8 frames' time and let's say I'd like the function to stop on the fourth because I've got another function running in that's sort of contradictory to this one, do you brilliant people know if it is possible ?
Thanks
Problem With Tween And Function
Hi,
I wanted to know if anyone could help me solve my problem. I have a function that adds in a child and tweens in the object to a certain opacity. That works fine. When I click my close_btn I have a tween that is supposed to tween out that same object to 0 opacity and then remove. The problem I am having is that when I click the close_btn, the object just gets removed with no tween taking place. How can this be resolved.
Thanks.
code is attached.
Attach Code
import fl.motion.easing.*
import fl.transitions.Tween;
import fl.transitions.easing.*;
var myXML:XML = new XML();
var thisImage:String = new String();
var imageLoader:Loader = new Loader();
var xmlLoader:URLLoader = new URLLoader();
var current:String = "off";
var Grey:greyOut = new greyOut();
var dropShadow:DropShadowFilter = new DropShadowFilter();
dropShadow.distance =5;
dropShadow.blurX=4;
dropShadow.blurY=4;
dropShadow.alpha=.6
dropShadow.angle=90;
xmlLoader.addEventListener(Event.COMPLETE, handleComplete);
xmlLoader.load(new URLRequest("sherwoodText.xml"));
var popUp:WindowPopUp = new WindowPopUp();
var Sherwood:sherwoodMap = new sherwoodMap();
addChild(Sherwood);
var pin1:Pin1 = new Pin1();
pin1.x=250;
pin1.y=600;
addChild(pin1);
var pin2:Pin1 = new Pin1();
pin2.x=250;
pin2.y=550;
addChild(pin2);
function loadImage(thisImage:String):void {
imageLoader.load(new URLRequest(thisImage));
imageLoader.x=289;
imageLoader.y=3;
popUp.addChild(imageLoader);
trace(thisImage);
}
function RemoveGrey(Grey):void {
removeChild(Grey);
}
popUp.close_btn.addEventListener(MouseEvent.CLICK, exitWindow);
function exitWindow(event:MouseEvent):void {
tweenOut(Grey);
RemoveGrey(Grey);
removeChild(popUp);
}
function tweenGrey(Grey):void {
var GreyTween:Tween = new Tween(Grey, "alpha", Elastic.easeOut, .1, .5, 3, true);
Grey.x=305;
Grey.y=395;
addChild(Grey);
}
function tweenOut(Grey):void {
var GreyTweenOut:Tween = new Tween(Grey, "alpha", Elastic.easeOut, .5, 0, 3, true);
}
function handleComplete(event:Event):void {
//Load in XML
myXML = new XML(event.target.data);
//ignore spaces
myXML.ignoreWhitespace;
trace("loaded");
popUp.filters = [dropShadow];
//Set the text boxes to proper data
popUp.display1.text =myXML.loc2.bld;
popUp.display2.text =myXML.loc2.desc;
thisImage =myXML.loc2.image;
loadImage(thisImage);
popUp.x=290;
popUp.y=240;
addChild(popUp);
current="off"
trace("displayed");
}
pin1.addEventListener(MouseEvent.CLICK, showRec);
function showRec(event:MouseEvent): void {
tweenGrey(Grey);
popUp.display1.text =myXML.loc1.bld;
popUp.display2.text =myXML.loc1.desc;
thisImage =myXML.loc1.image;
loadImage(thisImage);
popUp.x=290;
popUp.y=240;
addChild(popUp);
}
pin2.addEventListener(MouseEvent.CLICK, showAud);
function showAud(event:MouseEvent):void {
tweenGrey(Grey);
popUp.display1.text =myXML.loc3.bld;
popUp.display2.text =myXML.loc3.desc;
thisImage =myXML.loc3.image;
loadImage(thisImage);
popUp.x=290;
popUp.y=240;
addChild(popUp);
}
Call Function After Tween Is Done?
ok so i'm using mcTween2 for a project, i have movie clips animating in to start with then at a certain point i use a onTweenComplete to call a preload function. it all works to a certain point, once the function gets called the preloader starts fine but then after a few seconds the function gets called again so the preloader starts over and never actually loads anything, just keeps looping around. the only thing calling the preload function is that tween.
anyone ever have this problem before / know how to fix it?
Tween Problem With Function
I have posted a simplified version of a problem I have been having at http://www.milestoneadvertising.com/functionTest.fla.
The problem is that I have a tweening symbol that once a function is executed that specifies the x position for the symbol and stops the tween. I cannot get the tween to start again even though the MC that contains it is playing.
If you download the source file the tween automatically starts and calls a function (telling it a new x position and stops the animation) once it hits a certain frame in the animation. Then once you hit the button to restart the animation the tween will not start again, but through a trace command you can tell the MC symbol is running.
The following script is more elaborate with the same problem, that once rollover "button1" a function tells the "mask" symbol a new x position, I can't get the symbol "mask" to start tweening again. The onRollOut function plays the "symbolMC" that contains the "mask" symbol and the play head is moving but the tween is not animating.
button1.onRollOver = function() {
timedFunction = setInterval(rollOverFunction, 1);
};
button1.onRollOut = function() {
symbolMC.gotoAndPlay(20);
};
function rollOverFunction() {
if (symbolMC.mask._x<300) {
symbolMC.mask._x = symbolMC.mask._x+5;
}
if (symbolMC.mask._x>=300) {
clearInterval(timedFunction);
}
}
Any Ideas Thanks
Tween Class Function -help
Hi there,
I am fading some text for a banner in & out and some nice people on ultrashock suggested Tween Class. However im still pretty new to actionscript and have got myself confused!
I need to cut file size down so I am trying to create a function for my fade in/out instead of applying it to each frame. However each time it needs to target a different movieclip (text1, text2 etc).
here is my code so far:
frame=1
tex=1
import mx.transitions.Tween;
import mx.transitions.easing.*;
function fadeIn() {
var tween_handler:Object = new Tween("tex+1", "_alpha", Strong.easeIn, 100, 0, 1, true);
tween_handler.onMotionFinished = function() {
gotoAndPlay ("Frame+1");
}
function fadeOut() {
var tween_handler:Object = new Tween("tex+1", "_alpha", Strong.easeIn, 100, 0, 1, true);
tween_handler.onMotionFinished = function() {
gotoAndPlay ("Frame+1");
}
}
Am I on the right path? I can't seem to get it to work- i'm assuming i have muddled it up,
Any help would be much appreciated
Laco Tween Function
Hi There,
I am using Laco tween to fade an object, then once it has finished gotoAndStop a frame in another Movie Clip.
Problem is I am having to call another function, which is a bit long winded, but the only way I can get it to work.
Does anyone have a better solution?
The code I am using is as follows:
function pageToStop(){
contentPages.gotoAndStop(_root.contentToStop);
trace("contentToStop = " + _root.contentToStop);
}
delayTarget.alphaTo(100, 0.4, 'linear', 0.4, pageToStop);
trace("At Content");
transitionCurtain.play();
Thanks
Dabush
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)
My Function, Tween To 3 Diff Positions?
function moveXthenY(mc, xpos, ypos, ypos2) {
mc.onEnterFrame = function () {
mc._x += (xpos - mc._x) / 2;
if (Math.abs(mc._x - xpos) < 1) {
mc._x = xpos;
mc._y += (ypos - mc._y) / 2;
if (Math.abs(mc._y - ypos) < 1) {
mc._y = ypos;
mc._y += (ypos2 - mc._y) / 2;
if (Math.abs(mc._y - ypos2) < 1) {
mc._y = ypos2;
if (mc._y == ypos2 and mc._x == xpos) {
delete mc.onEnterFrame;
}
}
}
};
}
**** dont work...
[CS3] Make Tween Reverse Within Function?
Hi everyone,
I'm building a fullscreen website for my client and i'm using tweenclasses for some simple animations.
When clicking a button, a menu moves from (menu._y-155) to his original position (menu._y). This part works.
I want to reverse this tween when clicking the button for the second time, but I can't use absolute coordinates, because of the fullscreen positioning of the menu.
So I want to use the onMotionFinished reverse function for the second click.
How exactly can I achieve this?
I know I can make a new tween with the opposite parameters, but that doesn't work when scaling the browser.
This is my AS so far:
PHP Code:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
var incr = 0;
personal_but.onRelease = function() {
incr++;
if (incr>1) {
incr = 0;
reversing();
}
if (incr == 1) {
forwd();
}
};
function forwd() {
_root.gotoAndStop("personal");
var Personal:Tween = new Tween(_root.personal_mc, "_y", Elastic.easeInOut, (_root.personal_mc._y)-155, _root.personal_mc._y, 32, false);
};
function reversing() {
Personal.reverse();
};
The forwd works great, but the reversing part doesn't...
Any ideas?
Many thanks!
[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 Function Is Messing Up My Width
Hello All,
I posted this over at the Adobe Flash Forum, but I didn't get any kind of reply. Though I would try here as well.
I am using Flash 8 Professional for a real-world pop-up application. I have isolated a tweening problem that I can not seem to fix and I need to call in the experts. I have created a very small sample app which demonstrates my problem.
My stage is 500 x 500.
I've got a movie clip called my_mc which contains a 50 x 50 square. On the stage, it is located in the lower left-hand corner (the box is registered in the lower left corner as well).
I've got two other movie clips called FindEdge_x and FindEdge_y. They consist of a vertical line and a horizontal line respetively. They will be dynamically positioned to the top edge (FindEdge_y) and right edge (FindEdge_x) of the box after a tween has been applied to it.
When I roll over the my_mc movieclip, I am tweening it to a random height and width and then repositioning the findedgex and findedgey lines accordingly.
Am am making the following assumptions ::
The line corresponding to the top edge of the box (FindEdge_y) = my_mc._y - my_mc._height
The line corresponding to the right edge of the box (FindEdge_x) = my_mc._x + my_mc._width
The problem I am having is this -- the width and height properties of my_mc contain a level of error after the tween has been applied. The greater the distance of the tween, the greater the level of error. This makes positioning elements to the top-right corner of the box (ie, a close "X" button) nearly impossible.
The code for my sample application is as follows ::
========================================
import mx.transitions.Tween;
import mx.transitions.easing.*;
my_mc.onRollOver = function():Void
{
tmpTween = new Tween( my_mc, "_width", None.easeNone, 50, 50+random(400), 6, false );
tmpTween.onMotionFinished = function()
{
findedgex._x = my_mc._x + my_mc._width;
}
tmpTween = new Tween( my_mc, "_height", None.easeNone, 50, 50+random(400), 6, false );
tmpTween.onMotionFinished = function()
{
findedgey._y = my_mc._y - my_mc._height;
}
}
my_mc.onRollOut = function():Void
{
tmpTween = new Tween( my_mc, "_width", Strong.easeOut, my_mc._width, 50, 6, false );
tmpTween.onMotionFinished = function()
{
findedgex._x = my_mc._x + my_mc._width;
}
tmpTween = new Tween( my_mc, "_height", Strong.easeOut, my_mc._height, 50, 6, false );
tmpTween.onMotionFinished = function()
{
findedgey._y = my_mc._y - my_mc._height;
}
}
findedgex._x = my_mc._x + my_mc._width;
findedgey._y = my_mc._y - my_mc._height;
=============================================
1) Is this a problem with my code or with the Tween class? (I have tried various easings and they all yeild the same error-result)
2) Any ideas how I can counteract (ie hack) the problem away?
Thanks in advance for your help!
-Tim
A Good Tween Class Function
Hello All-
I've had problems with a custom class I've been using, so I am deciding to just use the built in classes flash ships with for tweening. Does anyone have or can show me how to have just one big Tween function so that when I call it to move something, it would only require something like this:
TweenThis(my_mc, property, newPos, SomeFunctionOnceTweenFinished);
Any help apprecitated...thanks...
Using A Tween Function According To Relative Position Of Mc
Hello, I'm using a tween function and I want to move an obect relative to it's current position. Like say, MC15.xSlideTo(MC15._x+10, .6, easeOutExpo);
Here's my code:
ActionScript Code:
function thumbRoll(tagID)
{
_root["MC"+tagID].xSlideTo(_root.MC[tagID]._x - 10, .6,"easeInExpo");
_root["MC"+tagID].ySlideTo(_root.MC[tagID]._y + 10, .6,"easeInExpo");
} // End of the function
I want to have one function for all the different clips as there will be 65 clips.
The problem is that the mc moves all the way across the screen.
Here's an example: http://www.metapps.com/testing/areas2.html
rollover the names in the drop down list
Tween.onMotionFinished = Function() Problem.
Hi folks!
(I've searched for this problem and found similiar, but couldn't find any real answer.)
I've got a problem with a onMotion function. I'll show you. =)
Quote:
function ape() {
myTween.onMotionFinished = function() { // Problem here! This never runs!
<..some code..>
anotherFunction();
}
}
function donkey() {
var myTween:Tween = new Tween(....);
}
Anyone know how to solve this? I've tried with _root.myTween but it doesn't help.
All help appreciated! =)
Tween Not Working In An .onLoadComplete Function?
Hello all - been a while since I've treaded these waters (like the new facelift, btw ). But now I've got something that's completely stumping me and I'm hoping one of you fine people can help me out.
I'm building a dynamic image gallery - got that part working. I read the contents of the database through php, push that data into flash with a LoadVars object, and then use the resultant data to pull the image off the server. I'm loading the images using a MovieClipLoader so I can have a preloader and - I was hoping - slightly more control. Here's the issue that I've come across -
This is code that loads the actual images -
ActionScript Code:
portImgsCat.onLoad = function():Void{
var j:Number = 0;
var k:Number = 1;
var thumbWide:Number = 130;
var thumbHigh:Number = 130;
var crY:Number = 0;
var crX:Number = 0;
for(i=0; i<portImgsCat.totRows; i++){
var crThumb:String = "thumb"+i;
var crLoc:String = "loc"+i;
var crID:String = "id"+i;
//create the scroller base for the portfolio thumbnails, if necessary...
rPane.createEmptyMovieClip("scroller", rPane.getNextHighestDepth());
//attach the thumbnails and set the id variable for each
rPane.scroller.attachMovie("thumbnail", [crThumb], rPane.getNextHighestDepth());
rPane.scroller[crThumb].imgID = portImgsCat[crID];
//take care of the onClick event for each thumbnail...
rPane.scroller[crThumb].onRelease = function():Void{
getImage(this.imgID);
}
tImg.addListener(thumbListener);
//load the thumbnail images...
tImg.loadClip("makeImage.php?img="+portImgsCat[crLoc], rPane.scroller[crThumb].imgHolder);
tImg.loadClip("makeImage.php?img="+portImgsCat[crLoc], rPane.scroller[crThumb].imgRef);
//position the thumbnails...
rPane.scroller[crThumb]._y = crY;
rPane.scroller[crThumb]._x = thumbWide * j;
// rPane.scroller[crThumb]._x = 675;
if(j < 4){
j++;
}else{
//reset positioning info on the next line down...
j = 0;
crY = (thumbHigh * k);
k++;
}
crX = thumbWide*j;
//duplicate the images for the "reflection"...
rPane.scroller[crThumb].imgRef._rotation = 180;
rPane.scroller[crThumb].imgRef._xscale = -100;
rPane.scroller[crThumb].imgRef._alpha = 40;
}
//create the masking for the scroller movie clip...
rPane.createEmptyMovieClip("masking", rPane.getNextHighestDepth());
rPane.masking.beginFill(0x000000, 0);
rPane.masking.lineTo(640, 0);
rPane.masking.lineTo(640, 640);
rPane.masking.lineTo(0, 640);
rPane.masking.lineTo(0, 0);
rPane.masking.endFill();
//set the scroller mask...
rPane.scroller.setMask(rPane.masking);
//add the scrollbars if the scroller movieclip is taller than the masking..
if(rPane.scroller._height >= 640){
rPane.attachMovie("scrollBar", "scrollBar", rPane.getNextHighestDepth());
rPane.scrollBar._x = 640;
rPane.scrollBar._y = 50;
//handle the click events for the scrollbar...
//up ->
rPane.scrollBar.dn.onPress = function():Void{
sclIt = setInterval(scrollDn, 10);
}
rPane.scrollBar.dn.onRelease = function():Void{
clearInterval(sclIt);
}
//down ->
rPane.scrollBar.up.onPress = function():Void{
sclIt = setInterval(scrollUp, 10);
}
rPane.scrollBar.up.onRelease = function():Void{
clearInterval(sclIt);
}
}
var portImgsCat:LoadVars = new LoadVars();
}
This is loading in all my images in perfect rows with the proper spacing between and the proper amount of images across. Yay. However, what I'd like to have is for the images (once they're done loading) slide in using a tween from the right of the screen. So, to test, I uncomment the line "rPane.scroller[crThumb]._x = 675;" and comment out the line "rPane.scroller[crThumb]._x = thumbWide * j;". So, now I've got all my thumbnails overlapping nicely off the edge of my stage.
Now the rest of the code -
ActionScript Code:
thumbListener.onLoadComplete = function(tgt:MovieClip){
eval(tgt)._parent.preloader.removeMovieClip();
new Tween([eval(tgt)._parent], "_x", mx.transitions.easing.Strong.easeOut, eval(tgt)._parent.x, 10, 2, true);
}
This does nothing. At all. The tween should work, right? Or has my cold finally eaten the last of my brain? I'm still on Flash MX Professional 2004, btw.
Stop A Tween Class In Another Function
hi all, i jjust want to know a way how to (on the rollout) stop the tweens that are happening on the rollover
Code:
for (i=0; i<=sections.length; i++) {
this[sections[i]+""].onRollOver = function() {
var heightGo:Tween = new Tween(this, "_height", Strong.easeOut, this._height, 2*this._height, 0.3, true);
var widthGo:Tween = new Tween(this, "_width", Strong.easeOut, this._width, 2*this._width, 0.3, true);
};
this[sections[i]+""].onRollOut = function() {
var heightGoBack:Tween = new Tween(this, "_height", Strong.easeOut, this._height, 0.5*this._height, 0.3, true);
var widthGoBack:Tween = new Tween(this, "_width", Strong.easeOut, this._width, 0.5*this._width, 0.3, true);
};
}
I don't know how to reference a tween within that function :S
Tint Tween/fade Function
Hello Kirupa (first post here).
Im kinda stuck with a little project i hope you guys can help me with.
Im in need of a function which on mouseOver fade/tints to one colour (script definded) and on mouseOut fades back to original colour. (for multiple movieclips)
Iwe been through the forums.. tryed a bit of coding but couldnt get it to work ..
Anyone have an example that does the above?
Thanks in advance!
Kasper
Tween Function Mini-tutorial
This def. isn't where this should be posted, but i couldn't really find an appropriate forum..
Anyways, this is a small tutorial i put together on the tween functions that were written by Zeh Fernando (w/ Robert Penner's easing equations).
These simple functions are very handy and if you aren't already using them, i would strongly suggest taking a look at this tutorial.
word.
http://www.gigsoft.com/tween
btw- i'm going to add a few more things (like volume and pan tweens) in the next few days, so if you have any suggestions on what else i should include, let me know.
-evan
Cannot Reference A Tween Inside A Function.
Hi
Im sure im being a bit stupid but i cannot seem to reference a tween inside a function. Just want to use tweenName.stop(); and tweenName.resume(); but no dice. Can anyone shed any light?
Thanks
Tween Code
Code:
//////////load stuff
import mx.transitions.Tween;
import mx.transitions.easing.*;
//////////variables
var restart:Boolean = true;
var targX:Number = 0;
//////////functions
function fadeClip(who, targX){
var tw1:Tween = new Tween(who,"_x",Regular.easeInOut,who._x,targX,100,false);
tw1.onMotionFinished = function() {
tw1.yoyo();
};
}
fadeClip(clip01,0);
Button Code
Code:
clip01.onRollOver = function(){
//trace("fading uP");
//if(rolled == false){
tw1.stop();
}
clip01.onRollOut = function(){
tw1.resume();
}
Variable Instead Of Movieclip In Tween() Function
I'm looping through an array of movieclips, and I'd like them all to move. Right now they would move at one time but eventually I'd like a pause in between each move.
I can't seem to get the Tween() function to understand a variable in place of the clip name, so it will find the next one in the array and move it.
Not sure how to do this, but here's my script...
Code:
stop();
import mx.transitions.easing.*;
import mx.transitions.Tween;
var roomTween:Tween;
function moveClip(begin:Number, end:Number):Void {
var seconds:Number = 1;
var useSeconds:Boolean = true;
roomTween = new Tween(clipArray[i], "_x", Regular.easeInOut, begin, end, seconds, useSeconds);
}
var clipArray:Array = new Array();
clipArray[0] = "one_mc";
clipArray[1] = "two_mc";
clipArray[2] = "three_mc";
clipArray[3] = "four_mc";
function loopClips() {
for(i=0;i<clipArray.length;i++) {
var new_name:String = (i+1) + clipArray[i];
_root.attachMovie(clipArray[i], new_name, getNextHighestDepth(), {_x:i, _y:i});
trace(new_name);
moveClip(0, 550);
}
}
loopClips();
Anyone have any ideas?
Thanks!
-B
RemoveClip Not Working In Function With Tween Class
The function and loop create the button states for 8 buttons that have captions when rolled over and stick when clicked to indicate which section you are in.
The function for the onRollOut states is using the tween class to fade out the clip before it removes it. For some reason it will fade out any of the captions on the first rollOut, but subsequent rollOuts fail to remove the clip.
I'm pretty sure it's the removeClip that is where the problem lies, and perhaps the tween class is adding some complexity.
Are there any tutorials on function syntax? Everything I've found so far hasn't been this in-depth.
Code:
function createSubNav (j) {
var capOn = "cap" + j;
var newCapOn = "cap"+ j + "b";
var curMcButton = this["mc_button"+j];
// buttons with captions
_root["mc_button"+j].j = j;
_root["mc_button"+j].capOn = capOn;
_root["mc_button"+j].newCapOn = newCapOn;
// creates each button's onRollOver state, fades in the caption using tween class
_root["mc_button"+j].onRollOver = function () {
this.attachMovie(this.capOn, this.newCapOn, this.getNextHighestDepth());
new mx.transitions.Tween(this[newCapOn], "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 1.25, true);
}
// creates the onRollOut state that should fade out the caption using the tween class
_root["mc_button"+j].onRollOut = function () {
trace("newCapOn is " + this.newCapOn);
var ncoFade = new mx.transitions.Tween(this[newCapOn], "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 1, true);
// using the onMotionFinished function to remove the clip after it is done fading out.
// this is perhaps where the problem lies, most likely in my syntax
ncoFade.onMotionFinished = function() {
trace("newCapOn is " + newCapOn);
this[newCapOn].removeMovieClip();
}
}
// to avoid issues/bugs this should have the same actions as the onRollOut (fade out and remove captions
_root["mc_button"+j].onDragOut = function () {
//trace("newCapOn is " + this.newCapOn);
this[newCapOn].removeMovieClip();
}
// creates the onPress functions for each, and because there are two main buttons they
// are associated with (mc animations), this breaks them up and removes the opposite
//captions and movieclip
if (this.j<=4) {
_root["mc_button"+j].onPress = function () {
removeCaps ( this.j, 1);
}
} else {
_root["mc_button"+j].onPress = function () {
removeCaps ( this.j, 2);
}
}
};
Making Tween Function Available To Entire Movie?
Hi,
I have the following function on my main timeline:
Code:
_global.importTrans = function() {
import mx.transitions.*;
import mx.transitions.easing.*;
};
Further down the timeline I am attaching mcs to a container on the main stage and trying to call importTrans(), but to no avail. The only way that I can get it to work is if I paste the code on the timeline of each attached mc and then call it. Considering that I have dozens of mcs to attach, is there any sort of workaround for this?
Thanks
Emptying Text Field In A Function Before A Tween
With a bit of help, I have a slideshow gallery that externally loads images. There's buttons at the bottom left and when you press one a new externally loaded image loads up (the old image fades out and the new one fades in). The title (a Textfield) of the image aligns to the bottom right of the image and I have a listener that automatically finds out what the width of the image being loaded is, that gets put in a variable and that variable is then used to change the x position of the title textfield and thus align it to the right of the image (as the images are of different widths).
It all works okay, but I want the textfield to be empty as soon you press the button, the tween to happen and then the new text/title to appear. At the moment the text shows the old title, then the tween happens and then the new title comes up.
Ermm.. does this make sense? I'm a newbie!
Any thoughts would be most welcome...
Here's some code
import mx.transitions.Tween;
import mx.transitions.easing.*;
this.createEmptyMovieClip("container_mc",this.getN extHighestDepth());
this.createEmptyMovieClip("buttons_mc1",this.getNe xtHighestDepth());
this.createEmptyMovieClip("buttons_mc2",this.getNe xtHighestDepth());
this.createEmptyMovieClip("buttons_mc3",this.getNe xtHighestDepth());
var mywide:Number;
var clipList:Object = new Object();
var clipLoad:MovieClipLoader = new MovieClipLoader();
clipLoad.addListener(clipList);
clipList.onLoadInit = function(target:MovieClip) {
trace(" width = "+ target._width+" height = "+ target._height);
mywide = (target._width-mytext._width);
setX();
}
buttons_mc1.attachMovie("one","one_mc",buttons_mc1 .getNextHighestDepth());
buttons_mc1.one_mc._x = 1;
buttons_mc1.one_mc._y = Stage.height-buttons_mc1.one_mc._height-2;
buttons_mc2.attachMovie("two","two_mc",buttons_mc2 .getNextHighestDepth());
buttons_mc2.two_mc._x = 10;
buttons_mc2.two_mc._y = Stage.height-buttons_mc2.two_mc._height-2;
buttons_mc3.attachMovie("three","three_mc",buttons _mc3.getNextHighestDepth());
buttons_mc3.three_mc._x = 20;
buttons_mc3.three_mc._y = Stage.height-buttons_mc3.three_mc._height-2;
function setX(){
mytext._x = mywide;
mytext.text = newText;
mytext.setTextFormat(myTextFormat);
};
function setNewText(){
mytext.text = newText;
mytext.setTextFormat(myTextFormat);
};
_root.createTextField("mytext",105,125,428,300,100 );
var newText = "TITLE ONE"
mytext.text = newText;
trace(mytext);
mytext.embedFonts = true;
myTextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.size = 11;
myTextFormat.color = 0x000000;
myTextFormat.align = "right";
mytext.setTextFormat(myTextFormat);
textInstance.setTextFormat(myTextFormat);
clipLoad.loadClip('1.jpg',container_mc);
function fadeIn() {
var MyfadeIn = new Tween(container_mc, "_alpha", Strong.easeOut, 0, 100, 36, false);
}
function fadeOut() {
var MyfadeOut = new Tween(container_mc, "_alpha", Strong.easeOut, 100, 5, 20, false);
}
buttons_mc1.one_mc.onRelease = function() {
newText = "TITLE ONE"
setNewTex()
new Tween(container_mc, "_alpha", Strong.easeOut, 100, 0, 20, false).onMotionFinished = function() {
clipLoad.loadClip('1.jpg',container_mc);
newText = "TITLE ONE"
setNewTex()
fadeIn();
};
};
buttons_mc2.two_mc.onRelease = function() {
new Tween(container_mc, "_alpha", Strong.easeOut, 100, 0, 20, false).onMotionFinished = function() {
clipLoad.loadClip('2.jpg',container_mc);
fadeIn();
fadeIn();
newText = "TITLE TWO"
setNewTex()
};
};
buttons_mc3.three_mc.onRelease = function() {
new Tween(container_mc, "_alpha", Strong.easeOut, 100, 0, 20, false).onMotionFinished = function() {
clipLoad.loadClip('3.jpg',container_mc);
fadeIn();
fadeIn();
newText = "TITLE THREE"
setNewTex()
};
};
Adding Easing Tween -- To Exisiting Function
Adding Easing Tween -- to exisiting function
Ok so I found this nice code over at Prototype. Its a function for Aligning to stage on Resize. http://proto.layer51.com/d.aspx?f=1514
It works really nice on its own but I was hoping to add some tweened easing as an additional optional parameter. (I posted there twice asking for help to no avail =( So I am asking here at Kirupa, hoping someone can help me with my struggles. What I wish to add is - implementing and adding an "easing" function as part of the current function. Something generalized to be called only if desired and the ability to set the ease type, duration, maybe prop etc.. (or whatever needed to make it work )
I have tried all kinds of things and below is as close as I can come (at least the only thing I can do to get the thing to move, although as you will see it works backwards and I can only get it to work using stage.width, stage.height, however I have tried newX oldX and all kinds of other things and cant seem to get things to move.
I am missing something, perhaps everything
Code:
// Original Script found here --
// Functions: Align to stage on Resize -- http://proto.layer51.com/d.aspx?f=1514
// +++ Stage Align +++
// onR function is used with fullscreen & "T(op)L(eft)" Stage.align as a ref point!!!
//fscommand( "fullscreen", true ); // <<-- Optional if needed
import mx.transitions.Tween;
import mx.transitions.easing.*;
Stage.scaleMode = "noScale";
Stage.align = "TL";
// Optional Easing -- I am trying to add with no success =(
function mover(obj:MovieClip, startX:Number, startY:Number, endX:Number, endY:Number) {
var tweenX:Tween = new Tween(obj, "_x", Regular.easeInOut, startX, endX, 1, true);
var tweenY:Tween = new Tween(obj, "_y", Regular.easeInOut, startY, endY, 1, true);
}
// trigger alignment via Stage listener object!
// alignment options: "TL", "TR", "TC", "BL", "BR", "BC", "CL", "CR", "CC"
// optional offset by X or Y axis provided as an object property: obj.X, obj.Y
function onR(A, obj) {
var F = String(A).substring(0, 1);
var L = String(A).substring(1, 2);
(obj.X == undefined) ? obj.X=0 : obj.X=obj.X;
(obj.Y == undefined) ? obj.Y=0 : obj.Y=obj.Y;
if (F == "T") {
obj._y = Math.ceil(obj.Y);
} else if (F == "B") {
obj._y = Math.ceil(Stage.height-obj._height-obj.Y);
} else if (F == "C") {
obj._y = Math.ceil((Stage.height-obj._height)/2-obj.Y);
}
if (L == "L") {
obj._x = Math.ceil(obj.X);
} else if (L == "R") {
obj._x = Math.ceil(Stage.width-obj._width-obj.X);
} else if (L == "C") {
obj._x = Math.ceil((Stage.width-obj._width)/2-obj.X);
}
}
//Usage
// ... later
// -- OPTIONAL positioning - to add further positioning of items if needed
mc_1.X = 100;
// X offset for mc_1 used for Center Left alignment
mc_2.Y = -50;
// Y offset for mc_2 used for Center Right alignment
var resizeListener:Object = new Object();
resizeListener.onResize = function() {
onR("CL", mc_1);
onR("CR", mc_2);
// Optional Easing Call to mover function -- I am trying to add with no success =(
// I know its set to stage center now but with all my efforts, this is the only senerio
// I can get anything to move, I tried newX old X etc.. this. and on and on.. can
// someone be so kind to help me add an "optional" workable easing function to this
// script? Mucho Apreciato to anyone that does ;-)
mover(mc_1, mc_1._x, mc_1._y, Math.round(Stage.width/2), Math.round(Stage.height/2));
mover(mc_2, mc_2._x, mc_2._y, Math.round(Stage.width/2), Math.round(Stage.height/2));
};
Stage.addListener(resizeListener);
// also the 2 mcs have registration in upper left etc..
I am open to suggestions on implementation, I just thought this function from prototype was pretty slick really and wanted to add some easing to it. It should be possible, I just cant get my head wrapped around it.
Can anyone please provide some help? I really appreciate your input people Thanks for your help.
__________
Simplify What I am asking:
http://proto.layer51.com/d.aspx?f=1514
Add easing to the above function found at that link (also posted above) on browser resize, so any MCs using the align function ease to there new location instead of just snapping into place.
Thanks everyone
Call Function Scripted On Tween Complete
im trying to make an event listener for a when a tween completes, and im not having any luck, any advise
my script
function startmove(event:KeyboardEvent) {
switch (event.keyCode) {
case 17 :
if ((blasts>0) && (blown)) {
blasts -= 1;
updateblasts();
blown = false;
blastx = ship.x;
blasty = ship.y-(ship.height/2);
bomb = bhold.addChild(new blast());
bomb.name = bomb;
bomb.x = blastx;
//bomb.addEventListener(Event.ENTER_FRAME, dropbomb);
bombtween:Tween = new Tween(bomb, "y", null, blasty, blasty-200, .5, true);
}
break;
}
}
bombtween.addEventListener(Event.COMPLETE, removebomb);
how can i make it call the removebomb function after the tween is completed???
OnTweenComplete Function...any Way To Trigger Something Half-way Through A Tween?
Hi
I have two boxes. Box 1 moves down the page and Box 2 up the page. I can get it so, after box 1 has moved down and reached its destination, box 2 is then triggered and starts its tween up the page. I am using MC Tween and onTweenComplete();
easy enough
But I would like box 2 to start moving, half way through box 1's tween, so when the tween is only 50% complete...any ideas on doing this???
how can I constantly keep track of box1's position? So a value is being returned like every millisecond to see if it has passed, say ._y>100...any ideas??? thanks
Adding Easing Tween -- To Exisiting Function
Adding Easing Tween -- to exisiting function
Ok so I found this nice code over at Prototype. Its a function for Aligning to stage on Resize.
http://proto.layer51.com/d.aspx?f=1514
It works really nice on its own but I was hoping to add some tweened easing as an additional optional parameter. (I posted there twice asking for help to no avail =( So I am asking here at GTAL, hoping someone can help me with my struggles. What I wish to add is - implementing and adding an "easing" function as part of the current function. Something generalized to be called only if desired and the ability to set the ease type, duration, maybe prop etc.. (or whatever needed to make it work :( )
I have tried all kinds of things and below is as close as I can come (at least the only thing I can do to get the thing to move, although as you will see it works backwards and I can only get it to work using stage.width, stage.height, however I have tried newX oldX and all kinds of other things and cant seem to get things to move.
I am missing something, perhaps everything :D
Code:
// Original Script found here --
// Functions: Align to stage on Resize -- http://proto.layer51.com/d.aspx?f=1514
// +++ Stage Align +++
// onR function is used with fullscreen & "T(op)L(eft)" Stage.align as a ref point!!!
//fscommand( "fullscreen", true ); // <<-- Optional if needed
import mx.transitions.Tween;
import mx.transitions.easing.*;
Stage.scaleMode = "noScale";
Stage.align = "TL";
// Optional Easing -- I am trying to add with no success =(
function mover(obj:MovieClip, startX:Number, startY:Number, endX:Number, endY:Number) {
var tweenX:Tween = new Tween(obj, "_x", Regular.easeInOut, startX, endX, 1, true);
var tweenY:Tween = new Tween(obj, "_y", Regular.easeInOut, startY, endY, 1, true);
}
// trigger alignment via Stage listener object!
// alignment options: "TL", "TR", "TC", "BL", "BR", "BC", "CL", "CR", "CC"
// optional offset by X or Y axis provided as an object property: obj.X, obj.Y
function onR(A, obj) {
var F = String(A).substring(0, 1);
var L = String(A).substring(1, 2);
(obj.X == undefined) ? obj.X=0 : obj.X=obj.X;
(obj.Y == undefined) ? obj.Y=0 : obj.Y=obj.Y;
if (F == "T") {
obj._y = Math.ceil(obj.Y);
} else if (F == "B") {
obj._y = Math.ceil(Stage.height-obj._height-obj.Y);
} else if (F == "C") {
obj._y = Math.ceil((Stage.height-obj._height)/2-obj.Y);
}
if (L == "L") {
obj._x = Math.ceil(obj.X);
} else if (L == "R") {
obj._x = Math.ceil(Stage.width-obj._width-obj.X);
} else if (L == "C") {
obj._x = Math.ceil((Stage.width-obj._width)/2-obj.X);
}
}
//Usage
// ... later
// -- OPTIONAL positioning - to add further positioning of items if needed
mc_1.X = 100;
// X offset for mc_1 used for Center Left alignment
mc_2.Y = -50;
// Y offset for mc_2 used for Center Right alignment
var resizeListener:Object = new Object();
resizeListener.onResize = function() {
onR("CL", mc_1);
onR("CR", mc_2);
// Optional Easing Call to mover function -- I am trying to add with no success =(
// I know its set to stage center now but with all my efforts, this is the only senerio
// I can get anything to move, I tried newX old X etc.. this. and on and on.. can
// someone be so kind to help me add an "optional" workable easing function to this
// script? Mucho Apreciato to anyone that does ;-)
mover(mc_1, mc_1._x, mc_1._y, Math.round(Stage.width/2), Math.round(Stage.height/2));
mover(mc_2, mc_2._x, mc_2._y, Math.round(Stage.width/2), Math.round(Stage.height/2));
};
Stage.addListener(resizeListener);
// also the mcs have reg in upper left etc...
I am open to suggestions on implementation, I just thought this function from prototype was pretty slick really and wanted to add some easing to it. It should be possible, I just cant get my head wrapped around it. :?
Can anyone please provide some help? I really appreciate your input people Thanks for your help :)
Motion Tween Doesn't Work Inside Function
I made a motion tween that works great on it's own, but won't tween at all inside of a frame. Why not?
Here is the code as a function. What's up?:
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
fadeIn(myMC);
fadeIn = function(mc) {
var myHoriTween:Tween = new Tween (mc,"_x",Back.easeOut,900,0,1.1,true);
}
Tween Class Issue With Disabling Buttons Function
Here's the situation. I've got AS calling on the Tween class for an expansion effect on rollover and rollout. When a user clicks on a button, it activates a number of functions, including one where all the buttons are deactivated (button.enabled =false). This includes the one you just clicked.
the problem is, when you click the button and all are deactivated, the button freezes in its rollover state. I want the button to return to its original size when you rollout.
I've tried else if statements, and that didn't work. Here's the AS:
ActionScript Code:
btnTwo.onRollOver = function() {
var widePop:Tween = new Tween(btnTwo, "_xscale", mx.transitions.easing.Elastic.easeOut, 100, 125, btnThrob, true);
var highPop:Tween = new Tween(btnTwo, "_yscale", mx.transitions.easing.Elastic.easeOut, 100, 125, btnThrob, true);
highPop.start();
widePop.start();
rollOverSound();
};
btnTwo.onRollOut = function() {
var wideDrop:Tween = new Tween(btnTwo, "_xscale", mx.transitions.easing.Elastic.easeOut, 125, 100, btnThrob, true);
var highDrop:Tween = new Tween(btnTwo, "_yscale", mx.transitions.easing.Elastic.easeOut, 125, 100, btnThrob, true);
wideDrop.start();
highDrop.start();
};
btnTwo.onRelease = function() {
disableButtons();
}
Tween Class Issue With Disabling Buttons Function
Here's the situation. I've got AS calling on the Tween class for an expansion effect on rollover and rollout. When a user clicks on a button, it activates a number of functions, including one where all the buttons are deactivated (button.enabled =false). This includes the one you just clicked.
the problem is, when you click the button and all are deactivated, the button freezes in its rollover state. I want the button to return to its original size when you rollout.
I've tried else if statements, and that didn't work. Here's the AS:
ActionScript Code:
btnTwo.onRollOver = function() {
var widePop:Tween = new Tween(btnTwo, "_xscale", mx.transitions.easing.Elastic.easeOut, 100, 125, btnThrob, true);
var highPop:Tween = new Tween(btnTwo, "_yscale", mx.transitions.easing.Elastic.easeOut, 100, 125, btnThrob, true);
highPop.start();
widePop.start();
};
btnTwo.onRollOut = function() {
var wideDrop:Tween = new Tween(btnTwo, "_xscale", mx.transitions.easing.Elastic.easeOut, 125, 100, btnThrob, true);
var highDrop:Tween = new Tween(btnTwo, "_yscale", mx.transitions.easing.Elastic.easeOut, 125, 100, btnThrob, true);
wideDrop.start();
highDrop.start();
};
btnTwo.onRelease = function() {
disableButtons();
}
Motion Tween Doesn't Work Inside Function
I made a motion tween that works great on it's own, but won't tween at all inside of a frame. Why not?
Here is the code as a function. What's up?:
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
fadeIn(myMC);
fadeIn = function(mc) {
var myHoriTween:Tween = new Tween (mc,"_x",Back.easeOut,900,0,1.1,true);
}
Tween Class: Can One Tween More Than One Property Using The Same Tween
I want to scale both the _xscale and the _yscale properties of a clip, using a single execution of the Tween Class. See example below:
Code:
import mx.transitions.Tween;
var myTween:Tween = new Tween(myMovieClip_mc, "_xscale", Strong.easeOut, myMovieClip_mc._xscale, 300, 5, false);
Since one property at a time must be passed as a string to the constructor, I tried the following code, but it does not work quite as flawless as I expected:
Code:
myTween.onMotionChanged = function() {
//trace( this.position );
myMovieClip_mc._yscale += (300 - myMovieClip_mc._yscale)/12;
};
Any suggestions?
Using Stop(); On A Shape Tween Of A Swapped Movie Clip Symbol Within A Motion Tween
Thanks a lot for your time. I'm new to actionscript, and language syntax and I never really got along to begin with so I appreciate any help in the matter.
Basically the title says it all - I made a motion tween in the main scene, made a movie clip symbol (to shape tween a gradient) and added a stop(); inside the gradient-tweened-symbol. I then swapped the movie clip symbol with the motion tween in the main scene, and got exactly the effect I wanted (the item moved, then tweened itself) but the stop(); seems to have no effect.
I know this looks like one of those "that idiot didn't google before posting" questions, but I've been looking for about a half hour with different permutations of stop, doesn't work, actionscript, and flash, and I haven't found anything that seems to target this problem specifically.
If you've got any idea what's going wrong, please feel free to respond or show me how to better seek help on my own. Thanks again.
Tween Class If Moved Mc Passed Point Start Another Tween
Hey Actionscript Gurus
Now I am using the Tween Class to move some boxes in my movie, now I can move the first mc and then another mc after the first tween has finished with onMotionFinished but I was hoping someone could help with how do I start the second tween when the first mc has passed a certain _x coordinate.
ie starting the second mc moving while the first tween is still moving.
I am trying to do a intro loader for my front page controlling around 7 boxes. So I need to repeat this a few times.
Regs,
Jacko
Tween Class If Moved Mc Passed Point Start Another Tween
Hey Kirupa Flash Gurus
Now I am using the Tween Class to move some boxes in my movie, now I can move the first mc and then another mc after the first tween has finished with onMotionFinished but I was hoping someone could help with how do I start the second tween when the first mc has passed a certain _x coordinate.
ie starting the second mc moving while the first tween is still moving.
Regs,
Jacko
Laco Tween Engine Versus Flash Native Tween
i am wondering if there is a way to put a delay (seconds) on the flashs' native tween class like you can on the laco tween engine... such as
Code:
#include "lmc_tween.as"
my_mc.tween("_x",100,1,"easeOutStrong",1.5,callbackFunction)
where "1.5" is would be the one and a half second delay before the tween starts. this is very useful to me because i dont have to use a callback function or an onMotionFinished function to start a new tween.
thanks in advance to anyone who can teach me
-frankf
Tween Class Scaling Breaks Motion Tween?
I have a movie clip which uses a motion guide to animate the entry (and eventually the exit) of a bunch of other movie clips. These smaller clips contain buttons, and animate on rollOver and rollOut using the following code:
Code:
on(rollOver) {
this.swapDepths(2);
ParentxScale = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Back.easeOut, this._xscale, 100/.6, .5, true);
ParentyScale = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Back.easeOut, this._yscale, 100/.6, .5, true);
play();
}
on(rollOut) {
ParentxScale = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Bounce.easeOut, this._xscale, 100, .5, true);
ParentyScale = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Bounce.easeOut, this._yscale, 100, .5, true);
stop();
}
However, once an object has been moused over, it doesn't exit with the others. Any ideas why it seems to "fall off the track" of the motion guide?
Shape Tween Like A Motion Tween, Using Guide Layer
How if possible, can i make a shape tween behave and follow a set path (like using a guide layer)while morhping/tweening?
So far it seems as each time i try it always goes in a straight line from a to b and in this case that's not what i'm after.
Do I Use A Shape Tween? Mask? Motion Tween?
How do I make this arrow grow into shape? I want it to slowly appear...but not fade in...
it's hard to explain...but here is the arrow, hopefully you will understand what I want...
I tried using a mask, but instead of revealing the arrow little by little, it dissapeared little by little...(basically the exact opposite)...
I also tried putting a white box over it & motion tweening the box to reveal the arrow...but that didn't look good...
any ideas?...suggestions?
thanks in advance...
|