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

Loading external SWF in Actionscript 2

Guest
Apr 18, 2013 Apr 18, 2013

I am creating an animation within Flash CS4 in Actionscript 2.0 / Flash Player 7

At the moment I have a handler (Movie Clip) called myHolder that is used to play other swf files within one main swf file, when called by a button

Within a button that load the swf into the main timeline - For Example

on (press) { loadMovie("BulletTrainDRAFT.swf", myHolder); }

This works fine with bring other swf files into the main swf file timeline, but when I bring a swf file that has video controls for a video within it, they do not respond within the handler when played, but they do work when that swf file is played within its own external flash player window (The video is within a (Movie Clip) on its own timeline within its design fla)

Video buttons - ActionScript 2.0

btnStop.onPress = function()

{  _root.vid.stop();  }

btnPlay.onPress = function()

{  _root.vid.play();  } 

btn_fastforward.onPress = function()

{  _root.vid.nextFrame();  } 

btn_Rewind.onPress = function()

{  _root.vid.prevFrame();  }

I tried ActionScript 3.0 code as well

Pausebtn.addEventListener(MouseEvent.CLICK,pauseHandler);

Stopbtn.addEventListener(MouseEvent.CLICK, stopHandler);

Playbtn.addEventListener(MouseEvent.CLICK,playHandler); 

function stopHandler(event:MouseEvent��void

{ // Pause the stream and move the playhead back to // the beginning of the stream. video.gotoAndStop(1); }

function playHandler(event:MouseEvent��void

{ // Pause the stream and move the playhead back to // the beginning of the stream. video.play(); }

function pauseHandler(event:MouseEvent��void

{ // Pause the stream and move the playhead back to // the beginning of the stream. video.stop(); }

Problem I have I think, is that a movie the external swf loads on the existing timeline as a child and doesn't unload the timeline resulting the actionscript not functional, but I can't fix this.

TOPICS
ActionScript
3.6K
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

correct answers 1 Correct answer

Community Expert , Apr 18, 2013 Apr 18, 2013

if the loaded swf with video is an as2 swf, add:

this._lockroot=true

to it's main timeline.

Translate
Community Expert ,
Apr 18, 2013 Apr 18, 2013

if the loaded swf with video is an as2 swf, add:

this._lockroot=true

to it's main timeline.

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
Guest
Apr 18, 2013 Apr 18, 2013

Thank you so much this fixed my problem and works great ^_^ thank you ^_^

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 ,
Apr 18, 2013 Apr 18, 2013
LATEST

you're welcome.

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