Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a MovieClip and loading a swf into that clip which contains 1

Status
Not open for further replies.

HomeAway

Programmer
Jun 6, 2003
36
0
0
AE
Try the following:
1.) create a flash movie "testparent" with 1 frame and in that frame enter the following actionscript
thisItem = _root.createEmptyMovieClip("clip_mc", 0);
thisItem.loadMovie("testexternal.swf");
thisItem._x = -100;
thisItem._y = -100;
** creates a movieclip "clip_mc" and loads the external swf file testexternal into it.

2.) create another fla called "testexternal" , add a button to it and place the following code into the actionscript of the button.
on(release){
var x = 300;
var y = 250;
var loginWindow = mx.managers.PopUpManager.createPopUp(this,
mx.containers.Window, true, {contentPath:"login", closeButton:true, title:" vpfm.Net Status", _x:x, _y:y});
// Set window size
loginWindow.setSize(180, 100);
loginWindowListener = new Object();
loginWindowListener.click = function() {
loginWindow.deletePopUp();
};
loginWindow.addEventListener("click", loginWindowListener);
// Save window instance (so it can be closed later)
trace(this);
this.application.login.loginInstance=loginWindow;
}


3.) Run the testexternal on its own and when you click the button it displays the popup.
4.) However, run the testparent.swf file and although you are able to see the testexternal file within the movieclip, clicking the button does not display the popup.

WHY ???
 
Add the Alert window to the library of the parent movie just like you did for the external file.

That will fix the problem.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
pixl8r,

MARRY ME !! haha, you are a bloomin legend. Cheers for that !!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top