Flash CS3 introduces many new and exciting features and delivers an entirely new experience in Flash dev.
Adobe Flash CS3
Flash MX 2004 - Sized Javascript Windows
Streamline your web dev with a collection of Adobe software including the new Flash CS3 Pro.
Adobe Creative Suite 3
Adobe Creative Suite 3
Note: Even though this is listed under MX 2004 it's not version specific, this is just where it ended up getting listed.
Also, this is not necessarily specific to Flash either, this code could be used just as easy with an HTML link, placing javascript:popUp() where your normal URL goes.
This will show you how to open new, sized windows from your Flash movie. There's really not much to it so there really isn't a tutorial. You must know how to create buttons, if you can do that you'll be in business as most of the process involves Javascript outside of the movie. Don't get worried if you have no experience with Javascript, the code is easily configurable and all you need to do is copy and paste it.
Once you've created your button, select and bring up the Actions window (F9). Apply the following code to the button:
on (release) {
getURL("javascript:popUp()");
}
Now all you need to do is publish your movie and apply the Javascript. The script is setup so you can control everything outside of Flash and saves the trouble of having to open your movie to make any changes. In any editor (Dreamweaver, Notepad, etc), open the HTML file that was published with your movie. In between the <HEAD> </HEAD> tags paste the following code:
That's all there is to it. You can see where the configuration area is, in case you want some of the browser features to show. By default everything is turned off and the window is not resizeable.
Only edit what is inside the quotation marks.
Unless you know what you're doing, only change what is marked as configurable or the code may not continue to work.
Working Example
Code Explanation:
var url = "newpage.html"; - The page to load inside the window.
var w = "500"; - The new window's width.
var h = "300"; - The new window's height.
var menu = "no"; - Shows or hides the top menus (File, Edit, etc).
var scroll = "no"; - Shows or hides the scrollbars.
var tool = "no"; - Shows or hides the browser buttons.
var location = "no"; - Shows or hides the URL field.
var resize = "no"; - Allows or disallows the window to be resized.
Also, this is not necessarily specific to Flash either, this code could be used just as easy with an HTML link, placing javascript:popUp() where your normal URL goes.
This will show you how to open new, sized windows from your Flash movie. There's really not much to it so there really isn't a tutorial. You must know how to create buttons, if you can do that you'll be in business as most of the process involves Javascript outside of the movie. Don't get worried if you have no experience with Javascript, the code is easily configurable and all you need to do is copy and paste it.
Once you've created your button, select and bring up the Actions window (F9). Apply the following code to the button:
on (release) {
getURL("javascript:popUp()");
}
Now all you need to do is publish your movie and apply the Javascript. The script is setup so you can control everything outside of Flash and saves the trouble of having to open your movie to make any changes. In any editor (Dreamweaver, Notepad, etc), open the HTML file that was published with your movie. In between the <HEAD> </HEAD> tags paste the following code:
That's all there is to it. You can see where the configuration area is, in case you want some of the browser features to show. By default everything is turned off and the window is not resizeable.
Only edit what is inside the quotation marks.
Unless you know what you're doing, only change what is marked as configurable or the code may not continue to work.
Working Example
Code Explanation:
var url = "newpage.html"; - The page to load inside the window.
var w = "500"; - The new window's width.
var h = "300"; - The new window's height.
var menu = "no"; - Shows or hides the top menus (File, Edit, etc).
var scroll = "no"; - Shows or hides the scrollbars.
var tool = "no"; - Shows or hides the browser buttons.
var location = "no"; - Shows or hides the URL field.
var resize = "no"; - Allows or disallows the window to be resized.