| Ultrashock Forums
• AS - Popups From Flash - Solution |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
| <12 | Page 2 of 2 |
|
2008-06-27
#41 |
||
|
Getting Safari to work with Popups
It's pretty dirty, but not as dirty as I remember. I did have to change Nutrox's popup.js file. And this javascript no longer returns whether it was successful or not; I should probably fix this. But I have attached the zip file. For an explanation, see my previous post and let me know if you have any questions. I found the browser detection script online. The credits are in the file. PopUpEx.zip |
|
|
2008-07-25
#42 |
||
|
Hi, Can I ask what is the deal with safrai and opening a new window, popup or anything? I am a newbie at flash, but I can't seem to get anything to work in safrai. I tried both the zip examples here, both work with Camino(1.6) and FireFox(3.1) but no love on Safrai(3.12) I am on mac. Could anybody offer and coding help to resolve this issue for be. I am currently using AS 2 as I am about to get flash CS 3 in about a month. |
|
|
2008-07-25
#43 |
||
|
My and Nutrox's examples are both done in as3. If your decent at programming, you could probably go through the code and modify it for as2. But my hack is a big hack for safari and not as cleanly written as nutrox's, but good luck.
|
|
|
2008-09-16
#44 |
||
|
Last edited by avnik : 2008-09-16 at 02:27.
I tried Nutrox's popup blocker bypass through flash but it only works in Firefox it still is not able to bypass the IE7 popup blocker. Even in the demo its not working. Also is there any way this could be done in flash 8 instead of flash CS3. I searched all over the internet for opening a browser window through flash and not getting blocked by the popup blocker on IE7 but my every attempt failed. The solution by Nutrox seemed to be most promising but its still not working for me. Am i doing something wrong. Or do the securities for IE7 popup blocker makes any difference. Can someone help? Thanks in advance.
|
|
|
2008-10-29
#45 |
||
|
Hi Nutrox, I need some help with one of the three buttons on the form to auto fire (autoclick) when the page is loaded. I tried to do it with method onLoad() { sampleButtonB.Click(); } but i got some errors. So basically when your page with the three buttons shows up, i want immediately the Google page popup to show up as well. Thanks in advance. |
|
17 Creative Assets
|
2008-10-29
#46 |
||
|
You should not (and in most situations cannot) open windows with "auto-clicks" any more, it is an intrusive and impolite thing to do. Modern browsers are designed to only open new windows during "real" user interaction.
|
|
|
2008-10-30
#47 |
||
|
Thanks Nutrox.
|
|
|
2008-12-14
#48 |
||
|
Hi is there a way of getting this working in flash mx 6 i cant even open your flash file from the zip downloaded. I am using geturl in my flash code.
|
|
|
2008-12-14
#49 |
||
|
talk about legacy code. why do you need it for flash 6? are you adding to an old project? the short answer is no there is no easy way to get this to work in mx. you'll have to go through the code and determine what will work or what is equivalent in mx
|
|
|
2008-12-14
#50 |
||
|
reason 1 - i have flash mx and have been using it for years not for anything complicated just to make images move and a a bit on navigation. reason 2 - i know very little of the scripting in flash. Have been using html, php, mysql for a couple of years and not had time to expand my flash coding, so converting yours to make mine work would be hard. reason 3 - i dont have a newer version of flash. reason 4 - you might just have known the way to get it working saving me money and time. So will have to get a newer version of flash. thanks. |
|
|
2008-12-22
#51 |
||
|
Thanks Nutrox for shedding some light on this subject. I've had a heck of a time finding any info on it. Is there a way I can open up one of these popup windows and also send variables to it? I'm currently using: Code:
checkout_button.onRelease = function (): Void {
LoadVars.send = ("https://www.paypal.com/cgi-bin/webscr", "_blank", "POST");
}
So my question is if it's possible to send variables to the new window using your popup method? Also, when testing your sample, it worked great when the popup blocker was 'on', but once I chose 'allow popups from this site' it would open 2 Google windows which I suppose is 'ok' but of course not 'ideal'. One last interesting note, when firefox blocks the popup and you choose 'allow popups from this site' the popup message goes away and you can click on the 'checkout' button again and everything is gravy. However with IE when you choose 'allow popups from this site' the site gets reloaded! Which clears the shopping cart... this is VERY troublesome! Again, thanks for the time you've put into this. |
|
|
2008-12-23
#52 |
||
|
Thanks Nutrox! It's working.
|
|
17 Creative Assets
|
2008-12-23
#53 |
||
|
@udaybiz No problem. ![]() @calpolyarc You could send variables but they would have to be sent as a query string, so we're talking GET not POST. |
|
|
2009-02-19
#54 |
||
|
Need a solution for AS2
Sorry mate, there is no AS2 version of the PopupWindow class so you will need to convert it to AS2 yourself or find someone else to do it for you. Apart from posting the odd bit of AS2 code around the forum now and again I don't do AS2 development any more.
![]() So it's like this, if the old cars are not popular and are rotting in your words, why are so many people still riding Hot Rods and Classics. They ain't got automatic window open and close buttons
|
|
|
2009-02-19
#55 |
||
|
Well old cars don't have some of the newfangled contraptions like power windows and locks. You could rig up some little motor that runs on a 9 volt and rolls the window down, but that would just look silly. I'm not exactly sure where I was going with this, but in all honesty, I haven't worked in AS2 in about a year and a half and don't look forward to ever going back. I think I've forgotten everything anyway.
|
|
|
2009-02-19
#56 |
||
|
I hear ya! Honestly, i wouldn't even work in AS2 myself, since I think that AS3 is way cooler and I have been working with it very successfully, but I just got this project for work written in AS2, and pop-up blocker is killing me. Safari sucks big time! I search and search and no one seem to have any answers. Thanks anyways.
|
|
17 Creative Assets
|
2009-02-19
#57 |
||
|
If I remember, and if I don't get sidetracked by personal projects - or by World of Goo - then I will try and tackle an AS2 version for you guys this weekend.
|
|
|
2009-02-19
#58 |
||
|
Yay! Thanks Nutrox you will rule the the World of Action Scripting! Cause honestly this thread offers the only real solution to the pop-up problem and I have been searching the whole day!
|
|
|
2009-04-09
#59 |
||
|
grok - the problem you're likely to be having is more due to the Flash security sandbox than a problem with this method - I daresay that if you made an interface to communicate between loaded SWF files and the parent SWF, and then had the parent SWF launch the window - it would work. Externally loaded movieclips are quite limited in what they can do, so they can't compromise the original Flash file... (or something like that)
I am having the exact same problem as grok mentions above. Is there a way to allow externally loaded swf launch a popup window? Basically, grant full trust to the external swf. |
|
|
2009-04-26
#60 |
||
|
I am using the following script, which i modified after reading this thread. Code:
function openWindow(ur:String, wh:Number, he:Number, sc:Number, re:Number):void {
function openWin1(address, winName, hWindow, wWindow, toolbar, menubar, scrol, resiz, location, directories, status)
{
if (ExternalInterface.available)
{
ExternalInterface.call("window.open", address, winName, 'height=' + hWindow + ', width=' + wWindow +', toolbar=' + toolbar + ', menubar=' + menubar + ', scrollbars=' + scrol + ', resizable=' + resiz + ', location=' + location + ', directories=' + directories + ', status=' + status + ', top=(screen.height/2)+('+hWindow/2+'), left=(screen.width/2)+('+wWindow/2+')');
} else {
}
}
var address = ur;
var winName = "design";
var wWindow = wh;
var hWindow = he;
var toolbar = 0;
var menubar = 0;
var scrollbars = sc;
var resizable = re;
var location = 0;
var directories = 0;
var status = 0;
openWin1(address,winName,wWindow,hWindow,toolbar,menubar,scrollbars,resizable,location,directories,status);
}
Does anyone know why this doesn't work. I had a similar script for as2 and it works perfectly. |
|
|
2009-04-26
#61 |
||
|
@ericscott - if you use stage.stageWidth and stage.stageHeight, those should work for AS3 (versus stage.width and stage.height which are AS2 values).
|
|
|
2009-04-26
#62 |
||
|
Sorry, I meant screen.width and screen.height Java values toward the end of my ExternalInterface.call.
|
|
17 Creative Assets
|
2009-04-26
#63 |
||
|
You can't expect JavaScript to execute that math at the end of the ExternalInterface call line because those parameters are sent as strings. What you are trying to do is something like this: Code:
window.open( "page.htm", "mywin", "left=(x+y)/z,top=(x+y)/z" ); Is there any reason why you are nesting the openWin1() function like that? |
|
|
2009-04-26
#64 |
||
|
Last edited by ericscott : 2009-04-26 at 17:28.
I am nesting the variables because I while I was building this I wanted to keep straight which ones are static, probably pointless, and I just decided to use your class anyway, but I modified the popup.js so I can close the window as well. Code:
var my_window
function openPopupWindow( uri, name, opts )
{
my_window = window.open( uri, name, opts );
if( my_window )
{
if( my_window.focus )
{
my_window.focus();
}
return true;
}
return false;
}
function closePopupWindow()
{
if(false == my_window.closed)
{
my_window.close ();
}
else
{
alert('Window already closed!');
}
}
I will play around with the example you gave me. I will probably have to calculate screen.dimensions before they go into the call function. I used a very similar script to the one I posted in as2. I am missing the days when you could just write the javascript function straight into a get url and everything worked. |
|
|
2009-06-16
#65 |
||
|
Setting wmode = opaque breaks mouse wheel support.
|
|
|
2009-11-05
#66 |
||
|
Just as an update, my crappy hack isn't needed anymore for the new Safari.
|
|
|
2010-02-02
#67 |
||
|
where are the download files ?
|
|
| <12 | Page 2 of 2 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|



17 Creative Assets

Linear Mode