Do you have Popups turned off in your browser? Jeff [quoted text, click to view] "JackCostelloe" <webforumsuser@macromedia.com> wrote in message news:evopt4$dua$1@forums.macromedia.com... > 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. >
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.
[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] "JackCostelloe" <webforumsuser@macromedia.com> wrote in message news:evopt4$dua$1@forums.macromedia.com... > 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. > [/q] Popups are off.
[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"?
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); }
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.
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] > 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. >
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] > http://download.yousendit.com/6F83055A071F44F0 > > This is the html file anyway. Is there anything there thats stopping > the on(release) from working? >
Does ANY script work for you from HTML? Do you have scripting turned off? [quoted text, click to view] "JackCostelloe" <webforumsuser@macromedia.com> wrote in message news:evp2ig$njc$1@forums.macromedia.com... > Thats the thing, whatever I put on the html doesn't seem to work. Does it > work for you if you insert that ^ into the html?
Don't see what you're looking for? Try a search.
|