Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Query regarding Action Script 3.0 in Adobe Flash Professional CS5

New Here ,
Jul 06, 2017 Jul 06, 2017

I used below code in the time line to navigate between swf files if I press on nextBtn, but after 15 to 20 navigations Flash player is getting struck and I was not able to navigate to next swf file. Could you please check the below code and make necessary corrections if there are any mistakes

import flash.events.MouseEvent;

import flash.display.Loader;

import flash.net.URLRequest;

import flash.events.Event;

import flash.events.ProgressEvent;

import flash.events.MouseEvent;

fscommand("fullscreen","true");

nextBtn.addEventListener(MouseEvent.CLICK, nextFile);

function nextFile(evt:MouseEvent):void

{

stop(); // To stop the playing frame and move to next scene on click of next button

var mLoader:Loader = new Loader();

var mRequest:URLRequest = new URLRequest("abc.swf");

/*var i:Number = 0;

for (i=numChildren-1;i>=0; i--)

{

removeChildAt(i);

} */

mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);

mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);

mLoader.load(mRequest);

}

function onCompleteHandler(loadEvent:Event):void

{

addChild(loadEvent.currentTarget.loader);

}

function onProgressHandler(mProgress:ProgressEvent):void

{

var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;

}

TOPICS
ActionScript
207
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 06, 2017 Jul 06, 2017
LATEST

only one swf file is loaded by thta code (abc.swf) so your snippet is not the (only) problem.

[moved from Creative Suites to ActionScript 3]

p.s. please don't cross-post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines