-
It's perfect iaskwhy. I wonder if it can be customed. Sara is my flash designer. (CG)
-
FK's Geezer Mod
Check it again. I got the windows to center.
http://www.learningflashmx.com/popup/windowcomp2.html
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 - xSiz / 2, yPos - ySiz / 2);
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", 392.5, 275, 400, 320);
};
myButton2.onPress = function () {
tw.deletePopUp ();
popup ("Old Pictures", "old32b.jpg", 392.5, 275, 400, 260);
};
myButton3.onPress = function () {
tw.deletePopUp ();
popup ("Stop Watch", "clocktimerclass.swf", 392.5, 275, 300, 300);
};
myButton4.onPress = function () {
tw.deletePopUp ();
popup ("Web Commercial", "web.swf", 392.5, 275, 300, 200);
};
myButton5.onPress = function () {
tw.deletePopUp ();
popup ("Video Player", "video5.png", 392.5, 275, 383, 353);
};
popup ("Video Player", "video5.png", 392.5, 275, 383, 353); The 392.5 and 275 are half the pixel width and height of that oulined box in my example.
-
Senior Member
I have to thank you guys for inspiration. I solved one of my search engine problems.
http://flashscript.biz/flash8/window/search_demo.html
I will write a simple tutorial on the window component and how to use it as a slideshow
- The right of the People to create Flash movies shall not be infringed. -
-
FK's Geezer Mod
Well, since your here, what about preloading in a window?
And your windows are stacking up in your example. Use the code I ended up with to delete the old ones when a new one is opened.
-
Senior Member
Need to look into preloading.
Regarding the stacking I am planning to let the window close when the user has clicked on an item in the listbox.
- The right of the People to create Flash movies shall not be infringed. -
-
Ive find out that the popup does not support some .SWF movies/apps like in normal brower window does:
Here is a .swf = http://69.156.40.55/103/main.swf
Here is inside the popup = http://69.156.40.55/103/popup.html
I used the same code as iaskwhy. ive only changed "sunsetwater.jpg" to main.swf.
Last edited by Dr.Eggman; 10-17-2005 at 05:01 PM.
-
Senior Member
Are the path to the pic and the textfile recognized, since that is what is missing.
- The right of the People to create Flash movies shall not be infringed. -
-
Ive changed:
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, 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 - xSiz / 2, yPos - ySiz / 2);
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", "main.swf", 720, 820, 400, 320);
};
myButton2.onPress = function () {
tw.deletePopUp ();
popup ("Old Pictures", "old32b.jpg", 392.5, 275, 400, 260);
};
myButton3.onPress = function () {
tw.deletePopUp ();
popup ("Stop Watch", "clocktimerclass.swf", 392.5, 275, 300, 300);
};
myButton4.onPress = function () {
tw.deletePopUp ();
popup ("Web Commercial", "web.swf", 820, 820, 300, 200);
};
myButton5.onPress = function () {
tw.deletePopUp ();
popup ("Video Player", "video5.png", 392.5, 275, 383, 353);
};
The main.swf is http://69.156.40.55/103/main.swf
Inside 103 i have main.swf and the popup.swf. i run the popup http://69.156.40.55/103/popup.html and click button 1 and stuffs dont work anymore inside the window.
same thing with the game: http://69.156.40.55/103/web.swf inside Button4
Last edited by Dr.Eggman; 10-17-2005 at 05:32 PM.
-
Senior Member
Ah I think I know the reason. Inside the movies you load into the window add this line in the first line of your movie:
this._lockroot = true;
then it will work, I guess?
- The right of the People to create Flash movies shall not be infringed. -
-
Yes it works now
Last edited by Dr.Eggman; 10-17-2005 at 06:12 PM.
-
Senior Member
For the moderator:
http://flashscript.biz/flash8/window/winpop.html
but for the script you have to wait until I have written the tutorial.
- The right of the People to create Flash movies shall not be infringed. -
-
FK's Geezer Mod
Great.
It's not much use unless you can preload the content.
-
I have a question, is it recommended to add: this._lockroot = true; to each movie i want to add in the window component ? Cause some of them work without it.
-
FK's Geezer Mod
lockroot forces any movie to use it's root code on itself. So you don't have to plan for using Relative targetting or modifying code when you want to load a movie already made as a standalone into another movie at a later time.
-
Senior Member
- The right of the People to create Flash movies shall not be infringed. -
-
FK's Geezer Mod
Works great.
-
anyone know what the code would be to change the popup background color from white to grey...
_global.styles.TitleStyles.color = 0x000000;
_global.styles.TitleStyles.fontSize = 14;
thanks
-
Senior Member
_global.styles.Window.setStyle ("backgroundColor", 0xCCCCCC);
- The right of the People to create Flash movies shall not be infringed. -
-
thanks man works great....
-
Quick question?
Anyone know why at first i had the window component working great and it was draggable around the stage...now when i click on the header it closes as it would with the close button...
is there a paramater somewhere im missing?
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
|