PDA

View Full Version : Window Component in FLASH 8



bobby.dreamer
August 19th, 2007, 04:00 PM
Iam very new to using components items and XML in flash. This is my scenario, just think there is a image in flash application. When i click it Flash component window should open, displaying the picture of the image with the description of the image. Description of the picture is stored in a XML file.

I did'nt find tutorials for this kinda problem. All the tutorials i found was using javascript window. i want to use FLASH component window.

iam using FLASH 8.
THANK YOU.

zellers
August 20th, 2007, 01:37 AM
my advice, don't use the window component

Do you know how to parse XML with flash?

sadly, this was taken directly from the help book, f1, learn to use it, it's my best friend :crazy:



/**
Requires:
- Button component on Stage (instance name: my_button)
- Window component in library
*/
import mx.containers.Window;

var my_button:mx.controls.Button;

System.security.allowDomain("http://www.helpexamples.com");

// 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.targe t, Window, true, {title:"Sample Image", contentPath:"http://www.helpexamples.com/flash/images/image1.jpg"});
my_win.setSize(320, 240);
};
// Add listener.
my_button.addEventListener("click", buttonListener);


that should give you an idea for a pop-up, then all you have to do is dynamically create a movieClip that contains what will be shown in your window, i.e. the picture, with a description below it. The description could be dynamically attached by use of the MovieClip.createTextField method. The only parameter that would be necessary to change would be the TextField.text parameter, which would essentially be the string that is parsed out of your xml. If you need help with this pm me (or post here agin)