/    Sign up×
Community /Pin to ProfileBookmark

Open Window from Flash

I have a frames page with a nav bar in it and then the main page. I want to open up a new window in the center of the screen from the nav bar, this page is set to open pages in the main page, which all works fine, however when I enter

on (release) {
getURL(“javascript:newWindow(‘cat_enquiry.asp’)”);
}

in the flash action script I keep getting object expected, but if I run the script from the main page it works find!!

Any help gratefully appreciated

Jack

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Jan 20.2003 — istead of this

on (release) {

getURL("javascript:newWindow('cat_enquiry.asp')");

}
[/quote]


try the following syntax

1. use geturl function and call javascript from flash which will open new window. Like as:

geturl("javascript:openNewWindow('cat_enquiry.asp','thewin',

'height=400,width=400,toolbar=no,scrollbars=yes')")

2. Define function in the JavaScript code area which will open the window.

<script language="JavaScript">

function openNewWindow(URLtoOpen, windowName, windowFeatures) {

newWindow=window.open(URLtoOpen, windowName, windowFeatures); }

</script>

Cheers,

Hope this works

Khalid
Copy linkTweet thisAlerts:
@fugasJan 20.2003 — Hi,

Sorry to interrupt, but I was also looking for an answer to a similar question.

Where do you put the java code? on the html page? on flash?

Thanks a lot.

<script language="JavaScript">

function openNewWindow(URLtoOpen, windowName, windowFeatures) {

newWindow=window.open(URLtoOpen, windowName, windowFeatures); }

</script>

Fugas
Copy linkTweet thisAlerts:
@khalidali63Jan 20.2003 — First of all its not Java,

It is JavaScript, difference of apples and oranges.

:-)

Second the javascript code will go in the HTML page in the head section

within the script tags

Khalid
×

Success!

Help @Jack spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...