Ask a Question related to Macromedia Flash Sitedesign, Design and Development.
-
ZSR webforumsuser@macromedia.com #1
launching a fixed sized browser window from a movie clip
Hi all,
I have a slide show and I'd like to give the viewer the option of seeing a larger version of each graphic in the slide show.
Ideally, the viewer would click on the graphic in the slide show and launch a new window with the larger graphic.
The only way I know how to do this is within Dreamweaver, specifying a window with a fixed size. Not sure about Flash.
I can do a getURL but it seems then I can't control the size of the window. (I'm new to Flash and actionscripting.)
Can anyone help?
If you would like to look at the site in development to see the slide show, after going to the referral link, just enter the
site to avoid the intro, and the slide show will come up.
thanks very much for your time and help.
best
Susan
Referring URLs
[url]http://www.susanprager.com/test/kaleido/kaleido4c.html[/url]
ZSR webforumsuser@macromedia.com Guest
-
Position Sized Browser Window
Is there an extension to position a sized browser window? Thanks! -
Fitting Flash movie to browser window
Hello, is there a way to make Flash movie "fit to browser window"? The scale of the movie should remain 100%, but the movie area should resize to... -
pop-up a sized browser window from Shockwave movie?
Hi, I'm having problems with this. I want to pop up a sized browser window from shockwave. I tried using externalEvent to reach a javascript... -
movie hides browser window
Using Window Xtra http://www.meliorasoft.com/xtras/window/ you can create an application bar and put there buttons to switch between the movie and... -
Launching MP3s Opens Player as Browser Window
I've got three direct links to progressive-stream MP3 files (my host doesn't support realtime streaming, bastards) on the page,... -
ZSR webforumsuser@macromedia.com #2
Re: launching a fixed sized browser window from a movie clip
Hi all,
Just noticed someone asked essentially the same question just before I did. Being new to actionscripting/programming, hopefully I can figure it out from there.
Sorry to take your time.
best,
Susan
ZSR webforumsuser@macromedia.com Guest
-
ub3rge3k #3
Re: launching a fixed sized browser window from a movie clip
Susan, check out my answer to another similar question from ron titled
Setting size of targeted window.
the will have to change the code though
here is an example
ok in the head of your document between <head></head> tags put this
<script language="JavaScript" type="text/JavaScript">
<!--
function SusanFullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}
//-->
</script>
now in the body where you are going to have the link to open this window up
<a href="javascript:void(0);"
onClick="fullScreen('name_of_your_window.html');"> Susan say open me</a>
Ub3r
"ZSR" <webforumsuser@macromedia.com> wrote in message
news:bjghdv$al5$1@forums.macromedia.com...did. Being new to actionscripting/programming, hopefully I can figure it out> Hi all,
>
> Just noticed someone asked essentially the same question just before I
from there.> Sorry to take your time.
>
> best,
> Susan
>
>
ub3rge3k Guest
-
ZSR webforumsuser@macromedia.com #4
Re: launching a fixed sized browser window from a movie clip
Hi Ubergeek,
Thanks so much for taking the time to reply to my post. :-) Almost replied privately, but thought others might find this thread useful.
I'm still a little unclear about something, if you could please explain further- this code would go in the html of a document, and then i'd have to open the window from within the html, rather than from Flash, is that correct? also, where would the the width and height parameters go?
I tried to use the code from a reply to open a popup from Flash, but that was a bit difficult for me to understand. It is pasted below, FYI.
I attached the usage part to an invisible button but it didn't work. I also tried putting the whole thing in the actionscript, but that didn't work either. Then I thought I'd have to add the first part to an html document, but then I wasn't sure how that would relate to the Flash piece, unless it was the html that housed the Flash. Also, could I test that from within Flash?
Here's the code that was given:
======================
// -------------------------
// Open a centered popup
// window with passed
// features (FLASH MX)
// -------------------------
MovieClip.prototype.centerPopup = function( theUrl,title, w, h, features)
{
var sysW = System.capabilities.screenResolutionX;
var sysH = System.capabilities.screenResolutionY;
var centerx = Math.round((sysW/2)-( w/2));
var centery = Math.round((sysH/2)-( h/2));
getURL("javascript:void(window.open('" + theUrl
+ "','" + title + "','width="+w+", height="+h+", left="
+centerx+", top="+centery+",screenX="+centerx+", screenY="
+centery+"," + features + "'));");
}
// -------------------------
// usage:
// -------------------------
/*on (release)
{
centerPopup("http://www.html.it","html",400,300,"menubar=no");
}*/
// code from: [url]http://www.sephiroth.it/[/url]
===========================
Your thoughts are very much appreciated.
kind regards,
Susan
ZSR webforumsuser@macromedia.com Guest
-
*DAN* webforumsuser@macromedia.com #5
Re: launching a fixed sized browser window from a movie clip
Hi!
The coolest way to do this is to use php and javascript in your html file and create a function.Then you
just call that function from flash.
So:
1. make a img.html containing this (here is a php function that gets the image dimensions from server.the picture is in the "pics" folder in your root):
<html>
<head>
<title>Page name</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php $size = GetImageSize ("pics/$id.jpg"); ?>
<body onload="window.resizeTo(<? echo $size[0]; ?>,<? echo $size[1]; ?>)" leftmargin="0" topmargin="0">
<IMG SRC=<?php echo "pics/$id.jpg"; ?> <?php echo $size[3]; ?>>
</body>
</html>
2. in the html file that contains flash make this function (java script):
</script>
<script language="JavaScript">
<!--
function picture(name) { //v2.0
window.open('http://www.yourdomain.com/img.html?id='+name,'picture');
}
//-->
</script>
3.In flash use this to pop-up the image
on (release) {
getURL ("javascript:picture('name')");
}
The advantage of this is that you don't have to specify the height/width of each image.Imagine that you have 200 images with different sizes and you'll heve to change them twice a week ;)
Hope that helps!
*DAN* webforumsuser@macromedia.com Guest
-
ZSR webforumsuser@macromedia.com #6
Re: launching a fixed sized browser window from a movie clip
Dear Dan,
Thank you very much for that cool idea. I am trying to implement it now.
If you could clarify a couple of things (my understanding of actionscripting/programing is not yet very good) it would be great.
1. the img.html file- does each image need its specific html file? so it would be: myimage1.html
-- or is it a generic img.html file for all the images, with a blank page and just the code?
2. in flash, when I attach the actionscript to the button, would I put in the image name as follows?:
on (release) {
getURL ("javascript:picture('myimage1.jpg')");
}
I'm unsure where the actual name of the image would go
thanks so much for s-p-e-l-l-i-n-g this all out for me so patiently.
kind regards,
Susan
ZSR webforumsuser@macromedia.com Guest
-
ub3rge3k #7
Re: launching a fixed sized browser window from a movie clip
Susan, first off sorry about my earlier post..I was tired when I read what
you wanted...
Now that I actually found your post...lol.
ok Dan has an excellent piece of code there (I dont want to step on any
toes)
if you dont have PHP on the server your using, you can use this
inside the head tags <head></head>of your flash document (when you export
flash)
type this
<script language="javascript">
<!--
var newwin;
function SusanPicWindow (winurl,winname,winfeatures)
{
newwin = window.open(winurl,winname,winfeatures);
}
-->
</script>
now in FLASH, on each button you want to place your image put this code.
on (release) {
getURL("javascript:SusanPicWindow('myImage1.html' , 'newwindow' ,
'toolbar=no,width=500,height=300,left=0,top=0,stat us=no,scrollbars=no,resiza
ble=no')");
}
just repeat this on each button you want the pop-up, all you have to do is
change the height, width, and .html name of each different image page
hope this helps
Ub3r
"ZSR" <webforumsuser@macromedia.com> wrote in message
news:bjnu0k$tn$1@forums.macromedia.com...actionscripting/programing is not yet very good) it would be great.> Dear Dan,
>
> Thank you very much for that cool idea. I am trying to implement it now.
>
> If you could clarify a couple of things (my understanding ofwould be: myimage1.html>
> 1. the img.html file- does each image need its specific html file? so itand just the code?> -- or is it a generic img.html file for all the images, with a blank pagethe image name as follows?:>
> 2. in flash, when I attach the actionscript to the button, would I put in>
> on (release) {
> getURL ("javascript:picture('myimage1.jpg')");
> }
>
> I'm unsure where the actual name of the image would go
>
> thanks so much for s-p-e-l-l-i-n-g this all out for me so patiently.
>
> kind regards,
> Susan
>
>
ub3rge3k Guest
-
ZSR webforumsuser@macromedia.com #8
Re: launching a fixed sized browser window from a movie clip
Dear Ub3r and Dan,
Have tried both your suggestions and have made a little progress- testing in Flash, the button does open a window using both codes. But, it does not find the image or html file.
It's probably something small and obvious but I'm not seeing it.
In testing:
the first image in the slide show, for some reason, is not being recognized as a button when it is exported, although it behaves as a simple button when enabled.
The second image does open a window when the movie is exported, but unfortunately, the window is blank with the following in the URL locator:
javascript:picture('nypac_lg.jpg')
I put the file up online, using Dan's code right now, if you would like to see. You would just skip the intro and land on the temp homepage.
Online, neither button is recognized. :-(
I'm sorry to take so much of your time. If we can't get it to work, I'll just launch a window without it being sized to fit- I think I can do that. :-)
Thanks very much again.
Kind regards,
Susan
Referring URLs
[url]http://susanprager.com/test/kaleido/kaleido4d.html[/url]
ZSR webforumsuser@macromedia.com Guest



Reply With Quote

