ActionScript 3.0 :: Communication Between Custom Function And OnComplete?
Feb 21, 2012
I created a function with input variables, so I don't have to repeat this function X amount of times. But within the function is a TweenLite call and that call has an onComplete. This onComplete somehow doesn't understand what the variables filled in in my function represent.
PHP Code:
function navMenuInput(check01:Boolean, check02:Boolean, movieClip01:MovieClip, movieClip02:MovieClip){ if(check01 == true && check02 == false){ if(movieClip02.stage){ TweenLite.to(movieClip02, 1, {alpha: 0, onComplete: navMenuInputComplete} ); }else{ navMenu.addChildAt(movieClip01, 0); movieClip01.x = navMenu.width-
[code]...
EDIT:I think I can make this a bit more clear when I explain what this is supposed to do:This menu can reach it's end via different routes. So the user can choose Path A or B, but what I'm trying to set up here is. If A is on stage, A should be removed first before B is placed and vice versa. And because this happens for about 4-5 times I wanted to shorten the code by using something like this.
View 4 Replies
Similar Posts:
Sep 7, 2010
I'm trying to embed one function in another and I'm having trouble doing so. I want the first animation(scaling the film) to happen before I run the interactive scene. I keep getting the error: "incorrect number or arguments, expected 1". So I think I need to put something in the brackets after onComplete, but I'm lost as to what that is.
function filmScale(e:Event):void{
if (film_mc.currentFrame == 20) {
TweenLite.to(film_mc, 1, {scaleX:1.1, scaleY:1.1});
[code].....
View 1 Replies
Mar 25, 2010
After I finish a tween, I would like to change my variables, then only my mouse movement would have start to run some functions, but it seems like the onComplete function fired immediately messing all the things out. Isnt't that onComplete function will only run after an action is done? Any other way to like after running the Tween.to line of code, only it will ran the 2nd line changing a variable?
stage.addEventListener(MouseEvent.MOUSE_MOVE, movevC);
public static function showSection(obj:DisplayObject):void {;
var sect2X=((obj.stage.stageWidth/2)+(obj.stage.stageWidth/4))+lg.width;
var sect2Y=((obj.stage.stageHeight/2)-(obj.stage.stageHeight/4))+lg.height;
switch (obj.name) {
[Code] .....
View 3 Replies
Aug 12, 2009
import caurina.transitions.Tweener;
class Scanner extends MovieClip
{
public var Scanner00_mc:MovieClip;
public var Scanner01_mc:MovieClip;
[Code].....
Makes sense as for the sequence, what doesn't make sense is why Tweener fail to loop back to the "fade" function ? They are suppose to be calling each other in an astable/blinking manner.
I suspect it's a scope problem but I don't know how to fix this, it seems AS2 Class doesn't know that there is a fade function within itself after the second Tweener call.
View 1 Replies
Apr 4, 2012
I am trying to combine TweenLite with some of my own functions. Now for testing I have this:
Code:
function playGeb(indG):Void {
if (indG < 8) {
clearInterval(restartG);
gebArr[indG].play();
[Code] .....
but after the arrow is in place the function hello() isn't been called.
I already tried adding, onCompleteScope:this
TweenLite.to(arrow_mc, 0.3 , {_x:118,_y:30,onComplete:hello , onCompleteScope:this});
View 1 Replies
Mar 23, 2011
I am trying to figure out how to call an onComplete function without leaving the code loop (because the vars are no longer recognized with the hand-off). I thought this might work:
[Code]...
View 7 Replies
Apr 1, 2008
I want to call a function from another function's parameter but I don't know how and don't know if it is possible.I've considered this as a solution but it didn't worked.
Code:
function myFunc(target_mc:MovieClip, nX:Number, nY:Number, cFunc:Function) {
target_mc._x += nX;
targen_mc._y += nY;
target_mc.onPress = cFunc;
[code]....
View 2 Replies
Sep 26, 2005
I am having trouble making 2 movies communicate with one another. One movie (series) is embedded into the other (content2). 'content2' is a horizontal scroll menu of images. 'series' is a movie that holds 'content2' and contains a mask which will reveal everything upon the rollover of the 'series' button. I can get the scroll to show and work when the button is rolled over but it fails to hide on roll out.
Here is the code I have used on the roll over button called 'series':
Code:
stop(); // stop the movie clip from playing (stop button from growing, we want that when the mouse rolls over only
sym2.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
[Code] .....
View 1 Replies
Feb 4, 2009
I have a javascript array and a function on my html page, and I need actionscript to be able to pick the right one from the array and run the function based on what button I pushed. My javascript is:
[Code]...
I'm a little lost on the AS part of it, what would be the best way to have the each different button run it's respective part in the JS array/function?
View 5 Replies
Aug 25, 2010
This is my code.
//width variable
var widthSize:Number;
var heightSize:Number
var TIMER_DELAY:Timer = new Timer(3000, 1); // 8 second delay
TIMER_DELAY.addEventListener(TimerEvent.TIMER, EXMove);
wedding_mc.alpha = 0
[Code]...
The way I have it with wedding(); does not work exactly like I wanted. So, how do I use onComplete to execute wedding() function after the EXMove is done? Second, my wedding_mc's width and height are linked, so, why can't I just tween only Width or Height instead of both?
View 28 Replies
Feb 13, 2012
I'm trying to use URLRequestMethod.GET to get some xml from our website.In ie7 the onComplete never fires so it gets stuck but it works great in every other browser. I know that to fix a similar problem with preloaders you change the onComplete to a ProgressEvent and check to see if bytesLoaded == bytesTotal.This doesn't seem to work for URLRequestMethod.GET because when bytesLoaded = bytesTotal it doesn't mean that you have your data. Is there another way to check to see when the data is finished?
View 7 Replies
Mar 3, 2011
if I assign an onComplete function in a TweenLite.to() call.. I can't seem to figure out how to remove the onComplete function of that tween incase I don't want it to be called for some reason..
example..
ActionScript Code:
TweenLite.to(current_slide,1,{x:0,onComplete:hideOld});
ok so i have a prev and next buttons .. and want to have it so that i can cycle through my slides (right now they overlap each other).. well with each it assigns the onComplete for that current_slide..
what i want to do is make it so that if there is a new tween for a new slide that the old current_slide doesn't call the onComplete..
so i store the old current_slide as previous_slide and then I tried to cancel the onComplete like you do other properties with killTweensOf()
this doesn't work it still gets fired..
ActionScript Code:
TweenLite.killTweensOf(previous_slide,false,{onComplete:true});
i think its cause this is only supposed to remove tweenable properties and not callback functions.. but there doesn't seem to be able to prematurely remove a onComplete function.
View 2 Replies
Nov 11, 2009
I'm trying to get onComplete (frame 5 in this case) to skip to a given frame after a series of animations. Here is what i have written so far. Shouldn't this work?
stop();
import gs.TweenMax;
import gs.plugins.*;
[code].....
View 2 Replies
Jan 10, 2012
I have an onEnterFrame function, and when the clip goes passed a certain x value, it tweens alpha to 0, and then on complete, it removes its listener and is removed from the stage ... here's the loop :::
Code:
function loop(e:Event):void
{
[code].....
View 1 Replies
Aug 6, 2009
I am trying to add an onComplete with staticRate to the (gskinners) GTween in an attempt to Optimization the SWF Framerate similar to what Lee Brimelow has done in the following project [URL] . My action script is below.
public function staticRate():void{stage.frameRate=5;}
public function animationRate():void {stage.frameRate=30;}
private function onClick(e:MouseEvent):void {trace("BUTTON: SINGLE
[Code].....
View 3 Replies
Aug 11, 2011
I'm having a problem with onComplete at the end of the array. It gives me the following error:
1084: Syntax error: expecting rightparen before colon.
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.easing.CustomEase;
CustomEase.create("myCustomEase", [{s:0,cp:1.14999,e:1.4},{s:1.4,cp:1.65,e:1}]);
var timeline:TimelineLite = new TimelineLite();
[Code] .....
View 1 Replies
Mar 21, 2011
for occasional tweens, such as those triggered/added by a button, is it a best-practice to remove the tween - Tweener.removeTweens(myObject); - or does Tweener automatically do this when the tween finishes? i understand tweens automatically overwrite themselves, so perhaps it's not useful (not encouraged) to remove occasional tweens, but what about infrequent tweens? if Tweener doesn't automatically remove tweens when its finished with them, wouldn't the objects that Tweener is referencing not be able to be garbage collected if removed?
View 1 Replies
Oct 31, 2011
I'm trying to trace a simple tween using Tweener, but the onComplete doesn't seem to work. Am I doing something wrong?
import caurina.transitions.*;
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
function enterFrameHandler(event:Event):void {[code].....
View 1 Replies
Feb 2, 2009
i am uploading a file using AS FileReference + php. Well i have my php checking the folder it is uploading the file to, to see if that file name exists. If it does it renames the file before writing it.
Is there a way to retrieve a the new file name from the php. i could find certain examples of retrieving the vars with sendAndLoad(), but not with the FileReference. Is this possible?
how to get the php to echo i just need to know how to get flash to get the echoed data.
View 1 Replies
Jul 9, 2009
Wondering if anyone has an incite on this. I have a basic Shell class that I'm using to load in all of my assets including two xml files and one css file. Currently I'm using a single URLLoader to load in the three external files. Through testing (Using FDT Pure in Eclipse 3.3.3, publishing using 'FDT AS3 Application') I'm running into an interesting issue.Basically the first file that I try and load, regardless which xml file or css file, my onComplete doesn't seem to be getting called. But everything runs gravy if I insert this line before beginning my loading:
ActionScript Code:
this._urlLoader.load(new URLRequest(""));
Here's some more of the code:
[code].....
View 1 Replies
Aug 6, 2009
I am trying to add an onComplete with staticRate to the (gskinners) GTween in an attempt to Optimization the SWF Framerate similar to what Lee Brimelow has done in the following project (url...) . [code]....
View 0 Replies
Jan 11, 2008
This is my first post and my first day even touching actionscript beyond the typical behaviors such as buttons or loading an external movie. I trying to learn tween via AS. Fuse first and then Tweener. I'm not sure which is easier to learn, but neither have a 'dummies' book and constructors, events, objects and hoot-nanny just confuse me.
I have a series of tweens using Fuse and at the end I want it to go to frame three, but not before. See below:
[Code]...
View 1 Replies
Dec 4, 2008
I have event listeners for when an image is loading and for when loading is complete.
Both of them fire--I've used traces to confirm that.
But I can't get the text field that says "Loading..." to disappear once the image has loaded. I've tried making the text field invisible, making the text equal nothing, and removing it as a child. Nothing is working. Maybe I am not manipulating the text field properly?
View 5 Replies
Sep 3, 2010
flash is not my area of expertise, but I've inherited a task that deals with AS2 Basically, I have a flash document (a loader?) with the following AS 2.0 code:
[Code]...
Basically, the idea is after the movie finishes playing, you should get redirected to a new page. The problem is that sometimes the page redirects immediately (before the movie is played). The movies are being served up from a media server and this seems to happen more consistently with newly uploaded movies. Sometimes it takes several attempts to actually play the movie all the way through, but over time, the movies generally start to play problem-free.
View 1 Replies
Jun 19, 2009
I am building a flash site in AS3 using AMFPHP. I could really use some help in the Event department...The structure of the site is as follows:
Documentclass,
adds PageConveyer (which holds all Pages)
- adds addEventListener( Event.COMPLETE, onPageConveyerComplete ), onPageConveyerComplete:
- startAnimation (loop through pages and components in arrays to animate into screen)[code].....
The problem lies in the Event listeners.I want to make sure everything (pages/components) is loaded before I start animating. My guess was that Flash listens to the underlying objects until they are done running, then fires the Event.COMPLETE event to the parent object, which in turn fires it's own COMPLETE event. These events never seem to get fired (since i traced the onComplete functions). Im lost here. How can I best listen to this many objects within objects, to know for sure whether they are finished and ready to be animated in?
View 2 Replies
Sep 2, 2009
i have a set of "if conditionals" that should always be together,what i want to do is to put these conditionals in a function... then call the function once needed. i want to call this function once the flash starts playing + when i click on any of the 3 buttons.
here is the code so far:
ActionScript Code:
var btn1:Boolean=true;
var btn2:Boolean;
var btn3:Boolean;
[code]....
the problem is button1 should have no eventlistener once the movie starts playing, but it has all listeners... so how can i make AS reads BtnStatus function once it starts loading
View 2 Replies
Aug 4, 2006
i have a flash 8 movie that upload jpegs to a server side script. When hosted on an NT server, with a php script that recieves the upload, the FileReference onComplete event gets called correctly when the an image has completely uploaded using FileReference.upload. This when movie is viewed in Flash Player 8, in IE and Firefox on Windows XP and on OSX.
When the same swf is uploaded to an Apache Tomcat/5.5.12 server, with a jsp script to recieve the upload, then the problems start. The upload works ok on both PC and OSX, except that the onComplete event of the
FileReference object is never called on OSX. It is essential to trap the onComplete event for the site to continue with its functionality. (If the file takes long enough to upload (more than a few fractions of a second) the the onProgress event is called while its uploading on PC and OSX.)
View 3 Replies
Jul 11, 2011
I am a complete beginner in Flash & Actionscript. My pet project is this: To provide a [URL] like service where people could upload single images and later anyone can view it using the generated url. So far I have gotten to upload an image using Flash and store it in a directory.
[Code]....
View 2 Replies
Sep 19, 2011
Im using caurnia transitions, and I am adding an onComplete handler to fire up a onEnterFrame Event.
I just cant seem to pass the object through to the ENTER FRAME function so I can do something with it ..
Code:
Tweener.addTween(myObj, {x:10, time:1,onComplete:function() {this.addEventListener(Event.ENTER_FRAME, timer);} });}
function timer(e:Event):void
{
e.x += 1;
}
View 3 Replies
Jul 29, 2009
The fact is that the "dispatchEvent" method must be placed into the code or timeline where the "event" happens, then it can be trigged and the function associated with the event will be invoked. Ok, it is understood. Nevertheless, my question is: what's the point to create an event to trigger the a function call, if I can simply call the function instead directly???
Code:
package{
import flash.events.Event;
public class CustomEvent extends Event{
public static const ONSOMETHING:String = "onSomething";
public function CustomEvent(type:String){
super(type);
[Code] .....
If I can do simply:
Code:
DoIt();
function DoIt(){
trace ("Done!");
}
What I mean is that custom events doesn't look like as REAL events for me, but more like a delegate way to call a function. Differently from Flash native events that are controlled by an internal engine that keep checking if the event happened, in the custom events they must triggered 'manually', and it seems to lose the event main characteristic.
View 6 Replies