dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Action Script 3 memory leaks problem

  1. #1
    Junior Member
    Join Date
    May 2018
    Posts
    2

    Unhappy Action Script 3 memory leaks problem

    Hello my project memory leaks problem how fix it
    i use carousel component

    http://flashotaku.com/components/carousel/

    Code:
    var harekettr2:Boolean = false;
    myCarouseltr2.addEventListener(CarouselEvent.SCROLL_PROGRESS, eventHandlertr2);
    myCarouseltr2.addEventListener(CarouselEvent.SCROLL_COMPLETE, eventHandler2tr2);
    
    function eventHandlertr2(event:CarouselEvent):void
    {
    	harekettr2 = true;
    }
    
    function eventHandler2tr2(event:CarouselEvent):void
    {
    	harekettr2 = false;
    }
    
    var myXMLtr2:XML;
    var myLoadertr2:URLLoader = new URLLoader();
    var yukleyicitr2:Loader=new Loader();
    
    myLoadertr2.load(new URLRequest("acg/acg.xml"));
    myLoadertr2.addEventListener(Event.COMPLETE, processXMLtr2);
    function processXMLtr2(e:Event):void
    {
    	myXMLtr2 = new XML(e.target.data);
    	myCarouseltr2.addEventListener(CarouselEvent.ITEM_CLICK, itemClickHandlertr2);
    }
    
    function itemClickHandlertr2(event:CarouselEvent):void
    {
    	if (! harekettr2)
    	{
    		trace(myXMLtr2.image[event.index].@source);
    		var adres:String = myXMLtr2.image[event.index]. @ source;
    		var req:URLRequest = new URLRequest(adres);
    		yukleyicitr2.load(req);
    		yukleyicitr2.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandlertr2);
    		resimmc.resimmc2.addChild(yukleyicitr2);
    		resimmc.gotoAndPlay(2);
    	}
    }
    
    function completeHandlertr2(event:Event):void
    {
    	var loader:Loader = Loader(event.target.loader);
    	yukleyicitr2.x = 0;
    	yukleyicitr2.y = 0;
    	yukleyicitr2.width = 1080;
    	yukleyicitr2.height = 509;
    }

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center