actionscript 3 - Flash 1071 Error, expected a definition keyword -
trying working in flash as3, air 3.2 ios, using greensock. i've tried defining variable, function, etc, no avail. search online comes nothing.
the next errors come line of code tweenmax tween = tweenmax.to(textone, 14, {x:xscreenposend, ease:slowmo.ease.config(1, 0), repeat:-1});
:
1071: syntax error: expected definition keyword (such function) after attribute tweenmax, not tween. 1084: syntax error: expecting rightbrace before leftbrace. 1084: syntax error: expecting identifier before rightparen.
var middle:boolean = false; public function run():void { tweenmax tween = tweenmax.to(textone, 14, {x:xscreenposend, ease:slowmo.ease.config(1, 0), repeat:-1}); tween.addeventlistener(tweenevent.update, updatelistener); tween.addeventlistener(tweenevent.repeat, repeatlistener); } function updatelistener(e:tweenevent):void { if(tween.currentprogress > 0.5 && middle == false) { tweenmax.to(textone, 7, {ease:slowmo.ease.config(1, 0), repeat:-1, autoalpha:0}); middle = true; } } function repeatlistener(e:tweenevent):void { textone.alpha = 1.0; middle = false; }
edit: line in error has been replaced var tween:tweenmax = tweenmax.to(textone, 14, {x:xscreenposend, ease:slowmo.ease.config(1, 0), repeat:-1});
farther errors come are: 1120: access of undefined property tweenmax. 1046: type not found or not compile-time constant: tweenmax. 1120: access of undefined property tween. 1120: access of undefined property middle.
my imports of greensock follows:
import com.greensock.easing.*; import com.greensock.plugins.*; import com.greensock.events.tweenevent;
even tried import com.greensock.*;
edit: adding line import com.greensock.tweenmax;
has removed errors: 1120: access of undefined property tweenmax. 1046: type not found or not compile-time constant: tweenmax.
the other 2 errors still stands.
@vesper absolutely right.
var tween:tweenmax = tweenmax.to(...)
as3 uses name:type notation. farther errors, may come incorrectly referrencing greensock code, step in right direction. please post them in edit.
ok let's see :
private var _middle:boolean = false; private var _tween:tweenmax; public function run():void { _tween = tweenmax.to(textone, 14, {x:xscreenposend, ease:slowmo.ease.config(1, 0), repeat:-1}); _tween.addeventlistener(tweenevent.update, updatelistener); _tween.addeventlistener(tweenevent.repeat, repeatlistener); } private function updatelistener(e:tweenevent):void { if(_tween.totalprogress() > 0.5 && _middle == false) { tweenmax.to(textone, 7, {ease:slowmo.ease.config(1, 0), repeat:-1, autoalpha:0}); _middle = true; } } private function repeatlistener(e:tweenevent):void { textone.alpha = 1.0; _middle = false; }
i'm not sure functionnality, code shouldn't throw errors, provided textone
exists.
actionscript-3 air compilation flash-cs6 greensock
No comments:
Post a Comment