ilanb
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by ilanb
-
-
Hi,
I try to export and import transform information for a textfield "myTxtBan" in a movieClip "mc"
I have a little class here:
I can export transform in xml, no problem work like a charm
When I try to reimport nothing happen, textfield is always at same position, it's strange because if I use the property "tx" and "ty" directly to myTxtBan, it's work !
Any idea ?
Thx all
myTxtBan.x = main.instance.bannerData.listSlides.getSlideById(_id).tx; myTxtBan.y = main.instance.bannerData.listSlides.getSlideById(_id).ty;
the xml (import and export):
<?xml version="1.0" encoding="utf-8"?> <slides> <type idType="4" idSize="1"/> <slide id="0"> <img1 posX="4.5" posY="4.5">files/imgs/OBESITE_2_250X250/etiquette.png</img1> <img2 posX="4.5" posY="4.5">files/imgs/OBESITE_2_250X250/chat.png</img2> <txt posX="35" posY="68.5"><![CDATA[<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#CCCCCC" LETTERSPACING="0" KERNING="0">Your animal<FONT COLOR="#333333"></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">seems to be</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">overweight ?</FONT></P></TEXTFORMAT>]]></txt> <item name="myTxtBan" level="9" a="1" b="0" c="0" d="1" tx="37" ty="70.5" xOffset="-2" yOffset="-2" rawWidth="143" rawHeight="74" scaleMode="scaleWidthAndHeight" hasSelectableText="1" minScaleX="-Infinity" maxScaleX="Infinity" minScaleY="-Infinity" maxScaleY="Infinity" lockScale="0" lockPosition="0" lockRotation="1" constrainScale="0" minWidth="1" maxWidth="Infinity" minHeight="1" maxHeight="Infinity"/> </slide> <slide id="1"> <img1 posX="4.5" posY="4.5">files/imgs/OBESITE_2_250X250/etiquette.png</img1> <img2 posX="4.5" posY="4.5">files/imgs/OBESITE_2_250X250/chat-ombre.png</img2> <txt posX="72" posY="82.5"><![CDATA[<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#CCCCCC" LETTERSPACING="0" KERNING="0">Excess weight<FONT COLOR="#333333"></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">is not inevitable</FONT></P></TEXTFORMAT>]]></txt> <item name="myTxtBan" level="9" a="1" b="0" c="0" d="1" tx="74" ty="84.5" xOffset="-2" yOffset="-2" rawWidth="142" rawHeight="50" scaleMode="scaleWidthAndHeight" hasSelectableText="1" minScaleX="-Infinity" maxScaleX="Infinity" minScaleY="-Infinity" maxScaleY="Infinity" lockScale="0" lockPosition="0" lockRotation="1" constrainScale="0" minWidth="1" maxWidth="Infinity" minHeight="1" maxHeight="Infinity"/> </slide> <slide id="2"> <img1 posX="4.5" posY="4.5">files/imgs/OBESITE_2_250X250/etiquette.png</img1> <img2 posX="4.5" posY="4.5">files/imgs/OBESITE_2_250X250/chat-logoRC.png</img2> <txt posX="72.8" posY="78.5"><![CDATA[<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#EEEEEE" LETTERSPACING="0" KERNING="0">MAINTAIN THEIR</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#EEEEEE" LETTERSPACING="0" KERNING="0">GOOD WEIGHT<FONT COLOR="#333333"></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#CCCCCC" LETTERSPACING="0" KERNING="0">ENSURE THEIR</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="20" COLOR="#CCCCCC" LETTERSPACING="0" KERNING="0">GOOD HEALTH</FONT></P></TEXTFORMAT>]]></txt> <item name="myTxtBan" level="9" a="1" b="0" c="0" d="1" tx="74.8" ty="80.5" xOffset="-2" yOffset="-2" rawWidth="177" rawHeight="98" scaleMode="scaleWidthAndHeight" hasSelectableText="1" minScaleX="-Infinity" maxScaleX="Infinity" minScaleY="-Infinity" maxScaleY="Infinity" lockScale="0" lockPosition="0" lockRotation="1" constrainScale="0" minWidth="1" maxWidth="Infinity" minHeight="1" maxHeight="Infinity"/> </slide> </slides>
my class:
package tools { import com.greensock.events.TransformEvent; import com.greensock.transform.*; import data.DevData; import flash.display.MovieClip; import flash.geom.*; import flash.text.TextFieldAutoSize; import tools.CustomEvent; import tools.Dispatcher; public class TrsfManager { private var _manager:TransformManager; private var mc:MovieClip; private var boundsRec:Rectangle; private var ti:TransformItem; private var _id:int; public var dataTrsfmanagerXmlExport:XML; public var dataTrsfmanagerXmlImport:XML; //----------------------------------------------------------------------------------- // // CONSTRUCTOR // //----------------------------------------------------------------------------------- public function TrsfManager() { //... } //----------------------------------------------------------------------------------- // // INIT // //----------------------------------------------------------------------------------- public function init(_mc:MovieClip, id:int):void { mc = _mc; _id = id; Dispatcher.addEventListener(DevData.TXT_CHANGE, reziseManager); _manager = new TransformManager({targetObjects:[]}); _manager.addEventListener(TransformEvent.CLICK_OFF, deselectAllItem); _manager.lockRotation = true; _manager.arrowKeysMove = true; _manager.forceSelectionToFront = true; _manager.autoDeselect = false; // On adapte le bounds en fonction de la bannière switch(main.instance.bannerData.listSlides.getSlideTypeAndSize().idSize) { case 1:{setManager(0, 10, 250, 250);break;} case 2:{setManager(0, 10, 300, 250);break;} case 3:{setManager(150, 10, 400, 80);break;} default:{break;} } mc.myTxtBan.autoSize = TextFieldAutoSize.LEFT; } private function setManager(xPos:int, yPos:int, recWidth:int, recHeight):void { boundsRec = new Rectangle(xPos, yPos, recWidth, recHeight); _manager.bounds = boundsRec; ti = _manager.addItem( mc.myTxtBan ); ti.manualBoundsOffset = new Rectangle(0, 0, 0, 0); _manager.selectItem(mc.myTxtBan, false); // On applique les transformations au champ txt appliXmlTrsfManager(); } private function deselectAllItem(evt:TransformEvent):void { _manager.updateSelection(true); } private function reziseManager(event:CustomEvent):void { var sizeW:int = event.params._width; var sizeH:int = event.params._height; mc.myTxtBan.autoSize = TextFieldAutoSize.LEFT; _manager.updateSelection(true); } public function exportXmlTrsfManager():XML { dataTrsfmanagerXmlExport = _manager.exportItemXML(mc.myTxtBan); return dataTrsfmanagerXmlExport; } private function appliXmlTrsfManager():void { var thisItemXML:XML = new XML(main.instance.bannerData.listSlides.getSlideById(_id).item); _manager.applyItemXML(thisItemXML); } } }
-
Hey Carl ! thanks for tips !
this work fine for me, I don't know how to quantify benefits but work fine thanks again !
for (var i:int = 0; i < flipListArray.length; i++) { element = flipListArray[i] as CardFlip; element.flipToFront(); if( i % 2 == 0) TweenLite.to(element, .5, {alpha:0, x:-1000, y:String( Math.random()* 1000 ), delay:Math.random() * 1, z:Math.random()*3000 , ease:Quad.easeInOut}); else TweenLite.to(element, 1, {alpha:0, x:-1000, y:String( Math.random()* -1000 ), delay:Math.random() * 1, z:Math.random()*3000 , ease:Quad.easeInOut}); }
-
Hi,
Anybody can help me to optimizing this :
TweenMax.to(elementsFlip[0], 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.2}); TweenMax.to(elementsFlip[1] , 1, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.5}); TweenMax.to(elementsFlip[2], 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.2}); TweenMax.to(elementsFlip[3] , 1, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.5}); TweenMax.to(elementsFlip[4] , 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.7}); TweenMax.to(elementsFlip[5] , 1, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.4}); TweenMax.to(elementsFlip[6] , 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.3}); TweenMax.to(elementsFlip[7] , 1, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.1}); TweenMax.to(elementsFlip[8] , 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.5}); TweenMax.to(elementsFlip[9], 0.5, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.9}); TweenMax.to(elementsFlip[10] , 1, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:1}); TweenMax.to(elementsFlip[11] , 0.5, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.7}); TweenMax.to(elementsFlip[12], 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.4}); TweenMax.to(elementsFlip[13], 1, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.3}); TweenMax.to(elementsFlip[14], 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.5}); TweenMax.to(elementsFlip[15] , 1, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.1}); TweenMax.to(elementsFlip[16] , 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.2}); TweenMax.to(elementsFlip[17] , 1, {alpha:0, x:-1000, y:Math.random()*1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.5}); TweenMax.to(elementsFlip[18] , 0.5, {alpha:0, x:-1000, y:Math.random()*-1000, z:Math.random()*3000 , ease:Quad.easeInOut, delay:.5});
Thanks
-
Thx Carl ! very useful example !
try this and adapt for my need !
-
Hi Carl,
i am having difficulty understanding what you need in addition to what that swf is doing.I would like to have color change for one movieClip when rotation of this movieClip is finished, actually color are change when rotation of all movieClip is ended (see onComplete function in code)
Sorry for poor english...
thx
num = int(e.target.name.split("img_")[1]); var timeline:TimelineMax = new TimelineMax({onComplete:function() { var tmp:MovieClip; for (var i:int = 1; i <= 10; i++) { tmp = getChildByName("img_" + i) as MovieClip; tmp.gotoAndStop(num); } }}); var clicked_img:MovieClip; var listArray:Array = new Array(); listArray.push(img_1, img_2, img_3, img_4, img_5, img_6, img_7, img_8, img_9, img_10); for (var i:int = 1; i <= 10; i++) { clicked_img = getChildByName("img_" + i) as MovieClip; timeline.insertMultiple( TweenMax.allFrom(listArray, .5, {rotationY:clicked_img.rotationY - 180, ease:Cubic.easeOut}, .06), .5); }
-
Hi Carl,
Thanks for reply, I have tested your solution, but don't make what I need, you can look my attached file to see what i would like. All movieClip turnaround and all movieClip colors changes when tween is finished.
But I need change color when a rotation movieClip is finished. Sorry for my poor english
File is more explicit
Ilan
-
Hello,
I have ten movieClip on stage (img_1, img_2...) each have 10 key (different color).
I try to change color for each movieClip when rotation of movieClip is ended
here is my test: actually color of movieClip change when timeline is completed not when rotation of movieClip is ended.
function onClickItem(e:MouseEvent):void { num = int(e.target.name.split("img_")[1]); var timeline:TimelineMax = new TimelineMax({onComplete:function() { var tmp:MovieClip; for (var i:int = 1; i <= 10; i++) { tmp = getChildByName("img_" + i) as MovieClip; tmp.gotoAndStop(num); } }}); var clicked_img:MovieClip; for (var i:int = 1; i <= 10; i++) { clicked_img = getChildByName("img_" + i) as MovieClip; var listArray:Array = new Array(); listArray.push(img_1, img_2, img_3, img_4, img_5, img_6, img_7, img_8, img_9, img_10); timeline.insertMultiple( TweenMax.allFrom(listArray, .5, {transformAroundCenter:{rotationY:clicked_img.rotationY - 180}, ease:Cubic.easeOut}, .06), .5); } }
Thx for point me to the right direction !
-
Hi,
I have a error when I addChild content of loader:
trace ("c") don't show, and error is:
route_2_menu_1.flv
a
b
TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.
at view::Route2MenuView/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.greensock.loading.core::LoaderCore/_completeHandler()
at com.greensock.loading::LoaderMax/_loadNext()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.greensock.loading.core::LoaderCore/_completeHandler()
at com.greensock.loading::VideoLoader/_loadingProgressCheck()
Problem are "videoItem.content;" but I don't know why.
private var videoItem:VideoLoader; private var queue:LoaderMax; private var vidcontent:ContentDisplay; private function initVideo():void { LoaderMax.activate([VideoLoader]); queue = LoaderMax.parse(["files/flv/route_2_menu_1.flv","files/flv/route_2_menu_2.flv","files/flv/route_2_menu_3.flv","files/flv/route_2_menu_4.flv","files/flv/route_2_menu_5.flv","files/flv/route_2_menu_6.flv","files/flv/route_2_menu_7.flv","files/flv/route_2_menu_8.flv"], null, {autoPlay:false}); queue.addEventListener(LoaderEvent.COMPLETE, completeHandler); queue.load(); btnIdontknow.visible = btnImNot.visible = btnIam.visible = title.visible = false; currentRouteId = Main.instance.playerData.currentRouteId; currentItemId = Main.instance.playerData.getRouteById(currentRouteId).currentItemId; flv = Main.instance.gameData.listRoute.getRouteById(currentRouteId).getItemById(currentItemId).flv; } private function completeHandler(event:LoaderEvent):void { trace(Main.instance.gameData.listRoute.getRouteById(currentRouteId).getItemById(currentItemId).flv); trace("a"); videoItem = LoaderMax.getLoader(Main.instance.gameData.listRoute.getRouteById(currentRouteId).getItemById(currentItemId).flv); trace("b"); vidcontent = videoItem.content; vidcontent.x = DevData.FLV_POSITION_X + Main.instance.mainStage.x; vidcontent.y = DevData.FLV_POSITION_Y + Main.instance.mainStage.y; addChild(vidcontent); trace("c"); btnIdontknow.init(3); btnImNot.init(2); btnIam.init(1); setChildIndex(btnIdontknow, numChildren - 1); setChildIndex(btnImNot, numChildren - 1); setChildIndex(btnIam, numChildren - 1); initTitle(); openSubtitle(); videoItem.playVideo(); btnIdontknow.visible = btnImNot.visible = btnIam.visible = title.visible = true; removeChild(loop); }
Thanks for help !
-
Ok sorry, I make a zip today.
For MonsterDebugger, yes I have tried with removing trace and it's same.
-
-
Hello Jack,
I use the last SVN version 1.772 of loadermax
Problem are methodes : onChildFail:_onChildFail, onChildCancel:_onChildCancel or skipFailed:true don't work and I don't no why
thanks
-
Hi Jack,
I try to load some video but the loader stop somtimes and all video are not loaded.
The video are encoded with CS5, flv onVP6...
It's very strange because sometimes all vidéos are loaded...
I try to trace error but nothing, here is code:
LoaderMax.activate([VideoLoader]); queue = LoaderMax.parse(arrayPath, {name:"mainQueue", onProgress:_progressHandler, onChildComplete:_childCompleteHandler, onChildFail:_onChildFail, onChildCancel:_onChildCancel, onComplete:_queueCompleteHandler, onError:errorHandler}, {autoPlay:false}) as LoaderMax; queue.prependURLs(BEGINING_VIDEO_PATH, false); queue.load();
functions:
private function _queueCompleteHandler(event:LoaderEvent):void { MonsterDebugger.trace(this, "Download end!"); } private function onClickPopupDownloadClose(_event:CustomEvent):void { _videos = queue.getChildren(); Dispatcher.dispatchEvent(new CustomEvent(GenericEvents.VIDEO_LOADER_COMPLETED)); } private function _childCompleteHandler(event:LoaderEvent):void { MonsterDebugger.trace(this, "child loaded: " + event.target + " inside queue: " + event.currentTarget); } private function _onChildFail(event:LoaderEvent):void { MonsterDebugger.trace(this, "child error: " + event.target); } private function _onChildCancel(event:LoaderEvent):void { MonsterDebugger.trace(this, "child cancel: " + event.currentTarget); } private function errorHandler(event:LoaderEvent):void { MonsterDebugger.trace(this, "error" + event.target); }
a screenshot :
http://screencast.com/t/xR8w858J2V
thanks for help
-
Thanks Jack,
It's much clearer now !!
I have created a generic videoloader class and use
_genericVideosLoader.playVideoByIndex(cpt);
to play video and
public function videoEnd():void { return _currentVideo.unload(); }
to unload
Work like a charm
I have found good tuts to help me a lot : http://active.tutsplus.com/tutorials/actionscript/smart-as3-video-loading-with-greensock-loadermax-free-active-premium/
-
Hi,
When the first two video are completed I try to delete before playing 2 other videos but if I use dipose, unload... (VIDEO_COMPLETE) I have an 1009 error
If I try to use removeChild methode it's same.
public function loadContentCritical():void { //activate the loaders LoaderMax.activate([VideoLoader]); var urls:Array = ["3_DialS1_P1.flv", "3_DialS1_V1.flv", "3_DialS1_P2.flv", "3_DialS1_V2.flv", "3_DialS1_P3.flv", "3_DialS1_V3.flv", "3_DialS1_P4.flv", "3_DialS1_V4.flv", "3_DialS1_P5.flv", "3_DialS1_V5.flv", "3_DialS1_P6.flv", "3_DialS1_V6.flv", "3_DialS1_P7.flv", "3_DialS1_V7.flv", "Left.flv", "Right.flv", "Sad.flv", "Wait1.flv", "Wait2.flv", "Wait3.flv", "Wait4.flv", "WaitV1.flv"]; queue = LoaderMax.parse(urls, {maxConnections:3, onProgress:_progressHandler, onComplete:_queueCompleteHandler, onChildComplete:_childCompleteHandler}, {autoPlay:false}); queue.prependURLs("files/assets/flv/critical/"); queue.load(); } private function _queueCompleteHandler(event:LoaderEvent):void { var loaders:Array = queue.getChildren(); var videos:VideoLoader = loaders[1]; addChild(videos.content); videos.playVideo(); videos = loaders[17]; //reuse the videoP variable addChild(videos.content); videos.playVideo(); videos.addEventListener(VideoLoader.VIDEO_COMPLETE, onVideoComplete, false, 0, true); } private function onVideoComplete(_event:Event):void { //videos.unload(); videos.dispose(true); var loaders:Array = queue.getChildren(); var videos:VideoLoader = loaders[0]; addChild(videos.content); videos.playVideo(); videos = loaders[21]; addChild(videos.content); videos.playVideo(); }
How I can remove videos and play next ?
Thanks
-
Thanks for the tips,
Another great tools the LoaderMax...
Greensock Rocks !!
-
Thanks Jack, very useFull !!!
just trying to play with array:
var loaders:Array = queue.getChildren(); var videoP:VideoLoader = loaders[2,3]; addChild(videoP.content); videoP.content.x = 0; videoP.content.y = 0; videoP.playVideo();
but error message:
child loaded: VideoLoader 'loader2' (files/assets/flv/critical/3_DialS1_P1.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader3' (files/assets/flv/critical/3_DialS1_V1.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader4' (files/assets/flv/critical/3_DialS1_P2.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader5' (files/assets/flv/critical/3_DialS1_V2.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader7' (files/assets/flv/critical/3_DialS1_V3.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader6' (files/assets/flv/critical/3_DialS1_P3.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader8' (files/assets/flv/critical/3_DialS1_P4.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader9' (files/assets/flv/critical/3_DialS1_V4.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader10' (files/assets/flv/critical/3_DialS1_P5.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader11' (files/assets/flv/critical/3_DialS1_V5.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader12' (files/assets/flv/critical/3_DialS1_P6.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader13' (files/assets/flv/critical/3_DialS1_V6.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader14' (files/assets/flv/critical/3_DialS1_P7.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader15' (files/assets/flv/critical/3_DialS1_V7.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader16' (files/assets/flv/critical/Left.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader17' (files/assets/flv/critical/Right.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader18' (files/assets/flv/critical/Sad.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader19' (files/assets/flv/critical/Wait1.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader20' (files/assets/flv/critical/Wait2.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader21' (files/assets/flv/critical/Wait3.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader22' (files/assets/flv/critical/Wait4.flv) inside queue: LoaderMax 'loader1' child loaded: VideoLoader 'loader23' (files/assets/flv/critical/WaitV1.flv) inside queue: LoaderMax 'loader1' ReferenceError: Error #1069: La propriété 3 est introuvable sur Number et il n'existe pas de valeur par défaut. at view::LoaderBoxView/_queueCompleteHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.greensock.loading.core::LoaderCore/_completeHandler() at com.greensock.loading::LoaderMax/_loadNext() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.greensock.loading.core::LoaderCore/_completeHandler() at com.greensock.loading::VideoLoader/_enterFrameHandler()
if I use just one number in array work fine.
Thanks
-
Hello,
When loading videos is completed, all videos play at same time. How to change this ?
I would like play just the 2 addChild videos:
LoaderMax.activate([VideoLoader]); var urls:Array = ["3_DialS1_P1.flv", "3_DialS1_V1.flv", "3_DialS1_P2.flv", "3_DialS1_V2.flv", "3_DialS1_P3.flv", "3_DialS1_V3.flv", "3_DialS1_P4.flv", "3_DialS1_V4.flv", "3_DialS1_P5.flv", "3_DialS1_V5.flv", "3_DialS1_P6.flv", "3_DialS1_V6.flv", "3_DialS1_P7.flv", "3_DialS1_V7.flv", "Left.flv", "Right.flv", "Sad.flv", "Wait1.flv", "Wait2.flv", "Wait3.flv", "Wait4.flv", "WaitV1.flv"]; var queue:LoaderMax = LoaderMax.parse(urls, {maxConnections:3, onProgress:_progressHandler, onComplete:_queueCompleteHandler, onChildComplete:_childCompleteHandler}); queue.prependURLs("files/assets/flv/critical/"); queue.load(); } private function _progressHandler(event:LoaderEvent):void { this.progress_mc.progressBar_mc.scaleX = event.target.progress; progress_mc.x = int ((Main.instance.getStage().stageWidth - width)/2); progress_mc.y = int ((Main.instance.getStage().stageHeight - height)/2); } private function _queueCompleteHandler(event:LoaderEvent):void { var videoP:VideoLoader = LoaderMax.getLoader("files/assets/flv/critical/3_DialS1_P1.flv"); addChild(videoP.content); videoP.content.x = 0; videoP.content.y = 0; var videoV:VideoLoader = LoaderMax.getLoader("files/assets/flv/critical/3_DialS1_V1.flv"); addChild(videoV.content); videoV.content.x = 0; videoV.content.y = 0; }
Last question, how I can access to other videos loaded ?
Thanks
-
THANKS !!!
like this: Work perfectly !
{transformAroundPoint:{point:new Point(POINT_ROTATION_X,POINT_ROTATION_Y), rotation:ROTATION_VOLET_CCW}, ease:Quart.easeInOut})], numVolet * CLOSE_TPS);
I'm happy to use and support your work ! happy codding
Ilan
-
Ok sorry for my bad english I try to explain what I need.
I try to open and close an Array of sheets ("v0"+numVolet+"_mc")
The open function work fine but when I close the sheets with TweenAlign.SEQUENCE all the sheets close at same time. I would like close sheets like range, not at same time
you can see the problem on this screencast: http://screencast.com/t/W2RGTKqppheF
function to open sheet: Work Fine
public function openV(idFiche:int):void { // var ficheAnimOpen:TimelineMax = new TimelineMax({onComplete:endOpenV}); for(var numVolet:int = 1 ; numVolet <= this["OPEN_TPS_F"+idFiche].length; numVolet++) { //trace("fiche :"+idFiche+" volet :"+numVolet+ " temps :"+this["OPEN_TPS_F"+idFiche][numVolet - 1]); ficheAnimOpen.append(new TweenMax(this["fiche0"+idFiche+"_mc"]["v0"+numVolet+"_mc"], ROTATION_VOLET_TPS, {transformAroundPoint:{point:new Point(POINT_ROTATION_X,POINT_ROTATION_Y), shortRotation:{rotation:ROTATION_VOLET_CC}}, ease:Quart.easeInOut}), this["OPEN_TPS_F"+idFiche][numVolet - 1]); } }
Function to close sheet: SEQUENCE don't work
public function closeV(idFiche:int):void { var ficheAnimClose:TimelineMax = new TimelineMax({onComplete:endCloseV}); for(var numVolet:int = this["OPEN_TPS_F"+idFiche].length; numVolet >= 1; numVolet--) { //trace("fiche :"+idFiche+" volet :"+(numVolet)); ficheAnimClose.insertMultiple([new TweenMax(this["fiche0"+idFiche+"_mc"]["v0"+numVolet+"_mc"], ROTATION_VOLET_TPS, {transformAroundPoint:{point:new Point(POINT_ROTATION_X,POINT_ROTATION_Y), rotation:ROTATION_VOLET_CCW}, ease:Quart.easeInOut, delay:0.1, overwrite:true})], 0, TweenAlign.SEQUENCE, -0.2); } }
Thanks for time
-
Thanks for tips, I'v tried to simplify but I don't find how to use SEQUENCE:
you can see effect here: http://screencast.com/t/d1KtuMx88
the 4 sheets back at same time and I would like make delay between sheet
fiche.insertMultiple([new TweenMax(this["fiche0"+idFiche+"_mc"]["v0"+(numVolet)+"_mc"], ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CCW})], CLOSE_TPS, TweenAlign.SEQUENCE, 0.2);
to understand the array and variables:
//----------------------------------------------------------------------------------- // CONSTANTES //----------------------------------------------------------------------------------- // Angle de rotation des volets private const ROTATION_VOLET_CC = 90; private const ROTATION_VOLET_CCW = -45; private const ROTATION_VOLET_TPS = 1; //----------------------------------------------------------------------------------- // VARIABLES //----------------------------------------------------------------------------------- // MovieClip des 8 fiches public var fiche01_mc:MovieClip; public var fiche02_mc:MovieClip; public var fiche03_mc:MovieClip; public var fiche04_mc:MovieClip; public var fiche05_mc:MovieClip; public var fiche06_mc:MovieClip; public var fiche07_mc:MovieClip; public var fiche08_mc:MovieClip; // Temps de lecture des volets des fiches private var OPEN_TPS_F1:Array = [2,2,2,2]; private var OPEN_TPS_F2:Array = [2,2]; private var OPEN_TPS_F3:Array = [2,2,2]; private var OPEN_TPS_F4:Array = [2]; private var OPEN_TPS_F5:Array = [2]; private var OPEN_TPS_F6:Array = [2,2,2]; private var OPEN_TPS_F7:Array = [2,2]; private var OPEN_TPS_F8:Array = [2,2,2,2,2,2]; // Vitesse de fermeture des volets private var CLOSE_TPS:Number = 0.2;
thanks
-
Hi trying to optimise...
work fine but I don't understand how to use appenMultiple in function closeV
public function openV(idFiche:int):void { var fiche:TimelineMax = new TimelineMax({onComplete:endOpenV}); var iterator:int = 1; for each( var j:int in this["OPEN_TPS_F"+idFiche]) { trace("fiche :"+idFiche+" volet :"+iterator+ " temps :"+j); if (iterator==1) { fiche.append(new TweenMax(this["fiche0"+idFiche+"_mc"]["v0"+iterator+"_mc"], ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),j); } else fiche.append(TweenMax.to(this["fiche0"+idFiche+"_mc"]["v0"+iterator+"_mc"], ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),j); iterator++; } } public function endOpenV():void { trace("done!"); dispatchEvent(new Event("eventOpenEnd")); } public function closeV(idFiche:int):void { var fiche:TimelineMax = new TimelineMax({onComplete:endCloseV}); var iterator:int = 1; for each( var j:int in this["CLOSE_TPS_F"+idFiche]) { trace("fiche :"+idFiche+" volet :"+iterator+ " temps :"+j); if (iterator==1) { fiche.append(new TweenMax(this["fiche0"+idFiche+"_mc"]["v0"+iterator+"_mc"], ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CCW}),j); } else fiche.append(TweenMax.to(this["fiche0"+idFiche+"_mc"]["v0"+iterator+"_mc"], ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CCW}),j); iterator++; } } public function endCloseV():void { trace("done!"); dispatchEvent(new Event("eventCloseEnd")); }
-
Hi,
Thanks for reply, Tried offset but in my exemple I need offset on f01_mc and not fiche01_mc
I'v make little example work fine but very not optimised: maybe you can point me to better direction.
package { import com.greensock.*; import com.greensock.easing.*; import flash.display.MovieClip; import flash.events.Event; import tools.events.CustomEvent; import tools.events.Dispatcher; public class FicheLearningRecordView extends MovieClip { //----------------------------------------------------------------------------------- // CONSTANTES //----------------------------------------------------------------------------------- // Angle de rotation des volets private static const ROTATION_VOLET_CC = 90; private static const ROTATION_VOLET_CCW = -45; // Durée de rotation des volets private static const ROTATION_VOLET_TPS = 1; // Temps de lecture des volets en secondes // Fiche 1 les règles d'or private static const TPS_F1_V01 = 2; private static const TPS_F1_V02 = 3; private static const TPS_F1_V03 = 7; private static const TPS_F1_V04 = 2; // Fiche 2 les points principaux de la présentation private static const TPS_F2_V01 = 2; private static const TPS_F2_V02 = 5; // Fiche 3 l'uniforme de pénélope private static const TPS_F3_V01 = 2; private static const TPS_F3_V02 = 5; private static const TPS_F3_V03 = 2; // Fiche 4 votre maquillage private static const TPS_F4_V01 = 2; // Fiche 5 l'efficacité à l'accueil private static const TPS_F5_V01 = 2; // Fiche 6 les expressions private static const TPS_F6_V01 = 2; private static const TPS_F6_V02 = 5; private static const TPS_F6_V03 = 7; // Fiche 7 la banque d'accueil private static const TPS_F7_V01 = 4; private static const TPS_F7_V02 = 2; // Fiche 8 gérer les situations difficiles private static const TPS_F8_V01 = 2; private static const TPS_F8_V02 = 6; private static const TPS_F8_V03 = 2; private static const TPS_F8_V04 = 7; private static const TPS_F8_V05 = 2; private static const TPS_F8_V06 = 10; //----------------------------------------------------------------------------------- // VARIABLES //----------------------------------------------------------------------------------- // MovieClip des 8 fiches public var fiche01_mc:MovieClip; public var fiche02_mc:MovieClip; public var fiche03_mc:MovieClip; public var fiche04_mc:MovieClip; public var fiche05_mc:MovieClip; public var fiche06_mc:MovieClip; public var fiche07_mc:MovieClip; public var fiche08_mc:MovieClip; //----------------------------------------------------------------------------------- // INIT //----------------------------------------------------------------------------------- public function FicheLearningRecordView():void { var fiche01:TimelineMax = new TimelineMax({onComplete:finishSheet}); var fiche02:TimelineMax = new TimelineMax({onComplete:finishSheet}); var fiche03:TimelineMax = new TimelineMax({onComplete:finishSheet}); var fiche04:TimelineMax = new TimelineMax({onComplete:finishSheet}); var fiche05:TimelineMax = new TimelineMax({onComplete:finishSheet}); var fiche06:TimelineMax = new TimelineMax({onComplete:finishSheet}); var fiche07:TimelineMax = new TimelineMax({onComplete:finishSheet}); var fiche08:TimelineMax = new TimelineMax({onComplete:finishSheet}); // Applique une rotation sur chaques volets de la fiche toutes les x secondes fiche01.append(new TweenMax(fiche01_mc.v01_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F1_V01); fiche01.append(TweenMax.to(fiche01_mc.v02_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F1_V02); fiche01.append(TweenMax.to(fiche01_mc.v03_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F1_V03); fiche01.append(TweenMax.to(fiche01_mc.v04_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F1_V04); // Replace les volets à leurs positions initiales fiche01.appendMultiple([new TweenMax(fiche01_mc.v01_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche01_mc.v02_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche01_mc.v03_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche01_mc.v04_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW})], 1, TweenAlign.START, 0.2); fiche02.append(new TweenMax(fiche02_mc.v01_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F2_V01); fiche02.append(TweenMax.to(fiche02_mc.v02_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F2_V02); fiche02.appendMultiple([new TweenMax(fiche02_mc.v01_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche02_mc.v02_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW})], 1, TweenAlign.START, 0.2); fiche03.append(new TweenMax(fiche03_mc.v01_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F3_V01); fiche03.append(TweenMax.to(fiche03_mc.v02_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F3_V02); fiche03.append(TweenMax.to(fiche03_mc.v03_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F3_V03); fiche03.appendMultiple([new TweenMax(fiche03_mc.v01_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche03_mc.v02_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche03_mc.v03_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW})], 1, TweenAlign.START, 0.2); fiche04.append(new TweenMax(fiche04_mc.v01_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F4_V01); fiche04.appendMultiple([new TweenMax(fiche04_mc.v01_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW})], 1, TweenAlign.START, 0.2); fiche05.append(new TweenMax(fiche05_mc.v01_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F5_V01); fiche05.appendMultiple([new TweenMax(fiche05_mc.v01_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW})], 1, TweenAlign.START, 0.2); fiche06.append(new TweenMax(fiche06_mc.v01_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F6_V01); fiche06.append(TweenMax.to(fiche06_mc.v02_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F6_V02); fiche06.append(TweenMax.to(fiche06_mc.v03_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F6_V03); fiche06.appendMultiple([new TweenMax(fiche06_mc.v01_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche06_mc.v02_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche06_mc.v03_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW})], 1, TweenAlign.START, 0.2); fiche07.append(new TweenMax(fiche07_mc.v01_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F7_V01); fiche07.append(TweenMax.to(fiche07_mc.v02_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F7_V02); fiche07.appendMultiple([new TweenMax(fiche07_mc.v01_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche07_mc.v02_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW})], 1, TweenAlign.START, 0.2); fiche08.append(new TweenMax(fiche08_mc.v01_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F8_V01); fiche08.append(TweenMax.to(fiche08_mc.v02_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F8_V02); fiche08.append(TweenMax.to(fiche08_mc.v03_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F8_V03); fiche08.append(TweenMax.to(fiche08_mc.v04_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F8_V04); fiche08.append(TweenMax.to(fiche08_mc.v05_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F8_V05); fiche08.append(TweenMax.to(fiche08_mc.v06_mc, ROTATION_VOLET_TPS, {rotation:ROTATION_VOLET_CC}),TPS_F8_V06); fiche08.appendMultiple([new TweenMax(fiche08_mc.v01_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche08_mc.v02_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche08_mc.v03_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche08_mc.v04_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche08_mc.v05_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW}), new TweenMax(fiche08_mc.v06_mc, ROTATION_VOLET_TPS,{rotation:ROTATION_VOLET_CCW})], 1, TweenAlign.START, 0.2); } private function finishSheet():void { trace("done!") } } }
-
Maybe:
var lettersArray:Array = new Array("A", "B", "C");
...
-
Hi,
I would like to set a timer between each fiche01_mc.f01_mc, fiche01_mc.f02_mc, fiche01_mc.f03_mc, fiche01_mc.f04_mc, like 1'30" between fiche01_mc.f01_mc and fiche01_mc.f02_mc...
But dont how to begin and if it's possible ?
Second question I have found in club member the TransformAroundPointPlugin, Can I use with my exemple to set the point on f01_mc and not on fiche01_mc... ?
screenshot : http://screencast.com/t/PlmvswvKv
public function FicheLearningRecordView() { var fiches_arr = new Array(fiche01_mc.f01_mc, fiche01_mc.f02_mc, fiche01_mc.f03_mc, fiche01_mc.f04_mc); var timeline:TimelineMax = new TimelineMax(); for(var key:String in fiches_arr){ var mc:MovieClip = MovieClip(fiches_arr[key]); timeline.append(TweenMax.to(mc, .5, {y:180})); timeline.append(TweenMax.to(mc, .5, {scaleX:2, scaleY:2})); timeline.append(TweenMax.to(mc, 1, {rotation:180})); timeline.append(TweenMax.to(mc, .5, {y:0, alpha:0})); } }
Thanks
applyItemXML don't work for me
in TransformManager (Flash)
Posted
Hi,
thx for reply,
Yes sure ! that name in the fla
Yes but I have this error:
ReferenceError: Error #1069: La propriété 0 est introuvable sur Number et il n'existe pas de valeur par défaut.
at tools::TrsfManager/appliXmlTrsfManager()
here is my class where I get data:
Thanks