-
Flash 8's window component
Anyone familliar with flash 8's window component ?
http://anim.tv/vidmail/popup.html
I would like to know how can i use it as a popup window like:
http://anim.tv/104/popupwindow.swf where i can add contents in it and use the close button.
Also ive find out that not all .swf app work inside the window. why ?
-
Senior Member
I don't know the problem is fixed by now but the 7 version had a problem. This is the way to fix it:
http://flashscript.biz/components/co...ks/window.html
- The right of the People to create Flash movies shall not be infringed. -
-
Yeah it like that but actualy i get this in flash 8:
http://hstrial-jpaz.homestead.com/popupwin.rar
In the parameters of the window i get:
closebutton
contentpath
title
-
Senior Member
I have a look at home.
- The right of the People to create Flash movies shall not be infringed. -
-
FK's Geezer Mod
You have to add a listener for the close button to work;
Code:
var winListener:Object = new Object();
winListener.click = function() {
my_win.deletePopUp();
};
-
Thank you iaskwhy. Do you know how to do this:
http://www.*****.com/demo/components...ndowtTest.html
I mean, click a button to make the window popup and without having it open when i load my page ?
-
FK's Geezer Mod
Here's the code. Change the link to your own image. I used a component button on stage and the window component in the library, not on the stage.
Code:
/**
Requires:
- Button component on Stage (instance name: my_button)
- Window component in library
*/
import mx.containers.Window;
var my_button:mx.controls.Button;
// Create listener object.
var buttonListener:Object = new Object();
buttonListener.click = function(evt_obj:Object) {
// Instantiate Window.
var my_win:MovieClip = mx.managers.PopUpManager.createPopUp(evt_obj.target, Window, true, {title:"Sunset On Water", closeButton:true, contentPath:"I:/aaF8/slideshows/images/sunsetwater.jpg"});
my_win.setSize(400, 320);
var winListener:Object = new Object();
winListener.click = function() {
my_win.deletePopUp();
};
my_win.addEventListener("click", winListener);
};
// Add listener.
my_button.addEventListener("click", buttonListener);
All this is straight from the help files in F8.
-
Flash, Mans greatest invention
can i use ask whats the advantage of using this component over doing the same thing with AS and your own swf ?
-
FK's Geezer Mod
The advantage is that it takes about 1 minute to set up with the component.
-
hello iaskwhy,
Im sorry to say this but i dont know where to add the code. im very new Im looking the exact thing has eggman. i have flash 8 and the window component. do i have to create frames ?
Please help.
-
Senior Member
Do the following with the downloaded movie.
Delete the window component from the stage but leave it in the library. Then put button on stage and name it myButton (Must not necessarily be a button component). Then put this script in an action frame:
The script is similar to what the moderator wrote.
PHP Code:
// create a new CSSStyleDeclaration named TitleStyles
// and list it with the global styles list
_global.styles.TitleStyles = new mx.styles.CSSStyleDeclaration();
// customize styles
_global.styles.TitleStyles.color = 0x000000;
_global.styles.TitleStyles.fontSize = 14;
function popup(wContent:String) {
myButton.onPress = function() {
tw = mx.managers.PopUpManager.createPopUp(this, mx.containers.Window, true, {closeButton:true, titleStyleDeclaration:"TitleStyles"});
tw.title = "WINDOW";
tw.setSize(528, 334);
tw.contentPath = "game.swf";
tw.move(20, 20);
var handleCloseObject:Object = new Object();
handleCloseObject.click = function(evt:Object) {
evt.target.deletePopUp();
};
tw.addEventListener("click", handleCloseObject);
};
}
popup("Testing....");
Last edited by cancerinform; 10-16-2005 at 11:02 AM.
- The right of the People to create Flash movies shall not be infringed. -
-
FK's Geezer Mod
What I haven't figured out, is how to make more than one pop up, or load different content in the same window.
-
Originally Posted by iaskwhy
What I haven't figured out, is how to make more than one pop up, or load different content in the same window.
I was thinking the same thing. cause i know peoples who abuse pupups on the web. i mean clicking the button more then once.. you know what i mean ?
I think the only way is to make the user open 1 window.. like an alert box wich woudn't make him click twice or click other popup button untill he/she close the current window.
-
Senior Member
more than one popup example:
PHP Code:
// create a new CSSStyleDeclaration named TitleStyles
// and list it with the global styles list
_global.styles.TitleStyles = new mx.styles.CSSStyleDeclaration ();
// customize styles
_global.styles.TitleStyles.color = 0x000000;
_global.styles.TitleStyles.fontSize = 14;
function popup (wText:String, wContent:String, xPos:Number, yPos:Number) {
tw = mx.managers.PopUpManager.createPopUp (this, mx.containers.Window, false, {closeButton:true, titleStyleDeclaration:"TitleStyles"});
tw.title = wText;
tw.setSize (225, 334);
tw.contentPath = wContent;
tw.move (xPos, yPos);
var handleCloseObject:Object = new Object ();
handleCloseObject.click = function (evt:Object) {
evt.target.deletePopUp ();
};
tw.addEventListener ("click", handleCloseObject);
}
myButton1.onPress = function () {
popup ("Testing....", "game.swf", 20, 20);
};
myButton2.onPress = function () {
popup ("Again testing....", "pic_10.jpg", 275, 20);
};
Last edited by cancerinform; 10-16-2005 at 04:30 PM.
- The right of the People to create Flash movies shall not be infringed. -
-
Im sorry guys im total new.
here's what i did: http://hstrial-nne.homestead.com/pop.rar
And i didn't succeed. cancerinform your code looks powerful.
Per the Flashkit FAQ, allowable footer sizes at the maximum is 300 pixels wide by 40 pixels high.
Not the 339 pixel wide by 156 pixel high image you had. Please follow the rules - gerbick (supermod)
-
FK's Geezer Mod
Ah, thank you. Not only did you answer the question, you just gave me a function gestalt.
-
Originally Posted by Neneko
Sara, this is that you was looking for: http://hstrial-pip.homestead.com/popup.rar
A multiple button for 1 window thanks to cancerinform's codes whe can now do flash popups. Thanks dudes
-
FK's Geezer Mod
http://www.learningflashmx.com/popup/windowcomp2.html
5 buttons, but only one window at a time opens.
From cancerinforms script, modified.
-
Originally Posted by iaskwhy
How did you do that ? awsome !
The popup draging limit... and the all in 1 window.
Last edited by Dr.Eggman; 10-17-2005 at 02:23 AM.
-
FK's Geezer Mod
Code:
// create a new CSSStyleDeclaration named TitleStyles
// and list it with the global styles list
_global.styles.TitleStyles = new mx.styles.CSSStyleDeclaration ();
// customize styles
_global.styles.TitleStyles.color = 0x000000;
_global.styles.TitleStyles.fontSize = 14;
function popup (wText:String, wContent:String, xPos:Number, yPos:Number, xSiz:Number, ySiz:Number) {
tw = mx.managers.PopUpManager.createPopUp (this, mx.containers.Window, false, {closeButton:true, titleStyleDeclaration:"TitleStyles"});
tw.title = wText;
tw.setSize (xSiz, ySiz);
tw.contentPath = wContent;
tw.move (xPos, yPos);
var handleCloseObject:Object = new Object ();
handleCloseObject.click = function (evt:Object) {
evt.target.deletePopUp ();
};
tw.addEventListener ("click", handleCloseObject);
}
myButton1.onPress = function () {
tw.deletePopUp ();
popup ("Sunset On Water", "sunsetwater.jpg", 20, 20, 400, 320);
};
myButton2.onPress = function () {
tw.deletePopUp ();
popup ("Old Pictures", "old32b.jpg", 20, 20, 400, 260);
};
myButton3.onPress = function () {
tw.deletePopUp ();
popup ("Stop Watch", "clocktimerclass.swf", 20, 20, 300, 300);
};
myButton4.onPress = function () {
tw.deletePopUp ();
popup ("Web Commercial", "web.swf", 20, 20, 300, 200);
};
myButton5.onPress = function () {
tw.deletePopUp ();
popup ("Video Player", "video5.png", 20, 20, 383, 353);
};
What it still needs is a preloader and some way to center the windows. working on that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|