Flash code for window size

  • JohnnyFlash
  • Born
  • Born
  • JohnnyFlash
  • Posts: 4

Post 3+ Months Ago

What's the code for determining the size of a pop up window for a picture or something in flash. The HTML for instance would be:

Code: [ Select ]
<a href="#" onClick="window.open('pics/1.jpg','','width=330,height=470')">Picture1</a>


What is would the flash equivalent be?

Code: [ Select ]
on (release) {
  getURL("pics/1.jpg", "_blank");
}
  1. on (release) {
  2.   getURL("pics/1.jpg", "_blank");
  3. }

What gets added to this?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ToshTrent
  • Newbie
  • Newbie
  • ToshTrent
  • Posts: 14

Post 3+ Months Ago

Hi,

You will need to add the code below to the action script of your button;

Code: [ Select ]
on (release) {
getURL("javascript:resizeWindow('pics/1.htm', 'windowtitle', 'height=265, width=407, resizable=0, fullscreen=0, status=no, scrollbars=no, toolbar=0, location=0, directories=0, menubar=0, left=80, top=100')");
}
  1. on (release) {
  2. getURL("javascript:resizeWindow('pics/1.htm', 'windowtitle', 'height=265, width=407, resizable=0, fullscreen=0, status=no, scrollbars=no, toolbar=0, location=0, directories=0, menubar=0, left=80, top=100')");
  3. }


If more than one instance has the same windowname then the popup will be re-used, otherwise a new window will be prompted each time.

The in the .html where your flash movie is embeded paste the following code in to the body section of the html.

Code: [ Select ]
    <Script Language ="Javascript">
        function resizeWindow(theurl, windowname, features)
        {window.open(theurl, windowname, features);}
    </Script>
  1.     <Script Language ="Javascript">
  2.         function resizeWindow(theurl, windowname, features)
  3.         {window.open(theurl, windowname, features);}
  4.     </Script>


I hope this helps,

Any problems and i'll be happy to send you an example.

Cheers
Tosh[/quote]
  • JohnnyFlash
  • Born
  • Born
  • JohnnyFlash
  • Posts: 4

Post 3+ Months Ago

Yep, that's perfect. Thanx man.
  • ToshTrent
  • Newbie
  • Newbie
  • ToshTrent
  • Posts: 14

Post 3+ Months Ago

No probs, glad to help.

Tosh
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

code tags fellas -- thx :)
  • ToshTrent
  • Newbie
  • Newbie
  • ToshTrent
  • Posts: 14

Post 3+ Months Ago

Oops sorry chap,

I'll remember to use em next time. :oops:
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

no sweat - looks nicer tho eh? ;)
  • ToshTrent
  • Newbie
  • Newbie
  • ToshTrent
  • Posts: 14

Post 3+ Months Ago

Certainly does.

I'm generally impressed with all the features available on your site, well done.

Tosh
  • azriel550
  • Born
  • Born
  • azriel550
  • Posts: 2

Post 3+ Months Ago

I need to have a popup window appear at a specific size, but I also need the page to receive some POST variables from Flash. I have tried using the code on this page with the POST parameter specified in the getURL method call, but this doesnt work.

Does anyone know how this can be done?
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

Code: [ Select ]
blahblah.loadVariables("blahblah.php","POST");


does that help?
  • azriel550
  • Born
  • Born
  • azriel550
  • Posts: 2

Post 3+ Months Ago

Thanks very much for your reply. Im still having problems. Whether I use the getURL or the loadVariables method, my POST variables do not get to the destination when the URL is a Javascript call..

To summarise - When I use a simple URL like "./blabla.php" the whole thing works perfectly. When I use "Javascript:blabla.." instead, the POST variables do not work.

I have tried using the GET method and just attaching the variables to the end of the URL but I can't urlencode them properly with the 'escape()' method - I need users to be able to use quote marks.

The end game here is to have a popup window without a toolbar, address bar etc. at a specific size that receives my POST variables. If there is a way to do this without using JavaScript then I am all ears.

I'll take any suggestions. Thanks again for your help.[/flash][/code]

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 19 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.