
August 6th, 2004
06:03 PM
Flash MX 2004 Buttons config..
after using flash 5 and then to flash mx the diffrence in scripting buttons to work was easy to handle. but now i upgraded to flash mx 2004 bout a month ago but havent got use to being able to configuire the flash mx 2004 compontent buttons. i want to be a ble to click a button in a swf into to be able to open a window componet displaying info, can someone help me..
___________________
"i wish i could fly, right up to the sky but i cant"

August 7th, 2004
12:56 AM
Neverside Newbie
Status: Offline!
hey, codeeight,
mx twenty-ought-four components are no fun to script at all. I usually find it easier just to make my own.. But to use the window component, well, there's a few ways, but I only know of one.. Some set up: drag a window to your stage and delete it to get it in your library, add another movieclip for content and make sure it's set for export under linkage (speaking of which, make sure the window is set to export as well. Should default that way, but you never know). Finally, I'm assuming you're using a regular button with an instance name "my_btn" and not a component button - that's a whole 'nother can of worms...
Finally, use this script:
<?php
//import a couple classes
import mx.managers.PopUpManager;
import mx.containers.Window;
my_btn.onRelease = function() {
//Popup manager creates a pop up which accepts LOCATION to create popup (i.e. "this"),
//TYPE of popup ("Window" in this case), and MODALITY (have no idea what modality is,
//but setting it to false has little or no impact). Finally add a few properties to
//your window...
var myWindow:MovieClip = PopUpManager.createPopUp(this, Window, true, {closeButton:true, title:"Title of Window", contentPath:"linkageNameOfContentMC"});
//size of window
myWindow.setSize(200, 300);
//x and y value of window.
myWindow.move(200, 100);
//button listener to use the popup manager to remove the window when you
//hit the close button.. Another pain...
var windowListener:Object = new Object();
windowListener.click = function(evt:Object) {
evt.target.deletePopUp();
};
//add the listener to your window, and, whew.. all done.
myWindow.addEventListener("click", windowListener);
};
?>
hope that helps out..
d.
___________________
obod | weapons of mass dysfunction

August 7th, 2004
01:10 AM
k, think i understand. thanks very much.
___________________
"i wish i could fly, right up to the sky but i cant"