Groups | Blog | Home
all groups > flash actionscript > january 2006 >

flash actionscript : Javascript in Flash


SympliG0th
1/25/2006 11:54:18 PM
I have gotten these errors in many different forms depending on how i've tried
to code it, but I cannot get it to accept my coding.

**Error** Symbol=content_mc, layer=Layer 1, frame=1:Line 3: ')' or ',' expected
'height=400','width=400','toolbar=no','scrollbars=yes')}

**Error** Symbol=content_mc, layer=Layer 1, frame=1:Line 1: Statement block
must be terminated by '}'
on (release) {

This is the coding as placed into flash mx:
on (release) {
getURL(javascript:openNewWindow('http://www.macromedia.com','thewin',
'height=400','width=400','toolbar=no','scrollbars=yes')}

Any suggestions?
I have placed the information in the html file as needed but flash wont
recognize.

SympliG0th
1/26/2006 12:00:00 AM
now i'm getting this:

**Error** Symbol=content_mc, layer=Layer 2, frame=10:Line 2: ')' or ',' expected
bsidemedia
1/26/2006 1:39:48 AM
Placing the function in the page has worked for me in the past.

Page:
<script type="text/javascript" language="javascript">
<!--
function popWin( url ) {
window.open( url, "newWin" );
}
// -->
</script>

Actionscript:
getURL( "javascript:popWin( '" + url + "' )" )

The AS did get a little tricky when placing the single quotes and double
quotes. The reason I don't space them out here for readability is that spaces
brake the code. Hope this helps.
zensoldier
1/26/2006 10:47:11 PM
IF you put the function of the htm page

function openNewWindow(tmpUrl)
{
window.open(tmpUrl, null,
'height=400','width=400','toolbar=no','scrollbars=yes')
}

Then in flash call

getURL("javascript:openNewWindow('http://www.LadyAya.com/GalImg1.htm')");

then it shoud work
SympliG0th
1/28/2006 12:00:00 AM
zensoldier
1/30/2006 5:19:19 PM
AddThis Social Bookmark Button