Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Launching Javascript Window From Attached Movie?



I've been attempting to launch a window from an attached movie, I've got the function to work but after it launches, the main window (with the flash file) relocates automatically with the message "[object Window]"

I'm presently using the following coding with the button's AS:

Code:
getURL("javascript:window.open('http://www.atomicstos.com/popup.html','Nubeau Guarantee', 'toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=500, height=800')");
I've attempted to setup a javascript function in the HTML and have the "getURL" call the function, but that doesn't seem to work. Any help? Thanks



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 07-07-2005, 03:18 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Getting Rid Of The Top Of The Browser Window When Launching A New Window.
hi there,

I have been having trouble getting a flash site to launch a new broswer window for a html document. It worked fine when opening a new flash window but not html.

Anyway someone on here kindly helped me and sent me this code:
getURL("javascript:NewWindow=window.open('http://www.design8ed.com/digitalspirit/pages/designcs.html','newWin','width=459,height=171,left =0,top=0,toolbar=No,location=No,scrollbars=No,stat us=No,resizable=No,fullscreen=No'); NewWindow.focus(); screen_height = window.screen.availHeight; screen_width = window.screen.availWidth; left_point = parseInt(screen_width/2)-(459/2); top_point = parseInt(screen_height/2)-(171/2); setTimeout('NewWindow.moveTo(left_point,top_point) ',100); void(0);");


Which made it work the only thing is it pop up including the browser menu at the top - does anyone know how i can get rid of this?

Also within the html doc - http://www.design8ed.com/digitalspir.../designcs.html i have a close button which when reviewed works but when published it doesn't close the browser window - is there something i'm missing - why isn't it working?


Your help would be greatly appreciated!!!

Launching Pop Up Window
I really need help!!!

I am trying to get a button on the release event to open a pop up window. The window needs to be HTML containing QT movie. So I need the window to have no menu/bars etc.

I've tried various Javascript and NO SUCCESS.

Here is the typical example:
Get URL ("javascript:launchwin('open.html','newwindow','he ight=50,width=300')")
End On

So where am I going wrong?.

I'm not too sure how to imput the commands; in which of the boxes in the actions tab?.

I stuck and it is agony....

Launching A Window
All,

I have a dilemna. I need to know how when you either click on a hyperlink in a html file (using javascript etc.) or if neccesary a hyperlink in a flash file that it will launch a new window containing a .swf file which the viewer can then close.

The second part of the dilemna is I would like to know if it is possible to make this window shaped the way i want it - for example, a rectangle but with curved edges.

Whatever you can suggest would be very helpful. Thank you,

James!!

Launching Pop Up Window
I have just created a small portfolio site for myself which is working fine... in netscape. However in IE the link in the motion section that creates a new window does not.

All that there is a button that launches a new window using a javascript.

This is the script on the actions layer.

_global.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) { getURL("javascript:window.open('"+url+"','"+winNam e+"','"+"width="+w+", height="+h+",toolbar="+toolbar+",location="+locati on+",directories="+directories+", status="+status+",menubar="+menubar+",scrollbars=" +scrollbars+",resizable="+resizable+", top='+((screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"'); void(0);"); };

And on the button

on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "if.html";
target_winName = "ideasfactory";
width = 250;
height = 300;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}

I'm stumped at the moment!! any help?

website is matt.james.uk.net if you want to see what I mean.

Launching A Pop-up Window ?
Hi,

I'm having a hard time figuring this out...

I have a button in my movie that launches a page in a new window.

I need the window to open at 400x200 with no scroll bars, address bar, bookmarks, etc.

Is this possible? Is it done from the flash? Or is it some javascript?

cheers
jen

Launching A New Window
Hi, I have exernal html file in my flash movie. What I want to do is launch a new window to a spacific size from a link in one of my external html files.

How can I go about this?

Launching New Window With Javascript....Help....
I'm trying to open a new, scaled window with one of the many free applets available. I'm trying to do so through a image map, and my link turns out like this:

http://www.myhomepage.com/domain/jav...wwindow...etc.

How can I get it to cut out the http that it sticks in their automatically, and just open the javascript?

here's my site: http://www.geocities.com/cerebrum04/
the flash side is the one i want to open into a sized window, any ideas?

Launching A Centered Pop-Up Window
I used a tutorial by VAZBO (thanks to Vazbo in advance) for Launching a Centered Pop-Up Window...

and it works great except for some reason, when the html pop up window opens up, the artwork is shifted about 1cm down and a cm to the right, cropping the edge of the html.

any clues to why this is happening (i'm pretty sure it has nothing to do with the original script by Vazbo)... pretty urgent request?

http://www.flashkit.com/tutorials/Ac...1027/index.php

Launching A Centered Pop-Up Window
Launching a Centered Pop-Up Window
Hi folks,

I have these clean scripts for launching a Centered popup window, but I cannot get the script to control the window size

here's the button action script:

on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "http://www.johnhintlian.com/portfolio01.htm";
target_winName = "john";
width = 40;
height = 60;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 1;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}

here's the frame action:

_global.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL("java script:window.open('"+url+"','"+winName+"','"+"wid th="+w+",height="+h+",toolbar="+toolbar+",location ="+location+",directories="+directories+",status=" +status+",menubar="+menubar+",scrollbars="+scrollb ars+",resizable="+resizable+",top='+((screen.heigh t/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"');void(0);");
};


It ALMOST works, any idea I can control the size of the popup windows.

here's the site:

http://www.johnhintlian.com/portfolio.html

I'm almost there, pleeeze!

Thanks

John

Launching A New Window (how Embarrassing...)
Hi,

I know this is so basic but I'm in a bind and can't figure this out...

I am using a Flashloaded component (thumbnailer pro). There are three thumbnails, each of which needs to launch a unique URL. It just needs to open in a new window.

I have the following actionscript placed in the correct frame on my timeline:


Code:
var html_array=["http://www.flashloaded.com","http://www.flashkit.com", "http://www.cnn.com"];

tnailer.onThumbRelease=function(mc)
{
getURL(html_array[1,2,3],"_blank");
}



In my html page I am using thhe following javacsript:


Code:
<script language="JavaScript" type="text/JavaScript">
<!--
function mm_openbrwindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

//-->
</script>
I am getting nowhere.... I'm not sure how to customize the script. Nothing I try works.

Error message: The requested URL /new-site/undefined was not found on this server.

Any takers?

Cheers!

Launching A Window And Communicating Between
I am launching a new window using Actionscript and Javascript which i am successfully doing, but what i also want to do is mute the sound in the timeline of the main window (which is triggered using "_root.sSoundStatus='1' or '0'") from the popup window that is being launched and then unmute when the popup is closed, does anybody know if this is possible?

Launching A Popup Window In AS
Hello,

I'm trying to launch a popup window in AS. In order to do that I'm using the following code:


Code:
getURL("javascript:void(window.open('/cswf/getmedia.aspx?id=" + p_mediaId + "','MediaPage','toolbar=no,width=300,height=300,noresize'))");
where p_mediaId is just a number that is passed to the ASPX.

Unfortunately the I.E. popup killer catches this link and prevents the window from opening.

Is there an effective way to solve this problem? How can I launch a popup window that isn't detected by the popup killer?

New Window Not Launching Via Flash In IE
this is strange... is there a reason why this getURL action isnt working in IE (5.2.3). rollovers work fine but the click just doesnt launch the new html with qt movie. works fine in FF and Safari. Please help.
kind regards, Neil

on (release) {
getURL("javascript:dyson=window.open('http://www.neilcoxhill.co.uk/dyson.html','dyson','width=480,height=386,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); dyson.focus(); screen_height = window.screen.availHeight; screen_width = window.screen.availWidth; left_point = parseInt(screen_width/2)-(480/2); top_point = parseInt(screen_height/2)-(386/2); setTimeout(' dyson.moveTo(left_point,top_point)',100); void(0);");
}

SWF File Launching Pop-up Window
I am putting a web site on a CD, using the Flash projector. I have used the tutorial for the Centered Pop-Up Window. Works great! Now I'm having a hard time making it work from the CD. I have searched but haven't found this similar problem.

All html files, images are in folders on the CD (Portlgpages) folder. The code for the window is:

on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "http://www.eddygraphicdesign.com/Portlgpages/ill_08.html";
target_winName = "popup_08";
width = 288;
height = 650;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}

For example, I've changed the address to Portlgpages/ill_08.html but it doesn't work. Any suggestions?

Launching A Centered Pop-Up Window
I would like my centered, pop-up window to open a movie at a specific frame rather than simply at a URL. Can anyone help?

Launching A Centered Pop-up Window
I should have been clearer: I am responding to the tutorial on this topic. The tutorial works beautifully - especially for launching a .swf in a pop up window. However, I am interested in launching a .swf at a specific frame in the movie itself. Can anyone help?

Launching A Centred Pop Up Window
Hello Everyone.

I don't usually post any difficulties/problems that I encouter with Flash as I aways seem to work the issue out...eventually, however this occasion is different.

The tutorial on this wonderful site for "Launching a Centred Pop Up Window" is excellent. I have followed it to the letter to use this functionality on a site that is currently in development:

What I'm attempting to do is launch a centred "customizable" .swf

I have modified the script in the following way:

on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = http("D:\WEB_Projects\WedPopUpTestFile\CallupUR LTest.swf");
target_winName = "";
width = 400;
height = 300;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}


the Java script remains un-changed at:

_global.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL("javascript:window.open('"+url+"','"+winNam e+"','"+"width="+w+",height="+h+",toolbar="+toolba r+",location="+location+",directories="+directorie s+",status="+status+",menubar="+menubar+",scrollba rs="+scrollbars+",resizable="+resizable+",top='+(( screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"');void(0);");
};

Unfortunately this is not producing the required result. I want to open a seperate .swf file [centred and customized] that will control audion on the site.

If someone could be so kind as to point me in the correct direction, i'd be very appreciative.

Many thanks

Handle

Launching A Centered Pop-Up Window
if my website still reside in my local hard disk, what must i put in into the address field? orginally the address is

http://www.kirupa.com/modular/pop-up.htm

but i have not upload my site yet but would like to test the pop up on my local computer first.

Thanks.

Launching A Center Pop-up Window
when previewing in flash on both my version and the tutorial version upon clicking the button read: "the url is invalid and cannot be located"

it would be great if the url were valid and locatable...

Launching A Centre Pop Up Window
Please Help: Regarding Popup Window from Flash button.
Fist of all I would like to thank you for your tutorial in Flashkit.com, very helpful. I've got everything to work fine from my local environment ( C:drive), however, when I post to my Beta site, the popup does not work. Would you kindly show me what the issues might be? I've tried almost everything..and have to resort to your expertise. Here's the code you've provided, and I've tried this code and it works fine on C:, but not when it's live -Thank you in advance.

on (release) { //customize the window that gets opened // 0 equals NO. // 1 equals YES. address = "http://www.kirupa.com/modular/pop-up.htm"; target_winName = "kirupa"; width = 400; height = 300; toolbar = 0; location = 0; directories = 0; status = 0; menubar = 0; scrollbars = 1; resizable = 0; //sends data back to the function openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);}

Launching A New IE Window From Flash
Hey I have an urgent problem with an assignment due tomorrow. I have a flash kiosk inside an internet explorer browser window and there are buttons inside the flash that link to different .html files. I want these files to load in a new window, for HTML it would just be a case of target="_blank" but I have no idea how to do this in flash. At the moment it loads in the current window taking the user away from the kiosk into a new page within the same browser window however I really need it to load in a brand new browser window.

Please help!!!

Re:Launching A Centered Pop-Up Window
hi!

i recently used the kirupa.com tutorial [Launching a Centered Pop-Up Window] to do exactly that... and it worked great (finally), except that it doesn't seem to work in internet explorer. firefox, safari and netscape are all fine. it's so strange, and i can't manage to figure out where the problem lies.

other popups (other flash sites, my own javascript sites) work, but this one is just driving me crazy! it doesn't show up at all.

i used a tutorial for MX, though i have MX 2004.

any suggestions?

thanks so much!

Launching An External .avi In A New Window
hi all,

I've been searching for a way to launch an external movie file (preferably a .avi) from a button inside of flash mx 2004. I am trying to get it so a new window (seperate from the .swf or .exe that the flash is in) pops up and plays the .avi in the user's default player, whatever that may be.

I have tried the fscommand, which works great for launching another .exe, but does nothing for other files. I have also tried getURL, but that just opens a new default browser window.

does anyone have any suggestions? any help would be GREATLY appreciated!

thanks so much,
emily

Launching Window .onload
Hello,
I am trying to create a window launcher that will work with url variable.

I have created a page such as this in javascript but alas, popup blockers will defeat it.
To test it out go to www.ageofeternity.com/magelo/magelo.htm?26510 (make sure allow http1.1 through proxy settings is checked)

As you can see, the page works well if you add that domain to allow pop-ups. I am turning to flash to see if I can't get around the blocker issue (and around the click to activate with swfobject). Does flash allow you to do that since flash is creating the new window?

--------------------------------
Here is whats done so far:

Code:
_root.onLoad = function(launchwindow){
getURL("javascript:launch(http://eq.magelo.com/profile/26510)");
}
When I export the movie, it works locally and pops up a bad url of course there is no javascript:launch(http/etc) on the web. But when I put it on the site with this as the launching page:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Magelo Launcher</title>
<script type="text/javascript">
function launch (page) {
openwin = this.open(page,"Profile",& '#34';location=no,scrollbars=yes,toolbar=no,menubar=no,resizable=no,width='600',height='500',top='20',left='20'")}
</script>
</head>
<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="550" height="400" title="launchflash">
<param name="movie" value="test2.swf" />
<param name="quality" value="high" />
<embed src="test2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="400"></embed>
</object>
</body>
</html>

I am hoping for a solution that many users can use to link on forum signatures to create the authentic look. If you use just URL links, you get toolbars, and other junk in the way that distorts the profile.

Any assistance would be appreciated

Launching A Centered Pop-Up Window HELP
I am very new to FLASH8 and found the tut. mentioned in the subject line. I got it to work just fine as is. I can also get it to work with a bitmap button image.

My question in, how can this same thing work with a transparent button above a bitmap image on the stage as the background?

I am using a Premium Page Flip component by http://www.page-flip.com/

In this component you have swf files within the main swf. In this case the tecnique described in the tut. dosn't work. Can anyone tell me why? is it due to the nested swf? How can I overcome this? See a sample here; http://www.edward-ramos.net/AndrewBoyce/index.htm

Launching A Pop Up Window From Another Pop Up Windows
Is it possible to launch a pop up window from another pop up window?
i have an index page that launch a pop up window with my site on and it is all pictures. if you click on the pics you can actually enlarge 'em and i am doing that with the chromeless tutorial that i got on kirupa but on pc internet explorer 6
instead of opening onthe actual size i want it goes full screen.
thanks a lot for your help
massimo

Launching A Centered Pop-Up Window
I created a Flash based email form that pops up when a button is clicked. I used the centered pop up window tutorial for the email form. Will the window be blocked by users who have pop up blockers installed? It doesn't seem to work with Internet Explorer, but works fine with Mozilla.

-Dave

Launching Borderless Window
I'm trying to do something that is probably simple for most...but for some reason I just can't get it done.

I'd like to open a borderless window in flash but can't seem to find a way to control the window size or borders in the new window.

I've tried using some of the javascript from Flash 5 (tutorials located on this site) but haven't had any luck.


Anyone have any suggestions?


Thanks,
Christian Williams

SWF File Launching Pop-up Window
I am putting a web site on a CD, using the Flash projector. I have used the tutorial for the Centered Pop-Up Window. Works great! Now I'm having a hard time making it work from the CD. I have searched but haven't found this similar problem.

All html files, images are in folders on the CD (Portlgpages) folder. The code for the window is:

on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "http://www.eddygraphicdesign.com/Portlgpages/ill_08.html";
target_winName = "popup_08";
width = 288;
height = 650;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}

For example, I've changed the address to Portlgpages/ill_08.html but it doesn't work. Any suggestions?

Launching A Centered Pop-Up Window
I would like my centered, pop-up window to open a movie at a specific frame rather than simply at a URL. Can anyone help?

Launching A Centered Pop-up Window
I should have been clearer: I am responding to the tutorial on this topic. The tutorial works beautifully - especially for launching a .swf in a pop up window. However, I am interested in launching a .swf at a specific frame in the movie itself. Can anyone help?

Launching A Centred Pop Up Window
Hello Everyone.

I don't usually post any difficulties/problems that I encouter with Flash as I aways seem to work the issue out...eventually, however this occasion is different.

The tutorial on this wonderful site for "Launching a Centred Pop Up Window" is excellent. I have followed it to the letter to use this functionality on a site that is currently in development:

What I'm attempting to do is launch a centred "customizable" .swf

I have modified the script in the following way:

on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = http("D:\WEB_Projects\WedPopUpTestFile\CallupUR LTest.swf");
target_winName = "";
width = 400;
height = 300;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}


the Java script remains un-changed at:

_global.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL("javascript:window.open('"+url+"','"+winNam e+"','"+"width="+w+",height="+h+",toolbar="+toolba r+",location="+location+",directories="+directorie s+",status="+status+",menubar="+menubar+",scrollba rs="+scrollbars+",resizable="+resizable+",top='+(( screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"');void(0);");
};

Unfortunately this is not producing the required result. I want to open a seperate .swf file [centred and customized] that will control audion on the site.

If someone could be so kind as to point me in the correct direction, i'd be very appreciative.

Many thanks

Handle

Launching A Centered Pop-Up Window
if my website still reside in my local hard disk, what must i put in into the address field? orginally the address is

http://www.kirupa.com/modular/pop-up.htm

but i have not upload my site yet but would like to test the pop up on my local computer first.

Thanks.

Launching A Center Pop-up Window
when previewing in flash on both my version and the tutorial version upon clicking the button read: "the url is invalid and cannot be located"

it would be great if the url were valid and locatable...

Launching A Boarderless Window
I seem to be having a few problems with opening a boarderless window out of flash. I followed the tutorial completely but it still does not seem to want to launch. Basically what i have is a HTML page with a SWF menu imbedded into it. When you click on my resume button i want it to launch it in a boarderless window. I placed all of the Javascript into the head tag of both the index page and the resume page and I put this script on to my flash button:

on(release){
getURL("Resume.html","_blank");
javascript:openIT('Resume.html',733,850,null,null, 'newwindow');
}

Is this correct or am i setting it up wrong, to get a better idea of what I'm talking about visit my site www.bcrabtree.freeservers.com

Thank you

Launching A Popup Window From Flash
Does anyone know a way of launching a popup window with no browser bar and set to a particular size from within Flash?

Cheers.

Launching A New Window With Specific Size
hi all,

does anybody know how to assign a javascript in flash so that when a button is clicked, a new browser window is opened with a specific size? i am able to assign the appropriate javascript to launch the new browser window but not controlling its size.

thanks a lot for your help!

Launching A Brower Window From Flash
Hi guys.

How do i lauch a Browers window from within flash? I need the window to be a certain size, no boarder or menu etc

Can anyone point me in the right direction.

Cheers

Launching Applications On Top Of Flash Window
I am creating an information cd about a company. I have a few buttons that open pdf's and a couple that launch 2 applications. Powerpoint viewer and a driver install.

When I click on the button to launch pptview.exe that works fine, the pop up security box comes up asking if I want to run that program. But say I clicked on one of the pdf buttons first that opens up a new window displayin the pdf. If the person does not close out that new window and clicks ont he pptview.exe button the box that pops up to ask if you want to run that program is now behind my flash projector. Is there a way to ensure that when I launch that pptview.exe it will always launch on top of everything so that it isn't hidden behind any window. This problem also happens with the button to launch the driver install.

I use Flash MX 2004
and the actionscript I am using on the pptview button is.

on (release) {
getURL("Slideshow/pptview.exe");
}


I have tried using the fscommand but failed to get it working. my projector file is in the root folder and from there I created a folder named "fscommand" and within that folder I placed pptview.exe and used the actionscript

on (release) {
fscommand("exec","pptview.exe");
}

the button doesn't do anything. My ideal solution would be have the powerpoint file open automatically in powerpoint viewer but I can not get that to work. I tried using ftoolapp.exe and that comes with example flash projects using the program to show what you can do and how to do it and those don't even work.

I am desperate and looking for any solution. Even just fixing the problem to ensure that launching applications will be on top of all windows will be acceptable. If anyone can help please respond.


Thank You.
shane

Launching Browser Window On Top Of Flash
I've created a combobox to launch .pdf's in an external browser window, but was wondering if there's a way to get the browser to launch "on top" of the Flash movie......As it is now, the movie partially covers the .pdf.

Any ideas?

Error Launching New Window Through Flash
I am attempting to open a new window from a flash movie using javascript currently the code on the html page is:

<SCRIPT language=JavaScript>
var newwin;
function launchwin(winurl,winname,winfeatures)
{
//This launches a new window
newwin = window.open(winurl,winname,winfeatures);
}
</SCRIPT>


The code on my flash button is:

on (rollOver) {
gotoAndPlay(2);

}
on (rollOut, dragOut) {
gotoAndPlay('go');
}
on(release) {
GetURL ("javascript:launchwin('http://www.guildleviathan.org/forums/' , 'newwindow' , 'scrollbars=1')")

}


I am trying to add the ability to make the page resize, however when I add the snipit to the flash button it will scroll but not resize:

on (rollOver) {
gotoAndPlay(2);

}
on (rollOut, dragOut) {
gotoAndPlay('go');
}
on(release) {
GetURL ("javascript:launchwin('http://www.guildleviathan.org/forums/' , 'newwindow' , 'scrollbars=1' , 'resizable=1')")

}



im out of ideas...

Tutorial For Launching A Centered Pop-Up Window
Launching a Centered Pop-Up Window

Displaying a Centered Pop-Up Window:

1.Create a new movie by going to File | New. Set the width and height of your movie to anything you choose.

2.Draw a circle that will act as your button. Once you have drawn your circle, select it and press F8 (Insert | Convert to Symbol). The Convert to Symbol dialog box will appear. Select Button and press OK.

3.Now that the circle is a button, it is time to add some actions. Right click on the button and select Actions. The Actions dialog box will appear. Copy and paste the following code:




PHP Code:



on (release) {
    //customize the window that gets opened
    // 0 equals NO.
    // 1 equals YES.
    address = "http://www.actionscript.org"
    target_winName = "kirupa";
    width = 400;
    height = 300;
    toolbar = 0;
    location = 0;
    directories = 0;
    status = 0;
    menubar = 0;
    scrollbars = 1;
    resizable = 0;
    //sends data back to the function
    openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);





5.The last step involves adding some more actions. Insert another layer on your timeline and name it "actions". Right click on the keyframe on the "actions" layer and select Actions. Copy and paste the following code into the Actions dialog box that appears:




PHP Code:



_global.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
        getURL("javascript:window.open('"+url+"','"+winName+"','"+"width="+w+",height="+h+",toolbar="+toolbar+",location="+location+",directories="+directories+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable+",top='+((screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"');void(0);");
}; 




6.Save the animation and preview it in your browser. You will notice that the window appears perfectly centered.



Customizing the Window
Unless you want your pop-up window to display updates from the kirupa.com site, you probably want to modify the window size, content it loads, and the window's attributes such as toolbars, etc. The following information should help you to customize the window.

Right click on your button and select Actions. You will see in the first few lines, that I mentioned the property and its value. To change the URL of the page that gets opened, simply change the text in quotation marks after the word "address". To enable a property that is disabled like displaying the status bar, find the line that says "status =" and change the 0 to a 1. Simple as that. I will explain what each variable stands for in the real world:

address
The address is the path to the page you want to have opened in the pop-up window.


target_winName
This is the name of the window that will be opened. If you are familiar with frames, you will know that each frame-page has a name attached to it. When you link, you specify the name of that frame to load a page into.

This tag works very similar for the pop-up window. If you want anything to be loaded into the window, you would target the window name you specify. You don't have to worry about this tag unless you are familiar with HTML. Just enter a word and move on!


width
Here is where you would specify the width of the window that appears.


height
Here is where you would specify the height of the window that appears.


toolbar
Specifies whether you want the pop-up window to display the browser's toolbar with the back/forward buttons.


location
Specifies whether you want the address bar to be displayed in your browser.


directories
Specifies whether you want other toolbars installed by the user in their browser such as a Google toolbar or a Links toolbar to displayed when a page is opened.


status
Specifies whether you want the status bar toward the bottom of the window to be displayed.


menubar
Specifies whether you want the menu bar with the File, Edit, View Tools, etc. commands to be visible near the top of the browser.


scrollbars
Specifies whether you want the scrollbars to be displayed in the window. If the content exceeds the size of the window, I highly recommend you enable the use of scrollbars. If the content snugly fits within the window, you may disable the scrollbars feature if you would like!


resizable
Specifies whether the use will be able to resize the window by dragging the edges of the window.




As always, I have provided the source code for you to compare your version with that of mine. Make sure you have WinZip installed on your computer.

Launching A Page In The Parent Window
Hello all. I'm not necessarily new to flash, but i've never gotten into the meat of what the program can do and now have run out of my limited bit of knowledge.

I have an animation of have created as a splash intro to the site. Ive gone through been able to place the swf into my page and have even been able to have the animation launch the main page of the site when it is done playing. My problem is that every time it launches the main page of the site it does so in a new window (or a new tab if in Firefox). I am using the geturl function as thats the only one I know about to do what I'm trying to do. When telling it to geturl I have tried putting in it parent for the window but it still is not working.

Would anyone be able to tell me what i'm doing wrong, or point me in the right direction if there is something different i should be doing? Any help would be greatly appreciated. Thanks!

Launching A FULL Screen Window?
is it possible to launch a full screen window in flash? if so, what's the code i have to add to the button?

thanks!

Launching Popup Window Through Frames?
Hey all,

I've just been working with the "Launch a centered popup window" tutorial and it works great with just one small hitch - the website I am working on has several domain names and some of these are using a frames redirect to point to the actual site. When I try to access the site from these domain names the popup link does nothing. I've tried putting both "thefile.html" and "http://www.thedomain.co.uk/thefile.html" in the AS code but neither will work...can anyone help me with a better way of doing this?

Thanks in advance,

Emvee

Launching A Centered Pop-Up Window Problem
hey there.

I am using the kirupa.com technique for popping windows from flash. Works great!!

One thing happens sometimes though and I can't figure it out. the flash inside the popped windows is sometimes offset abotu 20 pxls x and y, so it's shifted right and down off-centre, cropping the bottom right part of the flash movie.

Any idea why this is happening? I am at a loss! thanks for any help

Stevie Spin

Launching A Centered Pop-Up Window Im MX 2004?
what do I need to do to make a centered cop-up window in falsh mx 2004, the tut. by kirupa only seems to be working in flash mx...

[flashMX] Launching A Centered Pop-Up Window
I came across your extremely helpful site last week and it help me with launching an external pop up window in the center of the page. Everything worked beautifully until today. For some reason, i uploaded a new file to my ftp and three out of the four pop up window buttons don't work. It says that the URL is not vaild...this only doesn't work in Internet Explorer but works very well in Firefox and Safari.

Do you know what the problem is? The site is www.zerotolerancehiphop.ca (you will notice on the main page, the "lastest works" section the last button works but the first three don't.)

Launching A Centered Pop-Up Window........Plz Help Really Urgent
Hi,
All

I am making a demo cd presentation in flash 8 that has to be run on a pc . Now the problem i have to call a customized popup window from a flash file . I had a look on this

http://www.kirupa.com/developer/mx/centered_popup.htm

This is working fine when i uploaded on server and tested it .

But the problem is this when i write my flash files with .exe on the cd . It giving me the error cannot find the file...

Is there any other way .....

----------------------------------------------------------

Second option is that i call the swf file that will get open in a new swf file . As the swf file will open in a new window

I cant find script for that also....

Copyright © 2005-08 www.BigResource.com, All rights reserved