ActionScript 3.0 :: OnComplete On End Of Array Giving Errors
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
Similar Posts:
Oct 20, 2010
I am busy with a big project, for a brief outline, its an induction program kind of like a media rich slideshow done in flash (AS3). It consists of 10 chapters / modules, each module is a SWF with its own class file. Each module loads external and embedded videos and also mp3 sound voice overs at run time.
Each module loads and works fine by itself, but now the problem comes in where I am trying to create a main container swf to load and unload each of the other 10 module swfs, sequentially (ie first load module 1 swf, then when module 1 swf is finished, unload it and load module 2 swf etc)
I have researched for days and realize that when loading external swfs that have their own class files, problems arise because the external swf makes references to stage but it does not have access to the stage yet and I need to use something like this.addEventListener(Event.ADDED_TO_STAGE, whateverFunction) in the constructor of the external file, and "... the loaded content must be on the Display List BEFORE any code in it referencing 'stage' is executed. " as quoted from Barbara Kaskosz's experiment on flashandmath.com. (I cant post links as I am under the 50 post restriction).
After trying for days with this and other guides I found, I still have not been able to successfully apply it to my projects files. If anyone would be willing to take the time for me to send them some sample files maybe my container FLA and two of the smallest modules and have a look at what I've done
My deadline is approaching fast and failing this deployment phase of combining all the swfs into one executable is like tripping at the finish line.
I am posting a link to my simplified and cut down files (for testing purposes) in hopes that someone may assist me. I also want an event to fire on the last frame of each of the modules, and for the main.swf to listen for it so it can unload the current module and load the next module.
dispatchEvent(new Event("loadNextModule", true));
//I think this should go on the last frame of the last slide of each module,
//then in main.as add a listener
addEventListener("loadNextModule", nextModule);
But would this listen for the event firing in an external swf?
I have deleted a lot of content in the modules to help with testing purposes, and simplified and made them only 3 slides each.
TL;DR : I have a container swf with a single movieclip that will contain external swfs that will load one at a time. Each swf works fine by itself, but I get errors when compiling the container swf because (I assume via research) the container swf AND EACH external swf has its OWN class file. In summary, I need the main swf to start by loading module1.swf, then when the user reaches the last slide of module 1, main.swf needs to unload module1.swf completely and then load module2.swf. You can traverse slides by pressing the 'right' and 'left' keys on the keyboard.
This is the error I am getting when compiling main.fla :
TypeError: Error #2007: Parameter child must be non-null.
at flash.display: DisplayObjectContainer/addChild()
at main/loadFirstModule()
at main()
I am attaching what code files I can given the restrictions, if you still require the two external .fla files
View 0 Replies
Oct 19, 2010
i am still on the same big project, if anyone read the post - but for a brief outline, its an induction program kind of like a media rich slideshow done in flash (AS3). It consists of 10 chapters / modules, each module is a SWF with its own class file. Each module loads external and embedded videos and also mp3 sound voice overs at run time.
Each module loads and works fine by itself, but now the problem comes in where I am trying to create a main container swf to load and unload each of the other 10 module swfs, sequentially (ie first load module 1 swf, then when module 1 swf is finished, unload it and load module 2 swf etc)
I have researched for days and realize that when loading external swfs that have their own class files, problems arise because the external swf makes references to stage but it does not have access to the stage yet and I need to use something like this.addEventListener(Event.ADDED_TO_STAGE, whateverFunction) in the constructor of the external file, and "... the loaded content must be on the Display List BEFORE any code in it referencing 'stage' is executed. " as quoted from Barbara Kaskosz's experiment on [URL]..
After trying for days with this and other guides I found, I still have not been able to successfully apply it to my projects files. If anyone would be willing to take the time for me to send them some sample files maybe my container FLA and two of the smallest modules and have a look.
TL;DR : I have a container swf with a single movieclip that will contain external swfs that will load one at a time. Each swf works fine by itself, but I get errors when compiling the container swf because (I assume via research) the container swf AND EACH external swf has its OWN class file.
View 1 Replies
Jun 14, 2009
If n=1,b1.gotoAndStop(2); is to happen.n=2,b2.gotoAndStop(2); is to happen.But i don't want to put conditions like this.I want to putting something like this:b[n].gotoAndStop(2); or something.Is it possible.Is there any other alternate logic.
View 2 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
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
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
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
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
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
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
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
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
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
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
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
Sep 25, 2009
I am using the FileReference class in ActionScript 2.0.Is there a way that I can receive a response in a XML format from PHP into the onComplete method of the FileReference listener?Basically, what I want to do is upload a file and when the upload is complete, I want to receive an XML format response.
View 1 Replies
Nov 5, 2010
Does a Flash CMS site give you the best of both worlds? I want asite but I need it to be searchable. Does a Flash CMS site rank well enough to do the job? If it does not rank well, is it because the Flash portions would get no SEO but the HTML portions would?OR is it something inherently missing in the software that will keep it low on the rankings, no matter what the ratio of Flash versus HTML there is on that site? Would an HTML site with Flash plugins hurt my rankings much? Could I solve my problem best by having an HTML based landing page that gives access to 2 sites, one strictly HTML and one either Flash or Flash CMS based? Assuming the landing page and HTML portions are optimized properly, is the content that is on the HTML landing page and HTML site going to give me good SEO results, even though one of the options to choose is a Flash site?
View 3 Replies
Feb 27, 2009
PHP Code:
stage.addEventListener (Event.ENTER_FRAME, lala);
function lala (event:Event) {
var object = new object_mc;
[code]...
How do I correctly declare a variable for each duplicate? The final line doesn't work in AS3 but it does in AS2. I want the same variable for each duplicate that I can individually change. Also how do I make a function for each duplicate? In AS2 I can do it by:
PHP Code:
object = duplicateMovieClip(........);
object.onEnterFrame = function () {
.........
}
View 7 Replies