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




Can You Invoke Something After A Code Tween Is Done.



Just like animating something on a time line I did it with code. But would like to now if it is possible to do this or not?

I have my code tween here.

Code:
Landing_flying = function(){
var maxNumber_up = 80;
var easeType = mx.transitions.easing.Regular.easeOut;
var begin1 = 50;
var end1 = 180;
var time = 34;
var Body_mc1 = body;
Flying1 = new mx.transitions.Tween(Body_mc1, "_y", easeType, begin1, end1, time, false);
// After tween invoke new function
//stop_flying(); // stops wing animations.
}


Right after it reaches the destination at the end of its tween I would like to invoke a separate function. But only after the tween is done.

If this is possible if so can some one point me in the right direction can some on pint me in the right direction.



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-07-2005, 07:01 PM


View Complete Forum Thread with Replies

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

Can You Invoke Something After A Code Tween Is Done.
Just like animating something on a time line I did it with code. But would like to know if it is possible to do this or not?

I have my code tween here.

ActionScript Code:
Landing_flying = function(){
    var maxNumber_up = 80;
    var easeType = mx.transitions.easing.Regular.easeOut;
    var begin1 = 50;
    var end1 = 180;
    var time = 34;
    var Body_mc1 = body;
    Flying1 = new mx.transitions.Tween(Body_mc1, "_y", easeType, begin1, end1, time, false);
    // After tween invoke new function
    //stop_flying(); // stops wing animations.
}

Right after it reaches the destination at the end of its tween I would like to invoke a separate function. But only after the tween is done.

If this is possible if so can some one point me in the right direction can some on pint me in the right direction.

Invoke Javascript Rolloever Code In Flash?
I want to know if it is possible to invoke javascript rolloever code in flash...???

I have an html site that when you go over one image, another image changes... It's created in fireworks...

But one bit of the site I'm going to have to change to flash but still want to keep that rollover....

So I was wondering how to get flash to call a javascript action when you rolover an image in flash to change a static gif image out of the flash movie....

To see what I mean, visit> http://members.lycos.co.uk/niietzshe/pics.html ...

the red bit is going to be in flash and I still want the viewfinder to change...


Hope someone can help with this as I'm having great difficulties...

Tween By Code?
Can someone post an example of how to tween by code?

I have a "button" mc with 3 states. Off, Over, and Big.

The movie is 5 of theses mc's in a row. I want to cycle through each button from left to right and right to left a few times, EXACTLY like the "wave" when people do that in a stadium.

After a randomly generated amount of passes, (say 20-25) it will finally stop on one of the button. Meanwhile, the whole thing has been slowing down, down, down, like watching that big wheel on "Prcie is Right" slow to a stop. Each button, of course, is a different prize.

Can someone suggest a strategy and at the least show tweening by code example(s)?

Thanks!

How To Code A Tween, On In And Out Out
Hi, I am new, so please excuse me if this is a dumb question. I am interested in having an item move +80 x on a mouseover, and back to its original position on a mouseout. But I want this to be a tween, not just a move. Is this possible using code only? Thanks

Mc Tween Code Help
HI

I am trying to make a menu using MC tween code it is working in a roundabout way just need some help with getting it working properly please see link below example of the menu

http://www.sb-dev.co.uk/stuart/menu.swf

If you click on the green tab and after its moved click on the blue tab you will see the problem the code for the menu is below.


Code:
#include "mc_tween2.as"
var tab1Hit:Boolean = false;
var tab2Hit:Boolean = false;
var tab3Hit:Boolean = false;


tab1_mc.onRelease = function () {
if (tab1Hit) {
tab1Hit = false;
tab1_mc.rotateTo(25, 2, "easeinoutback");
}else {
tab1Hit = true
tab1_mc.rotateTo(60, 2, "easeinoutback");
}

}

tab2_mc.onRelease = function () {
if (tab2Hit) {
tab2Hit = false;
tab1_mc.rotateTo(25, 2, "easeinoutback");
tab2_mc.rotateTo(20, 2, "easeinoutback");
}else {
tab2Hit = true
tab1_mc.rotateTo(60, 2, "easeinoutback");
tab2_mc.rotateTo(50, 2, "easeinoutback");
}

}

tab3_mc.onRelease = function () {
if (tab3Hit) {
tab3Hit = false;
tab1_mc.rotateTo(25, 2, "easeinoutback");
tab2_mc.rotateTo(20, 2, "easeinoutback");
tab3_mc.rotateTo(15, 2, "easeinoutback");
}else {
tab3Hit = true
tab1_mc.rotateTo(60, 2, "easeinoutback");
tab2_mc.rotateTo(50, 2, "easeinoutback");
tab3_mc.rotateTo(40, 2, "easeinoutback");
}

}

Tween Class Code Bug
I've attached the fla to display my tween class effects from http://www.flashguru.co.uk/code-twee...tweenextended/
(downloaded Tween Extended Class from http://www.sqcircle.com/downloads/)

got a weird effect on rollovers on my MC's where my controlled objects jump back to the original position without being asked.

am i missing any code to keep solid my positions.

rat

[F8] Cannot Get Tween Out To Work On This Code
any help would be much appreciated.


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

pauseTime = 2000;

xmlImages = new XML();
xmlImages.ignoreWhite = true;
xmlImages.onLoad = loadImages;
xmlImages.load("images.xml");

function loadImages(loaded) {
if (loaded) {
xmlFirstChild = this.firstChild;
imageFileName = [];
totalImages = xmlFirstChild.childNodes[0].childNodes.length;
for (i=0; i<totalImages; i++) {
imageFileName[i] = xmlFirstChild.childNodes[0].childNodes[i].attributes.title;
}
preloadIndex = 0;
preloadImages();
}
}
function preloadImages(){
picture_mc.loadMovie(imageFileName[preloadIndex]);
var pictureTweenIn:Tween = new Tween (picture_mc,"_alpha",Normal.easeIn,25,100,1,true);
preloadI=setInterval(preloadF,4000);
}
function preloadF(){
if(picture_mc.getBytesLoaded()>20&&picture_mc.getBytesLoaded()>=picture_mc.getBytesTotal()){
clearInterval(preloadI);
preloadIndex++;
var pictureTweenOut:Tween = new Tween (picture_mc,"_alpha",Normal.easeOut,100,25,1,true); // After pause, start fade out
if(preloadIndex==imageFileName.length){
randomImage();
} else {
preloadImages();
}
}
}

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!

Tween Class: Re-use Code
I've created an animation based on the Tween Class 2 Tutorial on this site. Currently everything is working correctly, but I've written the same code 3 times for three different text boxes inside movieclips. Is there a way to condense this code to make it more efficient? My code is below. Thanks!

Actions Layer

Code:
//
var gf:GlowFilter = new GlowFilter(0xffffff, 50, 4, 4, 4, 2, false, false);
var gfBX:Tween = new Tween(gf, "blurX", Elastic.easeOut, 4, 4, 1, true);
var gfBY:Tween = new Tween(gf, "blurY", Elastic.easeOut, 4, 4, 1, true);
gfBX.onMotionChanged = function() {
aboutUsAnim_mc.kText.filters = [gf];
};
//
var me:GlowFilter = new GlowFilter(0xffffff, 50, 4, 4, 4, 2, false, false);
var meCX:Tween = new Tween(me, "blurX", Elastic.easeOut,4, 4, 1, true);
var meCY:Tween = new Tween(me, "blurY", Elastic.easeOut, 4,4, 1, true);
meCX.onMotionChanged = function() {
menuAnim_mc.kText.filters = [me];
};
//
var co:GlowFilter = new GlowFilter(0xffffff, 50, 4, 4, 4, 2, false, false);
var coDX:Tween = new Tween(co, "blurX", Elastic.easeOut,4, 4, 1, true);
var coDY:Tween = new Tween(co, "blurY", Elastic.easeOut, 4,4, 1, true);
coDX.onMotionChanged = function() {
contactAnim_mc.kText.filters = [co];
};
Code on button 1

Code:
on (rollOver) {
gfBX.continueTo(10, 2);
gfBY.continueTo(10, 2);
}

on (rollOut, dragOut) {
gfBX.continueTo(5, 5);
gfBY.continueTo(5, 5);
}
Code on button 2

Code:
on (rollOver) {
meCX.continueTo(10, 2);
meCY.continueTo(10, 2);
}

on (rollOut, dragOut) {
meCX.continueTo(5, 5);
meCY.continueTo(5, 5);
}
Code on button 3

Code:
on (rollOver) {
coDX.continueTo(10, 2);
coDY.continueTo(10, 2);
}

on (rollOut, dragOut) {
coDX.continueTo(5, 5);
coDY.continueTo(5, 5);
}

AS2 - Keep Tween Code On ONE FRAME ONLY
I'm using the following code, in frame 1, and I would like to keep that actionscript from bleeding into frame 2, which it does not seem to do automatically...


Code:
N_value = wNav._x;
C_value = wContent._x;
var fTween:Object;


wContent.onRollOver = function() {
this.enabled = true;
this.useHandCursor = false;
};

wNav.onRollOver = function() {

this.useHandCursor = false;
this.enabled = true;
fTween = new mx.transitions.Tween(wNav, "_x", mx.transitions.easing.Strong.easeOut, N_value, N_value-111, 1.5, true);
new mx.transitions.Tween(wContent, "_x", mx.transitions.easing.Strong.easeOut, C_value, C_value+123, 1.5, true);
fTween.onMotionFinished = function() {
gotoAndStop(2);
};
};
The only reason why I am doing this, is because inside of wNav, I have an accordion component, and since wNav eases out on rollover, the component gets locked and therefore does not work. If anyone could help me solve that problem altogether without having to jump frames, or scenes (which is what I'm doing right now) that would help me out even more, because jumping scenes is not smooth visually at all....

Alpha Tween Code
I need a tween code, which should do this action to a movie clip:

on(rollOver){

The transparency of the movieclip "orange" will tween out from what it currently is to 40% over 20 frames

}

on(rollOut){

The transparency of the movieclip "orange" will tween out from what it currently is to 0% over 20 frames

}

Any ideas?

Cancel Code-based Tween
Hi,

I am having some problems with Tween behaviour. I have two 'pages' which are DisplayObjects with children. On the first I have an object that has a default position and it can also be tweened to a 'yes' or 'no' position. There is also a skip button which when pressed resets the position of the object to its default position.

If the object has finished tweening fully and I press the skip button to go to the next page and come back, the object is in its default position as it should be, but if I skip while the tween isn't completely finished and then come back, it will still be in the 'yes' or 'no' position.

I have tried using tween.fforward() which seems to speed it to the end of the tween, but the same problem occurs, I am wondering if the tween still runs for the same amount of time but appears as the last frame would?

Is there a way to cancel a tween?

thanks for your time

Tween Or Code To Distort MovieClip
is it possible to distort a movieclip using code or tween?
i no it is possible to skew a clip but i'd like to distort as i just want to move 2 of the co-ordinates as opposed to something like skewing.

Tween Code Position Question
Im not completely n00b at actionscript, but i'm needing help

I wanted to animate something all in actionscript instead of keyframes.
I have a navigation idea, but the basic operation i cant figure out how to code
A box is on stage, when rolled over it moves 400 pixels on x axis, but if someone was to click it while was moving, it would return to its starting position seemlesly no matter where the in the animation it was when the user clicked, and all animated

im really sorry if this didn't make sense, if it doesn't i shall try re-word it

any help would be grately appreciated

Please Help How To Attach Tween Classes To My Code
Hei,
I’m urgently looking for a solution how to attach tween classes into this code to make movement little smoother. Or to make up the whole thing on tween classes.
(this is background mc which moves up and down when clicking menu buttons).

Here is the code for background mc:

onClipEvent (load) {
_x = 0;
_y = 0;
div = 30;
}
onClipEvent (enterFrame) {
_x += (endX-_x)/div;
_y += (endY-_y)/div;

_root.menu1.onRelease = function() {
endX = 0;
endY = 0;
};
_root.menu2.onRelease = function() {
endX = 0;
endY = -500;
};
_root.menu3.onRelease = function() {
endX = 0;
endY = -1000;
};
_root.menu4.onRelease = function() {
endX = 0;
endY = -1500;
};
_root.menu5.onRelease = function() {
endX = 0;
endY = -2000;
};
}

Thanx for any help!

Code Hints For The Tween Class
Hi everybody,

Is there a way to make code hints appear for the Tween Class? I declare a new Tween with the constructor var X:Tween=new Tween... But there are no code hints when I try to use its methods.

Is there a way to make them appear?

Thanks a lot

Cancel Code-based Tween
Hi,

I am having some problems with Tween behaviour. I have two 'pages' which are DisplayObjects with children. On the first I have an object that has a default position and it can also be tweened to a 'yes' or 'no' position. There is also a skip button which when pressed resets the position of the object to its default position.

If the object has finished tweening fully and I press the skip button to go to the next page and come back, the object is in its default position as it should be, but if I skip while the tween isn't completely finished and then come back, it will still be in the 'yes' or 'no' position.

I have tried using tween.fforward() which seems to speed it to the end of the tween, but the same problem occurs, I am wondering if the tween still runs for the same amount of time but appears as the last frame would?

Is there a way to cancel a tween?

thanks for your time

[F8] My Vars Dont Work In Tween Code.
Hi guys,

im using one function to set x,y coridinates/mc name and then sending them down into another function where they are used in some tween code.

When i run a trace as shown in the tween function they all come through, but when i put them to work in the tween it doesnt work. Could anyone tell me why?
Thanks for any help!



Code:
start_placement = function () {
mc_name = "start_btn";
start_x = "564.0";
start_y = "139.6";
finish_x = "220";
finish_y = "82.0";
tween_btns(mc_name, start_x, finish_x, start_y, finish_y);
};


tween_btns = function (name_mc, x_start, x_finish, y_start, y_finish) {
trace(name_mc);
trace(x_start);
trace(x_finish);
trace(y_start);
trace(y_finish)
var menuani:Tween = new Tween(name_mc, "_x", Strong.easeOut, x_start, x_finish, 1, true);
var menuani:Tween = new Tween(name_mc, "_y", Strong.easeOut, y_start, y_finish, 1, true);
var menuani:Tween = new Tween(name_mc, "_yscale", Strong.easeOut, 150, 100, 2, true);
var menuani:Tween = new Tween(name_mc, "_xscale", Strong.easeOut, 150, 100, 2, true);
var menuani:Tween = new Tween(name_mc, "_alpha", Strong.easeOut, 0, 100, 3, true);
};
start_placement();

_xscale And _yscale With The Tween Class - Need Code Help
Basically I have some code here I'm trying to get to work to open up some more doors for me.

Two movie clips on the canvas: one is used as a button for the function and the other is having properties assigned to it with the function. What I can not get to work is the _xscale and _yscale within the Tween Class function that it is under.

I did get the _alpha to work with the same bit of code. The end result i'm looking for is onRelease of the button, an object (circle_mc) that grows and fades out over a period of 10 seconds.

I get no syntax errors so I'm puzzeled as to why the _xscale and _yscale are not working.

Here is what I have that partially works:

import mx.transitions.Tween;
import mx.transitions.easing.*;

on_btn.onRelease = turnOn;

function turnOn() {
new Tween(circle_mc, "_alpha", Regular.easeIn, 100, 0, 10, true);
new Tween(crrcle_mc, "_xscale", Strong.easeOut, circle_mc._xscale = 100, circle_mc._xscale = 1000, 10, true);
new Tween(crrcle_mc, "_yscale", Strong.easeOut, circle_mc._yscale = 100, circle_mc._yscale = 1000, 10, true);
}

Alpha Tween With Actionscript,(NOT The OnClipEvent Code) Please Help
Hello all,

I have the following weird problem, which is not caused on the alpha only, also on changes of the _x or _y property of an mc.

Say I have 10 movie clips, and a little for loop that moves though each of the movie clips and changes something about their properties, for example


Code:

mc = movie clip array()

for(var m=0; m< mc.length; m++){

for(var i=100; i<=0; i--){

mc[m]._alpha = i;

}
}
This causes all the movie clips to "turn of" at once, the user doesn't see the transition, it also happens if I change the _y or _x value, the mc just shows up at the final location without moving towards it.

Note: This code is in an external AS class, if you would like me to post it, say so, but it won't help in the current problem.

So to conclude, can anybody tell me how on earth, without using setInterval, to show the gradual process of changing a property of an mc. Or am I missing something???

This question is very stupid, I know, but trust me, It has been anoying me for the las couple of days :-).

How Can I Fade Color And Tween Shape With Code?
Hey all, this site is the best...

I have a movie clip which contains a rectangle. When a user clicks a button, I want to be able to change the size of the rectangle and fade the color of the rectangle to another color over a few seconds. I'm wondering how to do this with code.

I know how to move things over time with code, so I imagine it's similar with color and shape, but any help would be fantastic - thanks!

Button Issues While Using Tween Class Code
HALP! (and thanks in advance)

I'm using some Tween class motions activated by buttons. Here's the swf:


http://home.earthlink.net/~tacallend...%20Tweened.swf


when you click the green-circled button (the only one that works) a movie clip drops into place, with a photo showing. Click the buttons (photo, features, cross section) and the appropriate images show up. Click the "x" to close the window. Now click the green-circled button again. This time the photo does not appear, and clicking the buttons at the bottom does nothing. What's going on?

Here's the relevant code:

ActionScript Code:
btnMMRA.onRelease = function() {    releaseIt1();    disableButtons();    //call function to create swf holder in viewer unit    makeSwfHolder();    //initial swf insertion    if (_root.viewnit.viewer.currMovie == undefined) {        _root.viewnit.viewer.currMovie = "picMMRA";        _root.viewnit.viewer.swfHolder.loadMovie("picMMRA.swf");    }    //call function to slide viewer into view        var dropScreen:Tween = new Tween(_root.viewnit.viewer, "_y", mx.transitions.easing.Elastic.easeOut, -540, 0, 20, false);    dropScreen.start();    //photo button function    _root.viewnit.viewer.barHolder.bar.btnPhoto.onRollOver = function() {        var bounceBtnP:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnPhoto, "_y", mx.transitions.easing.Elastic.easeOut, 0, -14, 30, false);        baunceBtnP.start();    };    _root.viewnit.viewer.barHolder.bar.btnPhoto.onRollOut = function() {        var dropBtnP:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnPhoto, "_y", mx.transitions.easing.Elastic.easeOut, -14, 0, 30, false);        dropBtnP.start();    };    _root.viewnit.viewer.barHolder.bar.btnPhoto.onRelease = function() {        if (_root.viewnit.viewer.currMovie == undefined) {            _root.viewnit.viewer.currMovie = "picMMRA";            _root.viewnit.viewer.swfHolder.loadMovie("picMMRA.swf");        } else if (_root.viewnit.viewer.currMovie != "picMMRA") {            if (_root.viewnit.viewer.swfHolder._currentframe>=swfHolder.midframe) {                _root.viewnit.viewer.currMovie = "picMMRA";                _root.viewnit.viewer.swfHolder.play();            }        }    };    //feature button function    _root.viewnit.viewer.barHolder.bar.btnFeatures.onRollOver = function() {        var bounceBtnF:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnFeatures, "_y", mx.transitions.easing.Elastic.easeOut, 0, -14, 30, false);        baunceBtnF.start();    };    _root.viewnit.viewer.barHolder.bar.btnFeatures.onRollOut = function() {        var dropBtnF:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnFeatures, "_y", mx.transitions.easing.Elastic.easeOut, -14, 0, 30, false);        dropBtnF.start();    };    _root.viewnit.viewer.barHolder.bar.btnFeatures.onRelease = function() {        if (_root.viewnit.viewer.currMovie == undefined) {            _root.viewnit.viewer.currMovie = "featureMMRA";            _root.viewnit.viewer.swfHolder.loadMovie("featureMMRA.swf");        } else if (_root.viewnit.viewer.currMovie != "featureMMRA") {            if (_root.viewnit.viewer.swfHolder._currentframe>=swfHolder.midframe) {                _root.viewnit.viewer.currMovie = "featureMMRA";                _root.viewnit.viewer.swfHolder.play();            }        }    };    //crossection button function    _root.viewnit.viewer.barHolder.bar.btnCrossection.onRollOver = function() {        var bounceBtnX:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnCrossection, "_y", mx.transitions.easing.Elastic.easeOut, 0, -14, 30, false);        bounceBtnX.start();    };    _root.viewnit.viewer.barHolder.bar.btnCrossection.onRollOut = function() {        var dropBtnX:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnCrossection, "_y", mx.transitions.easing.Elastic.easeOut, -14, 0, 30, false);        dropBtnX.start();    };    _root.viewnit.viewer.barHolder.bar.btnCrossection.onRelease = function() {        if (_root.viewnit.viewer.currMovie == undefined) {            _root.viewnit.viewer.currMovie = "xscMMRA";            _root.viewnit.viewer.swfHolder.loadMovie("xscMMRA.swf");        } else if (_root.viewnit.viewer.currMovie != "xscMMRA") {            if (_root.viewnit.viewer.swfHolder._currentframe>=swfHolder.midframe) {                _root.viewnit.viewer.currMovie = "xscMMRA";                _root.viewnit.viewer.swfHolder.play();            }        }    };    //close the viewer    _root.viewnit.viewer.barHolder.bar.btnClose.onRollOver = function() {        var bounceBtnC:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnClose, "_y", mx.transitions.easing.Elastic.easeOut, 0, -14, 30, false);        bounceBtnC.start();    };    _root.viewnit.viewer.barHolder.bar.btnClose.onRollOut = function() {        var dropBtnC:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnClose, "_y", mx.transitions.easing.Elastic.easeOut, -14, 0, 30, false);        dropBtnC.start();    };    _root.viewnit.viewer.barHolder.bar.btnClose.onRelease = function() {        var raiseScreen:Tween = new Tween(_root.viewnit.viewer, "_y", mx.transitions.easing.Elastic.easeIn, 0, -540, 20, false);        raiseScreen.start();        closeStuff();    };};

Tween Class - Code Not Executed Within OnMotionFinished
How come the code within the onMotionFinished function never executes?


ActionScript Code:
import mx.transitions.Tween;import mx.transitions.easing.*;var topboxsectionXScale:Tween = new Tween(topboxsection_mc, "_xscale", Elastic.easeOut, 0, 100, .7, true);var middleboxsectionXScale:Tween = new Tween(middleboxsection_mc, "_xscale", Elastic.easeOut, 0, 100, .7, true);var bottomboxsectionXScale:Tween = new Tween(bottomboxsection_mc, "_xscale", Elastic.easeOut, 0, 100, .7, true);bottomboxsectionXScale.onMotionFinished = function() {    var middleboxsectionYscale:Tween = new Tween(middleboxsectiontop_mc, "_height", none, 14, 493, .7, true);    bottomboxsection_mc._y += 479;}



Edit:// Nevermind.

Alpha Tween With Actionscript,(NOT The OnClipEvent Code) Please Help
Hello all,

I have the following weird problem, which is not caused on the alpha only, also on changes of the _x or _y property of an mc.

Say I have 10 movie clips, and a little for loop that moves though each of the movie clips and changes something about their properties, for example


Code:

mc = movie clip array()

for(var m=0; m< mc.length; m++){

for(var i=100; i<=0; i--){

mc[m]._alpha = i;

}
}
This causes all the movie clips to "turn of" at once, the user doesn't see the transition, it also happens if I change the _y or _x value, the mc just shows up at the final location without moving towards it.

Note: This code is in an external AS class, if you would like me to post it, say so, but it won't help in the current problem.

So to conclude, can anybody tell me how on earth, without using setInterval, to show the gradual process of changing a property of an mc. Or am I missing something???

This question is very stupid, I know, but trust me, It has been anoying me for the las couple of days :-).

Invoke Pdf Issue....
var myRPT = [[146, "RPT146.exe"]];

onRelease = function ()
{
for (var i = 0; i< myRPT.length; i++)
{
if (_root._currentframe == myRPT[i][0])
{
fscommand("EXEC", myRPT[i][1]);
break;
}
}
}


I have a dir called fscommand with invoke,proxy, the proxy is called RPT146.
a bat file called RPT146 that has the following line of code - invoke open RPT146.pdf

i have no idea why this will not work

any ideas?

northcode ?

Invoke Function In As3
Hi,

Simple with as2... but i can't with as3..
How can i invoke a function in a parent mc... from one of its childs mc??

I've a child MC with 2 frames... in the second one i want to invoke a funtion mostrarHorario(), that is located in the parent MC of this...

Please... help me
thanks.

Tween/Transition Import Code Gives A Syntax Error
Basicly, I'm using Tweens and transitions, and am having trouble making them appear in some parts.

On a multipage website, pasting in the code:
import mx.transitions.Tween;
import mx.transitions.easing.*;

Gives me a syntax error for where the two lines appear. - This will make any transitions and tweens not appear (the two lines above need to be commented out for it to compile). However, when a page is loaded that contains the code (and gives no syntax error), the transitions and tweens in the first movie as well as the loaded clip all work fine.

What would cause a synax error when trying to use the import code?
The actual site itself you can see in progress at
http://cressaid.brettjamesonline.com/us . The drop down menus just appear, until you load either the logos, corporate id or brochures section in folio. Then they smoothly roll down

Using One Piece Of Code To Control A Groups Colour Tween
Hi guys

I have 5 simple movie clips on the stage. When each is rolled over, it simply fades into a set (the same for all) colour over 10 frames. Then back to normal on rollout. I have a stack of these to do however, can anyone point me in the right direction for 'including' the array of clips, and targetting them to tween the simple colour rollover/out via the one piece of AS?

I'm currently using a tweening class but may even scrap that given how light on it is.

Cheers

Tween Classes In XML Menu Tutorial Code Don't Work?
Hi all,

I'm working with the XML Driven Drop Down Menu Tutorial (source file here), and having trouble using the tween class in it. I'd like to convert it so that the menu slides open rather than pops out, but I can't get the tween classes to do anything anywhere in the script! Even static symbols created on a separate layer don't respond, but using the same code in a different empy file works fine. I'd assume some event handler somewhere's interfering? Any suggestions?

I'm using the source code above, and I have created a circle that's a movieclip called item1_mc (both name and instance). Here's the code snippet I'm using:


Code:
ballTween = new mx.transitions.Tween(item1_mc, "_x", mx.transitions.easing.Bounce.easeOut, 20, 380, .5, true);
Won't work in this source file, but works fine in another.

Thanks a lot, hopefully I'm not asking a question already addressed, but I searched around for a while and couldn't quite find anything.

-Charlie

Flash Gods, I Invoke You
in a nutshell:
i'm trying to move the 'playhead' on a timeline i created, thus changing the physical location of the playhead, and changing the values of dynamic text boxes which corrispond with the playhead's location.

(everything is already functional if you Drag the playhead along, but i'm trying to add an additional way to browse the
site, with a button that browses thru one spot on the timeline at a time)

****
this is what i want to do:

access the _x position of a MC called "1" (the playhead), find that number in the possible _x positions that "1" can snap to in an array called "xspot", and append that number's placement in "xspot"(0-9) to the variable "i".

i then add one to "i" (or go back to 0 if we are at the end of the array) and apply this value to the variable "nextstep"

now that i have "nextstep", i know which elements in the arrays "xspot" and another called "who" (both with 10 elements) contain the info for the next playhead position, both for the playhead's _x position "xspot", and the dynamic text's content "who"
****

this code is appended to a button, will that cause a problem?

something isn't working right...

got any clues? or better ideas to approach this oparation?

_____code_________________________________________ _______

on (release) {
// xspot is an array which contains the diff. x positions my MC "1" can snap to/park at
for (var i = 0; i < _parent._parent.xspot.length; i++) {
// i have a feeling there is something funny about this line
if (_parent._parent.1._x == _parent._parent.xspot[i]) {
if (i <= 8) {
_parent._parent.nextstep = i++;
} else if (i == 9) {
_parent._parent.nextstep = 0;
}
break;
}
}
name = _parent._parent.who[_parent._parent.nextstep];
if (name = "billybob") {
_parent._parent.1._x = _parent._parent.xspot[0];
_parent._parent.pictext.scroll = 1;
_parent._parent.pictext = "Text";
_parent._parent.biotext.scroll = 1;
_parent._parent.biotext = "More Text";
// there are many names, each with it's own dynamic text content, and coorisponding playhead position on the timeline

______end of code_________________________________________


please help!!!

quazi

Invoke A Global Function From A MC?
Hi,

I know this might be a question for the Newbie forum but here goes anyway -

In MX, I have a function on the main time line, which fades in a MC:

Code:
inertia = 5;

function Fadein(by) {
this._alpha += (by - this._alpha)/_root.inertia;
}
How do I call it from an onClipEvent handler?
Will it even work?
Do I have to target the MC I'm invoking it from?

Arrrggghhhhh help!

I know I'm missing the obvious.

Actually I may have approached it in the wrong way, so this is what I'm trying to do:

I have about sixty movieClips which fade (and eventually spin ,move, etc) in at various times in this projector - I just want to write a global function, so I don't have to re-write all the code in an onClipEvent handler every time.

Cheers in advance for any help.

Stu

How To Invoke Auto-click In AS
Hello.

Is it possible to code in AS that a button has to be clicked? I have a swf with a button on it. I want in the first frame a code that clicks the button. Does someone know if there is such a code?

Thanx in advance.

Luut.

[F8] Manual ContextMenu Invoke?
Hi all, quick question -

Is it possible to manually display a context menu at a certain point in time? I'm making an app and would like the user to be able to invoke the right-click context menu I've created when they click on a certain button on the stage. Any ideas? Thanks.

-T

Can I Invoke MouseEvent With ContextMenuEvent?
I’m new to both Flash and AS3 so hopefully I can explain my problem correctly. And if anyone has ideas on how to better approach what I’m trying to accomplish, please offer up some suggestions.

I’m producing some training and have the students click through various ‘hot spots’ on several screen captures to simulate the actual steps. At one point they are required to right click and select an option which just takes them to the subsequent step. I’ve customized my context menu.

I have a showStep function call by MouseEvent.CLICK that advances through an image array and advances the array index. When the image is loaded a function then creates the hot spots. I’ve successfully added the custom menu to the correct hot spot and have an event listener using ContextMenuEvent.MENU_ITEM_SELECT that passes to a function I want to then invoke showStep again.

Here’s where I’m stuck. When I select the right menu item, it activates the contextMenuOwner hot spot that I can then click to advance the image. I want to advance the image by selecting the right menu item which calls the MouseEvent obj via showSteps.

Hopefully all of that made sense. Here are the snippets I think are appropriate.


Code:
//set hit areas
var newHitArea:Sprite;

//from customizingContextMenu
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var mainTimeline:MovieClip = this;
mainTimeline.contextMenu = myMenu;

//rc menu to be used with hit area
var newRCMenu:ContextMenu = new ContextMenu();
newRCMenu.hideBuiltInItems();

var createNode:ContextMenuItem = new ContextMenuItem("Create Node");
createNode.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doMenuEvent);

function doMenuEvent(evtObj:ContextMenuEvent):void{
var tgtObj:DisplayObject = evtObj.contextMenuOwner as DisplayObject;
var tgtMenuObj:ContextMenu = evtObj.currentTarget as ContextMenu;
tgtObj.addEventListener(MouseEvent.CLICK, showSteps);
tgtObj.dispatchEvent(new MouseEvent("CLICK"));
}

function showSteps(evtObj:MouseEvent):void{
stepImg.visible = true;
stepImg.load(new URLRequest("../images/"+imgArr[thisStep][0]));
stepImg.x = layerX;
stepImg.y = layerY;
addChild(stepImg);
makeHitArea(thisStep);
thisStep++;
}

function makeHitArea(currStep){
if (newHitArea){
removeChild(newHitArea);
}
newHitArea = new Sprite();
// ... make hit area
hitAreaType = imgArr[currStep][1];
if (hitAreaType == "rc"){
newHitArea.contextMenu = newRCMenu;
newRCMenu.addEventListener(ContextMenuEvent.MENU_SELECT, menuSelectHandler);
}else{
newHitArea.addEventListener(MouseEvent.CLICK, showSteps);
}
addChild(newHitArea);
}

// borrowed from Adobe examples: Custom Context Menus
function menuSelectHandler(evtObj:ContextMenuEvent):void {
var obj:DisplayObject = evtObj.contextMenuOwner as DisplayObject;
var menuObj:ContextMenu = evtObj.currentTarget as ContextMenu;
menuObj.customItems = [];
menuObj.customItems.push(createNode);
}

Invoke A Function In An External Swf
Okay, I know it has to be possible one way or another...I want to be able to invoke a function in an external file from the host file and vis-a-versa. Here is what I have...three files:

Main Movie
External A
External B

The Main Movie loads in External A. In External A I have a button. On click it tells Main Movie to load in External B. I also want it to tell Main Movie to call a function within External B. Is there anyway to make this happen or really, anything that might help me?

Thanks...

Invoke Function After OnResize
hi.
i'm writing a dynamic scrollbar class and have run into some problems regarding the Stage.onResize function.
resizing itself works very well, though i would like to call a function _after_ (!) the resizing is done, like a callback.

ive been reading, googling and asking round but i cant get it straight.
is it impossible? i mean, come on, there must be workarounds..

i would rather not use an interval or an onEnter here (cpu issues), eventhough i know it can be solved with this..


thanks,
fred

Frame Names And How To Invoke Them
What would you have to do to have something happen once a movieclip reaches a particular frame?

I already got the answer to that question in a previous topic in case that something has to happen when the movieclip ends, but say you want to have something happen when the playhead reaches frame called, say, _now?

I can think of a way (involving the clculation of the ratio between _currentframe and _totalframes) but, isn't there a simpler -and more precise- way, namely, invoking the frame by its name? How would that be done (if possible)?

NOTE: I am assuming that adding code to the movieclip's timeline (instead of adding it to the main timeline) is a bad practice and should be avoided. Am I right at that?

Can My SWF Invoke A Local .NET Assembly?
Hello,

How do I get my AS2 code to interact with _local_ resources without using XML files? Here's what I mean.

My SWF file needs to be able to query a local SQLite database. But after a lot of searching, I'm convinced that this is not possible with just Flash8/AS2 (I have heard about something called SQLite Connector. But it requires SWF Studio).

As an alternative to having my AS2 code interact with SQLite directly, is there a way for my AS2 code to invoke a function in a .NET assembly or COM object, so that my locally-registered .NET assembly does the work of getting the data out of my
database and somehow return the record into my calling AS2 code?

Can my SWF call a procedure to a local .NET assembly and if so, where can I find out the details?

Thanks,

~McM.

Can My SWF Invoke A Local .NET Assembly?
Hello,

How do I get my AS2 code to interact with _local_ resources without using XML files? Here's what I mean.

My SWF file needs to be able to query a local SQLite database. But after a lot of searching, I'm convinced that this is not possible with just Flash8/AS2 (I have heard about something called SQLite Connector. But it requires SWF Studio).

As an alternative to having my AS2 code interact with SQLite directly, is there a way for my AS2 code to invoke a function in a .NET assembly or COM object, so that my locally-registered .NET assembly does the work of getting the data out of my
database and somehow return the record into my calling AS2 code?

Can my SWF call a procedure to a local .NET assembly and if so, where can I find out the details?

Thanks,

~McM.

Function Invoke B4 OnPress
Code:
goto = function(where:String) {
getURL("http://esample.com/"+where+".htm","_self");
}

button1.onRelease = goto("home");
when the movie loads, flash immediately 'getURL' BEFORE i press my button1. how come the code execute even before i press it 1st? what's wrong with my code?

thx in advance.

Can Flash Invoke Javascript?
Can I implement Flash button so that when clicked, it triggers a Javascript function? That "Javascript" function that is on the HTML page in which the Flash swf is hosted.

How?

Function Invoke B4 OnPress
Code:
goto = function(where:String) {
getURL("http://esample.com/"+where+".htm","_self");
}

button1.onRelease = goto("home");
when the movie loads, flash immediately 'getURL' BEFORE i press my button1. how come the code execute even before i press it 1st? what's wrong with my code?

thx in advance.

Eval To Invoke A Function
Hello,

I have some functions named like sixtoone() sixtotwo() sixtothree() etc..

I am returning a value from those functions like this;


ActionScript Code:
this.cur = "six" // if this is onetosix() function for example
    return(this.cur)


so what I am doing next is to add this value to invoke the other function on a button action like this;


ActionScript Code:
planning.onRelease = function() {
    gimme = cur+"toone()"
    trace(gimme) // this gives me sixtoone() but it don't invoke the funtion.
   
};
 
so you have already guess, how should I use eval to get this function invoke..
 
thanks in advance.
 
ik

How Can I Invoke PHP Forum In The Sub-window Of A
flash
my flash website has a sub-window can load extrenal swf files ,but i also want to load a php forum in this window after i click the relevant button. how can i make it?

Invoke A Button's OnPress With Actionscript?
is it possible to invoke the on(press) code of a button through actionscript such that i can write a command like this elsewhere in the movie:

someMC.someButton.onPress();

I am trying to automate a set of movements and the code is already assigned to a button's onPress so I just want to be able to execute the specific button's onPress rather than take the code out of the buttons? Any ideas?

Thanks in advance,

--pkoanui

Invoke Server Side Application
Hi,

I am an experienced programmer (mainly C++ and Python) but fairly new to web/flash programming. I have a Flash application running on a client side browser which needs to read data from a C application running on the server. I'm told that there should be a library function to invoke the C code and provide me the output via a pipe of some sort. Can anybody elaborate on this?

Also, does anybody know of an online library reference (function descriptions, syntax examples, data structures summaries etc.) for Flash? I find it quite hard to program in a language without such a reference.

Peter

Can I Simply Invoke A Function Every Time A Var Changes?
Say I wanted to do something like this (not possible):
aNumber=99
aNumber.onChange=function(){
dNumber=aNumber
}

How would I do something like this?

Invoke Funtion Inside A Function
Hi,

How can I invoke a function (in the main timeline) from another function in a movieclip timeline?

I set that function as global, but he never goes to that function in the main timeline.

Thanks.

How To Invoke A Function On DynamicTextField Change
Hi all!

Im looking for a way to invoke a function automatically on TextField value change... something like this:


Code:
TextField.prototype.onChanged = function(){
trace("Changed!")
}
_root.createTextField("myTF", _root.getNextHighestDepth(), 10, 10, 100, 40);
myTF.type = "input";
myTF.text = "sdfsdf";
That script working great with Input TextField on keyboard press... i need the same thing but with Dynamic TextField - on TextField value change...

10x for advanced....

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