Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Window Component and Movie Clips

Window Component and Movie Clips

2004-02-11       - By Carter, Kim K.

 Back
Reply:     1     2  

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>&nbsp;</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.&nbsp; 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>&nbsp;</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>&nbsp;</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.&nbsp; I use
the contentPath parameter of createPopUp to attach the movie.&nbsp;&nbsp;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>&nbsp;</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>&nbsp;&nbsp;&nbsp; Export in first
frame</SPAN></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004>&nbsp;&nbsp;&nbsp; Export for Action
Script</SPAN></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004>&nbsp;&nbsp;&nbsp; AS 2.0 =
mx.core.View</SPAN></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004></SPAN></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004>On the&nbsp;"Resume Play" button I
added:</SPAN></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004></SPAN></FONT>&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
_level0.myWindow.deletePopUp();</SPAN></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004>&nbsp;&nbsp;&nbsp;&nbsp;
_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>&nbsp;</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>&nbsp;</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>&nbsp;&nbsp;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>&nbsp;</SPAN></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004>&nbsp; 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>&nbsp;</SPAN></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004>&nbsp;&nbsp;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004>&nbsp; </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>&nbsp;</DIV>
<DIV><FONT face="Times New Roman" color=#000000>&nbsp;&nbsp;&nbsp; myWindow =
mx.managers.PopUpManager.createPopUp(_root,&nbsp;<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>&nbsp;&nbsp;&nbsp;
myWindow.modalWindow("true");<BR>&nbsp;&nbsp;<SPAN
class=048284513-11022004>&nbsp; </SPAN>myWindow.setSize(260,260);<BR>&nbsp;
</FONT></DIV>
<DIV><FONT face="Times New Roman"
color=#000000>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN
class=048284513-11022004>//Listener for Resume&nbsp;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>&nbsp;<SPAN class=048284513-11022004> var&nbsp;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>&nbsp;&nbsp; </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>&nbsp;</DIV>
<DIV><FONT><FONT><SPAN
class=048284513-11022004>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
myWindow.deletePopUp();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
NextFrame();&nbsp;</SPAN></FONT></FONT></DIV>
<DIV><FONT><FONT><SPAN class=048284513-11022004>&nbsp;&nbsp;&nbsp;&nbsp;
}</SPAN></FONT></FONT></DIV>
<DIV><FONT><FONT><SPAN
class=048284513-11022004></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT><SPAN class=048284513-11022004>&nbsp;&nbsp; // 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>&nbsp;&nbsp;
_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>&nbsp;</DIV>
<DIV><SPAN class=048284513-11022004><FONT face="Times New Roman"
color=#000000>&nbsp;&nbsp; // This code does not work either</FONT></SPAN></DIV>
<DIV><SPAN class=048284513-11022004><FONT face="Times New Roman"
color=#000000>&nbsp;&nbsp;
_level0.depthChild0.content.ResumePlay_mc.ResumePlay_btn.addEventListener(
"click",
buttonListener);</FONT></SPAN></DIV>
<DIV><FONT face="Times New Roman" color=#000000></FONT>&nbsp;</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>&nbsp;trace (
"myWindow
child<SPAN class=048284513-11022004>ren are:</SPAN>&nbsp;" +
name);<BR>}</FONT></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004></SPAN></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face="Times New Roman" color=#000000><SPAN
class=048284513-11022004></SPAN></FONT>&nbsp;</DIV>
<DIV align=left><FONT face="Monotype Corsiva" size=4>Kim K. Carter</FONT></DIV>
<P>&nbsp;</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.