View Full Version : popup script
hanbok
05-02-2008, 10:29 PM
hi
i have made a popup window with a drag function and i tried to put on it a minimaizer and a close button
but they dont work when i press them:
the drag and drop function works
its:
on (press) {
startDrag("");
}
on (release) {
stopDrag();
}
my action scrip that i put is this(but doesnt work)
so please help
on (release) {
gotoAndStop("minimize");
}
and the other
on (release) {
tellTarget ("/") {
setProperty("popupwindow2", _visible, "0");
}
}
please help me to write espassily the close button actionscript
thank you
ushka
05-02-2008, 11:06 PM
//to minimize
on (release) {
popupwindow2.gotoAndStop("minimize");
}
//to close
on (release) {
popupwindow2._visible = false;
}
if popupwindow2 is on another time line, you may have to say _root.popupwindow2._visible = false or whatever the path is to that window... make sense?
tellTarget ("/") {
Which version of Flash are you using, tellTarget has been depreciated (just FYI).
tellTarget(target:String, statement(s))
Deprecated since Flash Player 5. Macromedia recommends that you use dot (.) notation and the with statement.
hanbok
05-02-2008, 11:17 PM
thanks for the answer.
ok the minimizer button now works only with that script
on (release) {
gotoAndStop("minimize");
}
but the close button desnt work at all
i tried with bote the root one and without root as you told me
please do you have any suggestions to help me
i use flash cs3
thank you
ushka
05-02-2008, 11:24 PM
Wait are you using AS3.0 or AS2.0?
CS3 has both.
For AS3, you're in the wrong forum?
If you're using AS2 and you save as Flash 8 then post your files, I'll take a look...
hanbok
05-02-2008, 11:38 PM
yes i use actionscript 2.0 and save as flash 8
but still the close button desnt work
i tried so many times nothing
any other suggestions for the script
ushka
05-02-2008, 11:48 PM
Reply with the files attached to your post and I can take a look.
Or look at the example I just posted here...
You can try:
on (release) {
_parent._visible = false;
}
SmashingEric
05-03-2008, 12:27 AM
not sure if this is the issue, but for the drag code, if you're treating the entire popup as a button (which it looks like you are from the top code) for dragging, and the two buttons are nested inside the popup, then the buttons won't work because you can't nest buttons inside of each other in AS 2. The top most button in the hierarchy takes precedence.
i use flash cs3
Wait are you using AS3.0 or AS2.0? CS3 has both. For AS3, you're in the wrong forum?
I know AS3 does not use "tellTarget" ;)
not sure if this is the issue, but for the drag code, if you're treating the entire popup as a button (which it looks like you are from the top code) for dragging, and the two buttons are nested inside the popup, then the buttons won't work because you can't nest buttons inside of each other in AS 2. The top most button in the hierarchy takes precedence.
If thats the issue, then you will find these useful:
senocular.com - Dealing With Flash Button Event Capturing (http://www.senocular.com/flash/tutorials/buttoncapturing/)
senocular.com - Event Bubbling with Buttons (http://www.senocular.com/flash/source.php?id=0.160)
SmashingEric
05-03-2008, 01:05 AM
If thats the issue, then you will find these useful:
senocular.com - Dealing With Flash Button Event Capturing (http://www.senocular.com/flash/tutorials/buttoncapturing/)
senocular.com - Event Bubbling with Buttons (http://www.senocular.com/flash/source.php?id=0.160)
Nevermind. responded before clicking the links.
hanbok
05-03-2008, 11:09 AM
hi
thank you very much for all the answers
i tried all examples but nothing
this script works
on (release) {
_parent._visible = false;
}
but close everything on the stage,other buttons,images,all.
i just would like that it close only the popup window.
so i am not using anymore minimize and close,
only i need is the CLOSE button.
i am attaching the example file here on which ,when we press play Quicktime, appear the popup window.
and there is on the top the close button.(which doesnt work)
here is the file to download
http://www.sendspace.com/file/p4jdbq
thank you very much for the help
crazydev
05-03-2008, 12:07 PM
change this line
_root.popupwindow2._visible = false;
with this line
_parent.popupwindow2._visible = false;
hanbok
05-03-2008, 12:18 PM
thanks that works perfect.
:cool:
just one last thing
because the popup window plays a short animation(there is a flv file embedded into the popup window with sound
wnen i close it with that script the sound still continue to play
so how can I stop all that when the window close,please?
the script on the button that start the animaion and the popup is:
on (release) {
nextFrame();
}
on (release) {
setProperty("popupwindow2", _visible, "1");
}
so maybe to stop it will be to go to the previous frame,or?
thank you again so much
crazydev
05-03-2008, 12:35 PM
you have alter your script to play that flv file
I dont know where u've put that code
you have to close you NetStream in order to close that sound or just set volume to 0.
can you point out where you have placed your code to play flv file so that i can exactly point out how to stop that
Sorry i just have a look on your fla again you have to call
_parent..popupwindow2.cont.videoPlayer.stop();
where videoPlayer is instance name for your flvplayback component but have not set instance name so far replace this name what ever you to be
cheers
hanbok
05-03-2008, 05:42 PM
thank you so much for the help,this works perfectly!!!!
thank you
:D
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.