Groups | Blog | Home
all groups > flash (macromedia) > april 2007 >

flash (macromedia) : Please help


Jeff Dillon
4/13/2007 2:24:34 PM
Do you have Popups turned off in your browser?

Jeff

[quoted text, click to view]

JackCostelloe
4/13/2007 8:41:08 PM
I'm trying to assign a javascript url to an on(release) function, like this:

on (release) {

getURL("javascript:NewWindow=window.open('http://www.google.com/','newWin','widt
h=1024,height=700,left=0,top=0,toolbar=Yes,location=Yes,scrollbars=Yes,status=Ye
s,resizable=Yes,fullscreen=No');NewWindow.focus();void(0);");
}

The thing is, it works when I load the swf file inside the Flash environment.
However, if I load an external html file with the swf embedded into it, the
button doesn't work. Why is this happening? Thanks.
dxhans5
4/13/2007 9:40:23 PM
JackCostelloe
4/13/2007 9:50:20 PM
[q][i]Originally posted by: [b][b]Newsgroup User[/b][/b][/i]
Do you have Popups turned off in your browser?

Jeff

[quoted text, click to view]


[/q]

Popups are off.

JackCostelloe
4/13/2007 9:51:08 PM
JackCostelloe
4/13/2007 9:53:23 PM
ogre11
4/13/2007 9:54:24 PM
JackCostelloe
4/13/2007 9:57:01 PM
[q][i]Originally posted by: [b][b]ogre11[/b][/b][/i]
internet explorer completely ignores javascript calls using getURL from
embeded swfs, use ExternalInterface to call a javascript function in the
page.[/q]

It doesn't work in Firefox either. How would I do it using "ExternalInterface"?
ogre11
4/13/2007 10:04:12 PM
import flash.external.*;

var greeting:String;
var btn:MovieClip = createButton(100, 30, 0xCCCCCC);
btn.onPress = function() {
greeting = String(ExternalInterface.call("sayHello", "browser"));
this.mcTxt.text = greeting; // >> Hi Flash.
}

this is the example adobe uses in the flash help files for the
ExternalInterface class. essentially just use

ExternalInterface.call("javaScriptFuncName", "argument,argument,argument");

and create a javascript function in the html of the same name that takes the
same amount of arguments

function javascriptFunc(arg1, arg2, arg3)
{
alert(arg1 + arg2 + arg3);
}
JackCostelloe
4/13/2007 10:12:04 PM
The thing I'm having trouble with is, whatever code I enter in the html of the
page, it is the same result - I click the button and absolutely nothing
happens. But for the same swf's which I load in Flash, they work fine. I've
looked at loads of tutorials and example files of what I'm trying to do and all
of them seem to work perfectly fine in both IE and Firefox. I'm absolutely
baffled.

If I upload my files would anyone have a look? I would be extremely grateful.
Maybe its just a case of a small error somewhere in the html.
jesse harding
4/13/2007 10:39:56 PM
Hello JackCostelloe,

The easiest way to do this is to put your javascript function in the <head>
tag of the html page where the Flash will reside. Then just use getURL to
call that function. I can send you an example if you want, just tell me where
to send it.

Jesse H.
Adobe Community Expert
My site: http://www.jharding.com
Free Blog Radio: http://www.tornadostream.com

[quoted text, click to view]

JackCostelloe
4/13/2007 10:47:27 PM
jesse harding
4/13/2007 10:59:58 PM
This way will work:

Within the <head></head> tags in the html file where the Flash will reside
put the following:

<script>
var newwindow;
function popupwindow(url)
{
newwindow=window.open(url,'name','height=700,width=600');
}
</script>

Then on your Flash button:

on(release) {
getURL("javascript:popupwindow('whateverpage.html');")
}




Jesse H.
Adobe Community Expert
My site: http://www.jharding.com
Free Blog Radio: http://www.tornadostream.com

[quoted text, click to view]

JackCostelloe
4/13/2007 11:09:04 PM
Jeff Dillon
4/16/2007 9:21:08 AM
Does ANY script work for you from HTML? Do you have scripting turned off?

[quoted text, click to view]

AddThis Social Bookmark Button