Groups | Blog | Home
all groups > macromedia flash sitedesign > september 2005 >

macromedia flash sitedesign : Javascript Function in Firefox


Chip W.
9/21/2005 6:13:19 PM
Hi,

I'm pretty new to Mozilla and was wondering about this Javascript function I'm
able utilize in I.E. I'm in the process of updating my website to be
cross-browser compatible, the following function does not work in Firefox, and
I was hoping someone could shed some light on "why?" If this topic is
redundant, my apologies.

Initialize the function:

<SCRIPT LANGUAGE=JavaScript>
function doPassVar(args){
var sendText = args.value;
var sendText = "1"
window.document.myFlash.SetVariable("myVar", sendText);
}
</SCRIPT>
Pass the function:

<body bgcolor="#999999" onload="doPassVar(sendText);">

Initialize the Flash object:

<tr>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=6,0,29,0" width="753" height="25" id="myFlash">
<param name="movie" value="../navigation/navBar_03.swf">
<param name="quality" value="high">
<param name="menu" value="false">
<embed src="../navigation/navBar_03.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="753" height="25" name="myFlash"
swLiveConnect="true"></embed></object>
</td>
</tr>


This works like a superstar in Internet Explorer, but not at all in Mozilla
Firefox. I'm sure it doesn't work in Netscape either, but I'm just starting to
tackle all this. Any help, direction, or links would be fab, not really sure
where to start with this.

Thanks,
~Chipley

posted.by(Vern);
9/21/2005 8:13:37 PM
I am not real good at this, but I just went through a crash course in
passing variables from HTML into a flash movie. I have seen the code you
are trying to use and I couldn't get it to work. I did however find a
solution. You have to pass the variables though from within the <OBJECT>
and <EMBED> tags.

Here is the tute I found that solved my problems. BUT ... the text itself
leaves out the js code needed to parse the query string. So download the
sample files and deconstruct them. I have it working perfectly now in all
PC browsers.

http://www.noscope.com/journal/2003/12/query_string

HTH

--
--
Regards,
--Vern
===========================
onClipEvent(doSomethingStupid){
setProperty("Face", color, #FF0000);
_root.audio = "uh oh!";
}

posted.by(Vern);
9/21/2005 10:13:03 PM
You can check the site I am building for a client if you like. I am using
this to reposition an underline on a Flash menu after each click. The site
is not all flash, just the menu and selected other parts. So each time a
new page is clicked, the menu, and its sliding underline reload and start
back at the beginning. What I needed to happen, is for the underline to
slide over to the current page. So I learned from this tute how to pass the
variable through the URL, capture and parse them in JS, then use JS to write
the <EMBED> and OBJECT> tags to include the new variables as it reloads the
same Flash navbar. Works great!

www.pc-grafix.com/Bretzlaw



--
--
Regards,
--Vern
===========================
onClipEvent(doSomethingStupid){
setProperty("Face", color, #FF0000);
_root.audio = "uh oh!";
}

posted.by(Vern);
9/21/2005 10:13:47 PM
messed that up. sorry.

www.pc-grafix.com/BretzLaw

--
--
Regards,
--Vern
===========================
onClipEvent(doSomethingStupid){
setProperty("Face", color, #FF0000);
_root.audio = "uh oh!";
}

Chip W.
9/22/2005 12:00:00 AM
Vern,

Thanks so very much, I'll be checking out the link and deconstructing all day tomorrow. I'll post back here with my results. That definitely helps.

Hail to vern...
posted.by(Vern);
9/22/2005 1:46:46 PM
Yep. I wish I would have remembered to tell you that, about the ; showing up
in the HTML. Sorry. I am sure you found the same thing. I just eliminated
the offending ; and it works fine in all browsers.

Glad I could help!

Have a great day!

--
--
Regards,
--Vern
===========================
onClipEvent(doSomethingStupid){
setProperty("Face", color, #FF0000);
_root.audio = "uh oh!";
}

Chip W.
9/22/2005 6:20:29 PM
Hey Vern,

Thanks for all the info. Your link to the source code worked like a charm for
me. I took the script and converted it into an external .js file after
deconstructing, I'm now in the process of applying that technique to my whole
site. there were a few things I did notice that aren't compatible in
Mozilla(like I said in my first thread, i'm new to Firefox). In the assemble
flash object, Mozilla ignores the continuation (;) at the end of each line in
the Javascript, that punctualtion was showing up on my page before I deleted
them:

// assemble flash obj
var l1 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=6,0,29,0" width="'+width+'" height="'+height+'">;'
var l2 = '<param name="movie" value="'+src+queries+'" />;'
var l3 = '<param name="quality" value="high" />;'
var l4 = '<embed src="'+src+queries+'" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="'+width+'"
height="'+height+'"></embed>;'
var l5 = '</object>'

I checked out your site and it looks like you found that too. Anyway, thanks a
million. Problem solved.

Kind regards,
~Chipley
AddThis Social Bookmark Button