JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 14th, 2001, 04:51 AM
Chewie's Avatar
Chewie Chewie is offline
Coding fun is drunk
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: Lincoln, UK
Posts: 127 Chewie User rank is Sergeant (500 - 2000 Reputation Level)Chewie User rank is Sergeant (500 - 2000 Reputation Level)Chewie User rank is Sergeant (500 - 2000 Reputation Level)Chewie User rank is Sergeant (500 - 2000 Reputation Level)Chewie User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 22 h 27 m 36 sec
Reputation Power: 21
Send a message via Yahoo to Chewie
Sorry about the title but it got you attention didnt it!


What i want to do is dynamically alter the size of a pop up window,

so when the user clicks on a link, the popup window opens, i have a flash file in the pop up whih will be exactley 100% x 100%, in the flash file i have a game, and what i want to do, is in the game, when a character moves to the edge of the screen (say the left) i want the whole of the pop up window to move to the left a couple of pixels. I know how to do the flash side of things, (if your wondering i'll do a hit test with an fscommand), but how o i dynamically set the window placement on the screen,

I know this isnt code of any sort but maybe it will help you get a idea of what i want to do

window.placement()=100,100
if hit left= true
set window.placement() *move whole window left 1 pixel*
if hit right= true
set window.placement() *move whole window right 1 pixel*
if hit up= true
set window.placement() *move whole window up 1 pixel*
if hit down= true
set window.placement() *move whole window down 1 pixel*


can any1 help?

__________________
"The cause will equal the effect after the effect has preceded the cause"

Reply With Quote
  #2  
Old March 14th, 2001, 04:52 PM
justStarting justStarting is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 6 justStarting User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can I try - even if I am not a master?

I think the solution for your problem is quite simple - the moveTo() method of window object. You have to keep track of your coordinates and just to add 1 to it.

the code I can thing of is:

my_x += 1;
window.moveTo(my_x,my_y);

Reply With Quote
  #3  
Old March 14th, 2001, 05:12 PM
merkinmuffley's Avatar
merkinmuffley merkinmuffley is offline
film at 11
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Portland, OR
Posts: 413 merkinmuffley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
moveBy will also work, and you don't have to know the exact position on the screen you want to move the window to.

if (self.moveBy)
{
self.moveBy(1,0); // moves the window 1 pixel to the right
}

Reply With Quote
  #4  
Old March 14th, 2001, 06:12 PM
justStarting justStarting is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 6 justStarting User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, you are right merkinmuffley - I always forget about this one!

Yes, you are right merkinmuffley - I always forget about this one!

Reply With Quote
  #5  
Old March 15th, 2001, 03:15 AM
Chewie's Avatar
Chewie Chewie is offline
Coding fun is drunk
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: Lincoln, UK
Posts: 127 Chewie User rank is Sergeant (500 - 2000 Reputation Level)Chewie User rank is Sergeant (500 - 2000 Reputation Level)Chewie User rank is Sergeant (500 - 2000 Reputation Level)Chewie User rank is Sergeant (500 - 2000 Reputation Level)Chewie User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 22 h 27 m 36 sec
Reputation Power: 21
Send a message via Yahoo to Chewie
thanx for the help guys..
ND THIS NEXT QUESTION MITE SOUND STUPID, but if i use self.moveby how do i get it to move up and down?

Reply With Quote
  #6  
Old March 15th, 2001, 10:07 AM
merkinmuffley's Avatar
merkinmuffley merkinmuffley is offline
film at 11
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Portland, OR
Posts: 413 merkinmuffley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
moveBy(x, y)
x is horizontal movement and y is vertical movement. positive x moves to the right, and positive y moves down. think of the first quadrant (upper right) of a graph, but this graph is flipped upside-down, so the origin (0, 0) is in the upper lefthand corner instead of the lower left.

so, you could use self.moveTo(0,0) to put the upper left corner of the window in the upper left corner of the screen.

a cool trick is to move the window entirely off the screen and make the user figure out where it went. you could do this by using self.moveBy(-1000, 0), for example.

fyi, none of this works if the page is in a frame, because the "self" window doesn't have all the properties and abilities of a real window.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Javascript masters only please.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap