  | |  | Window Component and Movie Clips | Window Component and Movie Clips 2004-02-11 - By Carter, Kim K.
Back Hi, All I'm developing a FLASH demo that uses the getURL to launch a PDF document. When the PDF document is launched, the FLASH demo continues to play. I put in a stop(), which stopped the play, but now I need to put a popup window with a "Resume Play" button, when the user returns back to the FLASH demo. I followed the FLASH help for attaching objects (movie clips) to a window. The movie contains a "Resume Play" button. I created a window component in the first frame using action script. I use the contentPath parameter of createPopUp to attach the movie. The movie clip is in the library not on the stage. The movie linkage settings: ResumePlay_mc Export in first frame Export for Action Script AS 2.0 = mx.core.View On the "Resume Play" button I added: on(release){ _level0.myWindow.deletePopUp(); _level0.gotoAndPlay(2); } When testing the movie, it displays the window with the "Resume Play" button in it. When I click the button, it closes the window, but does not continue play. If someone could just explain to me what is going on. 1. When a movie clip is attached to a Window, how do you access the movie clip and its children? 2. Can I not continue play for the Main timeline from within a movie? 3. Why does the Listener for the Resume Button not work when I initialize it in the first Frame of the Main timeline (see below). Do I NOT have access to the movie object ResumePlay_mc and its children? -- ---- ----- CODE IN MAIN TIMELINE FRAME 1 -- ---- -----
myWindow = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, true, { closeButton:true, title:"Resume Play", contentPath:"ResumePlay_mc"}); myWindow.modalWindow("true"); myWindow.setSize(260,260); //Listener for Resume Play button does not work var buttonListener = new Object(); buttonListener.click = function(){ myWindow.deletePopUp(); NextFrame(); } // Attach button listener to ResumePlay_btn on Movie Clip ResumePlay_mc _level0.depthChild0.content.ResumePlay_btn.addEventListener("click",buttonLi stener); // This code does not work either _level0.depthChild0.content.ResumePlay_mc.ResumePlay_btn.addEventListener("c lick", buttonListener); //What are myWindow children, proprieties, objects for(name in myWindow){ trace ("myWindow children are: " + name); } stop(); // halt play
-- ---- ---- ---- ---- ----- CUT HERE -- ---- ---- Any Help or direction is greatly welcomed. Kim K. Carter
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <TITLE id=ridTitle>Message</TITLE>
<STYLE><!-- body { font-family: Arial, Helvetica; font-size: 10pt; color: #0033cc; margin-top: 25px; margin-left: 10px; } --></STYLE>
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD> <BODY id=ridBody background=cid:048284513@(protected)> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>Hi, All</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>I'm developing a FLASH demo that uses the getURL to launch a PDF document. When the PDF document is launched, the FLASH demo continues to play. I put in a stop(), which stopped the play, but now I need to put a popup window with a "Resume Play" button, when the user returns back to the FLASH demo.</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004 >I followed the FLASH help for attaching objects (movie clips) to a window. The movie contains a "Resume Play" button.</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004 >I created a window component in the first frame using action script. I use the contentPath parameter of createPopUp to attach the movie. The movie clip is in the library not on the stage.</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>The movie linkage settings: ResumePlay_mc</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> Export in first frame</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> Export for Action Script</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> AS 2.0 = mx.core.View</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>On the "Resume Play" button I added:</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>on(release){</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> _level0.myWindow.deletePopUp();</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> _level0.gotoAndPlay(2);</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>}</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>When testing the movie, it displays the window with the "Resume Play" button in it. When I click the button, it closes the window, but does not continue play.</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> </SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>If someone could just explain to me what is going on. </SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> 1. When a movie clip is attached to a Window, how do you access the movie clip and its children?</SPAN></FONT><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> </SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> 2. Can I not continue play for the Main timeline from within a movie?</SPAN></FONT><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> </SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> 3. Why does the Listener for the Resume Button not work when I initialize it in the first Frame of the Main timeline (see below). Do I NOT have access to the movie object </SPAN></FONT><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>ResumePlay_mc and its children?</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> </SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004> </SPAN></FONT></SPAN></FONT></SPAN></FONT><FONT face="Times New Roman" color=#000000></FONT></DIV></DIV> <DIV><SPAN class=048284513-11022004><FONT face="Times New Roman" color=#000000>-- ---- ----- CODE IN MAIN TIMELINE FRAME 1 -- ---- -----</FONT></SPAN></DIV><FONT><SPAN class=048284513-11022004> <DIV><FONT face="Times New Roman"><BR><FONT color=#000000></FONT></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000> myWindow = mx.managers.PopUpManager.createPopUp(_root, <SPAN class=048284513-11022004>mx.containers.</SPAN>Window, true, { closeButton:true, title:"<SPAN class=048284513-11022004>Resume Play</SPAN>", contentPath:"<SPAN class=048284513-11022004>ResumePlay_mc</SPAN>"});<BR> myWindow.modalWindow("true");<BR> <SPAN class=048284513-11022004> </SPAN>myWindow.setSize(260,260);<BR> </FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000> <BR> <SPAN class=048284513-11022004>//Listener for Resume Play button does not work </SPAN></FONT></DIV> <DIV><FONT><SPAN class=048284513-11022004></SPAN><SPAN class=048284513-11022004></SPAN><FONT face="Times New Roman" color=#000000> <SPAN class=048284513-11022004> var buttonListener = new Object();</SPAN></FONT></FONT></DIV> <DIV><FONT><FONT><SPAN class=048284513-11022004></SPAN><SPAN class=048284513-11022004></SPAN><FONT face="Times New Roman"><FONT color=#000000><SPAN class=048284513-11022004> </SPAN>b<SPAN class=048284513-11022004>uttonListener.click = function(){</SPAN></FONT></FONT></FONT></FONT></DIV> <DIV><FONT><FONT><SPAN class=048284513-11022004></SPAN></FONT></FONT> </DIV> <DIV><FONT><FONT><SPAN class=048284513-11022004> myWindow.deletePopUp();<BR> NextFrame(); </SPAN></FONT></FONT></DIV> <DIV><FONT><FONT><SPAN class=048284513-11022004> }</SPAN></FONT></FONT></DIV> <DIV><FONT><FONT><SPAN class=048284513-11022004></SPAN></FONT></FONT> </DIV> <DIV><FONT><FONT><SPAN class=048284513-11022004> // Attach button listener to ResumePlay_btn on Movie Clip ResumePlay_mc</SPAN></FONT></FONT></DIV> <DIV><FONT><FONT><SPAN class=048284513-11022004></SPAN></FONT></FONT><FONT><FONT><SPAN class=048284513-11022004></SPAN><FONT face="Times New Roman" color=#000000> _level0.depthChild0.content.ResumePlay_btn.addEventListener("click",<SPAN class=048284513-11022004>buttonListener</SPAN>);</FONT></FONT></FONT></DIV> <DIV><SPAN class=048284513-11022004><FONT face="Times New Roman" color=#000000></FONT></SPAN> </DIV> <DIV><SPAN class=048284513-11022004><FONT face="Times New Roman" color=#000000> // This code does not work either</FONT></SPAN></DIV> <DIV><SPAN class=048284513-11022004><FONT face="Times New Roman" color=#000000> _level0.depthChild0.content.ResumePlay_mc.ResumePlay_btn.addEventListener( "click", buttonListener);</FONT></SPAN></DIV> <DIV><FONT face="Times New Roman" color=#000000></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>//What are myWindow children, proprieties, objects</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman"><FONT color=#000000><SPAN class=048284513-11022004>fo</SPAN>r(name in myWindow){<BR> trace ( "myWindow child<SPAN class=048284513-11022004>ren are:</SPAN> " + name);<BR>}</FONT></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000>stop();<SPAN class=048284513-11022004> // halt play</SPAN><BR></FONT></DIV> <DIV></SPAN></FONT><SPAN class=048284513-11022004><FONT face="Times New Roman" color=#000000>-- ---- ---- ---- ---- ----- CUT HERE -- ---- ----</FONT></SPAN></DIV> <DIV><FONT face="Times New Roman" color=#000000></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004>Any Help or direction is greatly welcomed.</SPAN></FONT></DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV><FONT face="Times New Roman" color=#000000><SPAN class=048284513-11022004></SPAN></FONT> </DIV> <DIV align=left><FONT face="Monotype Corsiva" size=4>Kim K. Carter</FONT></DIV> <P> </P></BODY></HTML>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected) For additional commands, e-mail: flashnewbie-help@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |