Go Back   kirupaForum > Flash > ActionScript 1.0/2.0

Reply
 
Thread Tools Display Modes
Old 02-03-2004, 04:05 PM   #1
Kapo
Junior Member
Popup Tutorial Question

Hey,

I read the popup and tutorial and it's great!

But i have one question to it.

How can i tell the window to open on a certain part of the monitor?

I know there's something like "screenX/screenY = .. " but can somebody tell me how i can build that into my script?

Thx!

Kapo
Kapo is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Old 02-03-2004, 04:20 PM   #2
lostinbeta
Halcyon
 
lostinbeta's Avatar
Location Woodbridge, VA

Posts 17,476
which pop-up tutorial are you using?

__________________

Meditation Room | Take a deep breath...
lostinbeta is offline   Reply With Quote
Old 02-03-2004, 04:24 PM   #3
Kapo
Junior Member
http://www.kirupa.com/developer/mx/centered_popup.htm


this one
Kapo is offline   Reply With Quote
Old 02-03-2004, 04:28 PM   #4
Kapo
Junior Member
oh, btw, i#ve just noticed another thing

when i use the button and open a popup window, it works. Once i close the window and try to open it again, i can't open it again. I have to reload the page before i can load the new window again.

And is it possible to have a swf-file with like 5 buttons on it - and all buttons have a popup window action attached to it?

Kapo
Kapo is offline   Reply With Quote
Old 02-03-2004, 04:30 PM   #5
lostinbeta
Halcyon
 
lostinbeta's Avatar
Location Woodbridge, VA

Posts 17,476
In the on(press) for the button add 2 more variables in there.. one called top... and have it equal how many pixels from the top of the screen you want it to be at. And add another variable called left and set that value to how many pixels from the left you want the window to be at.

Then in the function call you will want to change these things....

1) In the function you have to specify the correct arguments, so change...
ActionScript Code:
_global.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable)
to
ActionScript Code:
_global.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable, top, left)
Notice how we added top and left to the end of the arguments list.
2) Find this line...
ActionScript Code:
top='+((screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"')
and change it to
ActionScript Code:
top='+top+',left='+left+'"+"')
Now the script is set up to accept the specified top and left values instead of the centered window values.


I think this should work.

__________________

Meditation Room | Take a deep breath...
lostinbeta is offline   Reply With Quote
Old 02-03-2004, 04:51 PM   #6
Kapo
Junior Member
ok thx man..

and do u think u can help me with the other prob too?

When i open the window, and close it, i can't open it or another window anymore without havin to refresh the swf


is there somethin that can slove this problem?

maybe i have to close the windo with javascript?

Kapo
Kapo is offline   Reply With Quote
Old 02-03-2004, 04:54 PM   #7
lostinbeta
Halcyon
 
lostinbeta's Avatar
Location Woodbridge, VA

Posts 17,476
Uhhh, unless something changed in the tutorial, it should work just fine. I fixed this issue a while back... I believe kirupa updated the code in the tutorial to fix this issue and we haven't had problems with this since.

Perhaps you are using the downloadable source .fla (which may not contain the updated code that is in the tutorial)?

__________________

Meditation Room | Take a deep breath...
lostinbeta is offline   Reply With Quote
Old 02-03-2004, 04:58 PM   #8
Kapo
Junior Member
nope, i used the code from the tutorial.. everything works, just not this funktion

here is the link to my page i'm building:

http://web62.multimediastudios.de/Index2.htm

Go to: "memberz" ( The buttons for Kapone & D.Chesron are the ones with the scripts till now)
Kapo is offline   Reply With Quote
Old 02-03-2004, 05:00 PM   #9
Kapo
Junior Member
oh wait, i've just noticed, that the links only work when the memberz.swf isn#t fully loaded.. that should be the problem .. let me see if i can find why it's that way
Kapo is offline   Reply With Quote
Old 02-03-2004, 05:01 PM   #10
Kapo
Junior Member
could it be because of the "stop" action on the last frame?

would be strange if it was becuz of that

[edit]

I have just put the script of the actions layer after the stop.

But now (i have put scripts on all buttons now) only 2 buttons - the second and the last - work?

:confused:

Last edited by Kapo; 02-03-2004 at 05:05 PM..
Kapo is offline   Reply With Quote
Old 02-03-2004, 05:02 PM   #11
lostinbeta
Halcyon
 
lostinbeta's Avatar
Location Woodbridge, VA

Posts 17,476
I don't know, are you sure you uploaded the correct .swf file to the server when you added the code to those buttons?

Are you sure each button has a different value for the target_winName variable (or whatever that variable is for the window name)?

If these are all fine, I don't know whats up, when I re-wrote the code I tested in many times and it always worked.

__________________

Meditation Room | Take a deep breath...
lostinbeta is offline   Reply With Quote
Old 02-03-2004, 05:09 PM   #12
Kapo
Junior Member
I have given every button a different value name (from kirupa to kirupa4) ..

darn.. i don't understand why those 2 buttons work and the others don't

Last edited by Kapo; 02-03-2004 at 05:17 PM..
Kapo is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:14 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com