Copy link to clipboard
Copied
Hi,
I've got a few .swf files with video tutorials I've created using Captivate 4.
I wanted to link them so I've created a main screen with menu with buttons in Flash.
I've added AS to load the external swf files but they load in the same window. How can I load these .swf files in seperate window so that you could get back to the main window after you've finished watching?
Here's my code:
stop();
var myLoader:Loader = new Loader();
button1_btn.addEventListener(MouseEvent.CLICK, movie1_1);
function movie1_1(e:MouseEvent):void
{
var myURL:URLRequest = new URLRequest("01_01_Welcome.swf");
myLoader.load(myURL);
addChild(myLoader);
}
I'm also attaching screenshot with menu in flash
Copy link to clipboard
Copied
Try this:
var myLoader:Loader = new Loader();
var myURL:String = "01_01_Welcome.swf";
button1_btn.addEventListener(MouseEvent.MOUSE_DOWN,function():void {
navigateToURL(new URLRequest(myURL), "_blank");
myLoader.load(myURL);
addChild(myLoader);
}
);
Copy link to clipboard
Copied
Hi Dan,
I'm getting an error message:
Scene 1, Layer 'actions', Frame 27, Line 7 1067: Implicit coercion of a value of type String to an unrelated type flash.net:URLRequest.
Copy link to clipboard
Copied
take out this line:
myLoader.load(myURL);
I added to my code from yours.
Copy link to clipboard
Copied
I've deleted the line and now the code lookes like that:
stop();
var myLoader:Loader = new Loader();
button1_btn.addEventListener(MouseEvent.CLICK, movie1_1);
function movie1_1(e:MouseEvent):void
{
var myURL:URLRequest = new URLRequest("01_01_Welcome.swf");
addChild(myLoader);
}
Unfortunately, it doesn't load the .swf file when you click on the button...
Copy link to clipboard
Copied
Sorry my bad.
function movie1_1(e:MouseEvent):void
{
var myLoader =new Loader();
myLoader.load(new URLRequest("01_01_Welcome.swf"));
addChild(myLoader)}
Copy link to clipboard
Copied
Hi Dan,
We're back to where I started....
It does load the .swf file but in the same window. Is there any way to make it load in a seperate window so people can close the window after watching it and get back to menu?
Copy link to clipboard
Copied
Just to be clear, you want it to load it in the same swf file correct? And not a new browser window?
You would need to load it in a movieClip
Here is a sample that loads it in a movieClip, see attached file. Hmmm, won't let me upload...try it here: http://www.smithmediafusion.com/openCloseWindowSample.fla
Copy link to clipboard
Copied
What I'm trying to do is creat stand-alone swf files to use on the computer (without use of web browser).
I want to be able to jump from menu to different chapters (swf files) and get back to main menu.
Because the other swf files have been created in Captivate not Flash, I don't know how to make them come back to the main menu after watching them.