Skip to main content
Known Participant
August 30, 2010
Answered

Creating swf file from one swf

  • August 30, 2010
  • 1 reply
  • 1131 views

Hi,

Can i create a another swf fie when clicking from main swf.

i  did this but its giving me an output into another IE browser. i want to  open a new window like main swf and not into IE browser i had this  code,

videoBtn.addEventListener(MouseEvent.CLICK,openSwf1 );

function openSwf1(event:MouseEvent):void
{
var request:URLRequest=new URLRequest("whateverswf.swf");
navigateToURL(request);
}

can anyone help me to do that?

Thanks

This topic has been closed for replies.
Correct answer kglad

if you want to load whateverswf.swf, use the loader class.  if you want to open whateverswf.swf in the same browser window as main swf, use:


videoBtn.addEventListener(MouseEvent.CLICK,openSwf1 );

function openSwf1(event:MouseEvent):void
{
var request:URLRequest=new URLRequest("whateverswf.swf");
navigateToURL(request,"_self");
}


1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
August 30, 2010

if you want to load whateverswf.swf, use the loader class.  if you want to open whateverswf.swf in the same browser window as main swf, use:


videoBtn.addEventListener(MouseEvent.CLICK,openSwf1 );

function openSwf1(event:MouseEvent):void
{
var request:URLRequest=new URLRequest("whateverswf.swf");
navigateToURL(request,"_self");
}


Known Participant
August 30, 2010

Hi,

I have movieclip btn into the main file. when user click it should play a  video into the

another window could be IE or another swf file. what i  have done is i create a new fla whatever.fla file which contain  FLVPLAYBACK component and i embeded that video into that whatever.fla  and create a new swf called whatever.swf. now i am targeting that file  with code into main file.

ActionScript Code:
videoBtn.addEventListener(MouseEvent.CLICK,openSwf 1 );

function openSwf1(event:MouseEvent):void
{
var request:URLRequest=new URLRequest("whatever.swf");
navigateToURL(request);
}

now in my local folder if i click that btn in my main file. it is  opening a IE browser with my new swf file. but when i send this entire  folder to the client and he is trying to open it its not running.

What culd be the problem? any idea?

thanks
kglad
Community Expert
Community Expert
August 30, 2010

he's probably encountering a security issue.  have him upload the files to a server and test or have him change his security settings:

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html