Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

ilanb

Members
  • Posts

    27
  • Joined

  • Last visited

ilanb's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. 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: package data { public class ListSlideGame { private var _slide:Array; private var _slides:Array; private var _images:Array; private var _image:Array; private var galleryXml:XMLList; private var slideXml:XMLList; private var slideXmlType:XMLList; //-------------------------------------------------------------------------------------------------------------- // // INIT // //-------------------------------------------------------------------------------------------------------------- public function init(xml:XML):void { _slide = new Array(); _slides = new Array(); _images = new Array(); _image = new Array(); slideXmlType = new XMLList(xml.type); _slides.push( new Slides (slideXmlType.@idType, slideXmlType.@idSize) ); for (var i:int = 0; i < xml.slide.length(); i++) { slideXml = new XMLList(xml.slide[i]); _slide.push ( new SlidesGame ( slideXml.@id, slideXml.img1, slideXml.img1.@crossPosX, slideXml.img1.@crossPosY, slideXml.img1.@posX, slideXml.img1.@posY, slideXml.img2, slideXml.img2.@posX, slideXml.img2.@posY, slideXml.img3, slideXml.img3.@posX, slideXml.img3.@posY, slideXml.txt1, slideXml.txt2, slideXml.item, slideXml.item.@name, slideXml.item.@level, slideXml.item.@a, slideXml.item.@b, slideXml.item.@c, slideXml.item.@d, slideXml.item.@tx, slideXml.item.@ty, slideXml.item.@xOffset, slideXml.item.@yOffset, slideXml.item.@rawWidth, slideXml.item.@rawHeight, slideXml.item.@scaleMode, slideXml.item.@hasSelectableText, slideXml.item.@minScaleX, slideXml.item.@maxScaleX, slideXml.item.@minScaleY, slideXml.item.@maxScaleY, slideXml.item.@lockScale, slideXml.item.@lockPosition, slideXml.item.@lockRotation, slideXml.item.@constrainScale, slideXml.item.@minWidth, slideXml.item.@maxWidth, slideXml.item.@minHeight, slideXml.item.@maxHeight ) ); } for (var j:int = 0; j < xml.gallery.image.length(); j++) { galleryXml = new XMLList(xml.gallery.image[j]); _image.push ( new ImageGame ( galleryXml.@id, galleryXml.@full, galleryXml.@thumb ) ); } } //-------------------------------------------------------------------------------------------------------------- // // GETTERS // //-------------------------------------------------------------------------------------------------------------- public function getGalleryLenght():Number { var numbImgs:Number = _image.length; return numbImgs; } public function getGalleryXmlList():XMLList { var xmlImgs:XMLList = galleryXml; return xmlImgs; } public function getSlideTypeAndSize():Slides { var slides:Slides; slides = _slides[0] as Slides; return slides; } public function getSlideLenght():Number { var numbImgsSlide:Number = _slide.length; return numbImgsSlide; } public function getSlideById(idS:int):SlidesGame { var slide:SlidesGame; var index:int = 0; var find:Boolean = false; while (index < _slide.length && !find) { slide = _slide[index] as SlidesGame; if (slide.id == idS) find = true; else index++; } if (!find) return null; else return slide; } public function getImgGalleryById(idS:int):ImageGame { var imgG:ImageGame; var index:int = 0; var find:Boolean = false; while (index < _image.length && !find) { imgG = _image[index] as ImageGame; if (imgG.id == idS) find = true; else index++; } if (!find) return null; else return imgG; } } } package data { import data.DevData; import flash.display.Loader; import flash.display.LoaderInfo; import flash.events.Event; import flash.net.URLLoader; import flash.net.URLRequest; import tools.CustomEvent; import tools.Dispatcher; public class BannerData { private var xmlLoader:URLLoader; private var loader:URLLoader; private var _listSlides:ListSlideGame; private var urlImg:String; //----------------------------------------------------------------------------------- // // INIT // //----------------------------------------------------------------------------------- public function init():void { urlImg = main.instance.getVarSlides_xml as String; _listSlides = new ListSlideGame(); loadNewXml(); } //----------------------------------------------------------------------------------- // // XML // //----------------------------------------------------------------------------------- private function loadNewXml():void { // Change les urls si online ou offline if(DevData.ONLINE == false) { xmlLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, onNewXmlLoaded); xmlLoader.load(new URLRequest(DevData.XML_PATH + main.instance.gameData.getConfigFromXmlById("slides_xml"))); } else { xmlLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, onNewXmlLoaded); xmlLoader.load(new URLRequest(urlImg)); } } private function onNewXmlLoaded(event:Event):void { xmlLoader.removeEventListener(Event.COMPLETE, onNewXmlLoaded); _listSlides.init(new XML(event.target.data)); onAllXmlLoaded(); } //-------------------------------------------------------------------------------------------------------------- // // ON ALL XML LOADED // //-------------------------------------------------------------------------------------------------------------- private function onAllXmlLoaded():void{Dispatcher.dispatchEvent(new CustomEvent(DevData.GAME_BANNER_READY));} //-------------------------------------------------------------------------------------------------------------- // // GETTERS // //-------------------------------------------------------------------------------------------------------------- public function get listSlides():ListSlideGame{return _listSlides;} } } package data { import data.DevData; public class SlidesGame { private var _id:int; private var _img1:String; private var _img2:String; private var _img3:String; private var _txt1:String; private var _txt2:String; private var _posXimg1:int; private var _posYimg1:int; private var _posXimg2:int; private var _posYimg2:int; private var _posXimg3:int; private var _posYimg3:int; private var _crossPosXimg1:int; private var _crossPosYimg1:int; private var _item:*; private var _name:*; private var _level:*; private var _a:*; private var _b:*; private var _c:*; private var _d:*; private var _tx:*; private var _ty:*; private var _xOffset:*; private var _yOffset:*; private var _rawWidth:*; private var _rawHeight:*; private var _scaleMode:*; private var _hasSelectableText:*; private var _minScaleX:*; private var _maxScaleX:*; private var _minScaleY:*; private var _maxScaleY:*; private var _lockScale:*; private var _lockPosition:*; private var _lockRotation:*; private var _constrainScale:*; private var _minWidth:*; private var _maxWidth:*; private var _minHeight:*; private var _maxHeight:*; //-------------------------------------------------------------------------------------------------------------- // // INIT // //-------------------------------------------------------------------------------------------------------------- public function SlidesGame ( id:int, img1:String, crossPosXimg1:int, crossPosYimg1:int, posXimg1:int, posYimg1:int, img2:String, posXimg2:int, posYimg2:int, img3:String, posXimg3:int, posYimg3:int, txt1:String, txt2:String, item:*, name:*, level:*, a:*, b:*, c:*, d:*, tx:*, ty:*, xOffset:*, yOffset:*, rawWidth:*, rawHeight:*, scaleMode:*, hasSelectableText:*, minScaleX:*, maxScaleX:*, minScaleY:*, maxScaleY:*, lockScale:*, lockPosition:*, lockRotation:*, constrainScale:*, minWidth:*, maxWidth:*, minHeight:*, maxHeight:* ) { _id = id; _img1 = img1; _crossPosXimg1 = crossPosXimg1; _crossPosYimg1 = crossPosYimg1; _posXimg1 = posXimg1; _posYimg1 = posYimg1; _img2 = img2; _posXimg2 = posXimg2; _posYimg2 = posYimg2; _img3 = img3; _posXimg3 = posXimg3; _posYimg3 = posYimg3; _txt1 = txt1; _txt2 = txt2; _item = item; _name = name; _level = level; _a = a; _b = b; _c = c; _d = d; _tx = tx; _ty = ty; _xOffset = xOffset; _yOffset = yOffset; _rawWidth = rawWidth; _rawHeight = rawHeight; _scaleMode = scaleMode; _hasSelectableText = hasSelectableText; _minScaleX = minScaleX; _maxScaleX = maxScaleX; _minScaleY = minScaleY; _maxScaleY = maxScaleY; _lockScale = lockScale; _lockPosition = lockPosition; _lockRotation = lockRotation; _constrainScale = constrainScale; _minWidth = minWidth; _maxWidth = maxWidth; _minHeight = minHeight; _maxHeight = maxHeight } //-------------------------------------------------------------------------------------------------------------- // // GETs // //-------------------------------------------------------------------------------------------------------------- public function get id():int { return _id; } public function get img1():String { return _img1; } public function get img2():String { return _img2; } public function get img3():String { return _img3; } public function get txt1():String { return _txt1; } public function get txt2():String { return _txt2; } public function get posXimg1():int { return _posXimg1; } public function get posYimg1():int { return _posYimg1; } public function get posXimg2():int { return _posXimg2; } public function get posYimg2():int { return _posYimg2; } public function get posXimg3():int { return _posXimg3; } public function get posYimg3():int { return _posYimg3; } public function get crossPosXimg1():int { return _crossPosXimg1; } public function get crossPosYimg1():int { return _crossPosYimg1; } public function get item():int { return _item; } public function get name():int { return _name; } public function get level():int { return _level; } public function get a():int { return _a; } public function get b():int { return _b; } public function get c():int { return _c; } public function get d():int { return _d; } public function get tx():int { return _tx; } public function get ty():int { return _ty; } public function get xOffset():int { return _xOffset; } public function get yOffset():int { return _yOffset; } public function get rawWidth():int { return _rawWidth; } public function get rawHeight():int { return _rawHeight; } public function get scaleMode():int { return _scaleMode; } public function get hasSelectableText():int { return _hasSelectableText; } public function get minScaleX():int { return _minScaleX; } public function get maxScaleX():int { return _maxScaleX; } public function get minScaleY():int { return _minScaleY; } public function get maxScaleY():int { return _maxScaleY; } public function get lockScale():int { return _lockScale; } public function get lockPosition():int { return _lockPosition; } public function get lockRotation():int { return _lockRotation; } public function get constrainScale():int { return _constrainScale; } public function get minWidth():int { return _minWidth; } public function get maxWidth():int { return _maxWidth; } public function get minHeight():int { return _minHeight; } public function get maxHeight():int { return _maxHeight; } } Thanks
  2. 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); } } }
  3. ilanb

    Optimisation

    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}); }
  4. 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
  5. Thx Carl ! very useful example ! try this and adapt for my need !
  6. Hi Carl, 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); }
  7. 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
  8. 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 !
  9. 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 !
  10. Ok sorry, I make a zip today. For MonsterDebugger, yes I have tried with removing trace and it's same.
  11. Hi Jack, the class : https://files.me.com/ibompuis/9uvspy thanks
  12. 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
  13. 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
  14. 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/
  15. 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
×