PDA

View Full Version : Flash buttons not working in IE/Dreamweaver .Why?


drew
12-20-2005, 12:56 PM
Hi

I wonder if anyone can help me. Ive made a picture gallery web page in dreamweaver and created some buttons/ icons in flash 8 but when i open the page in Internet Explorer the buttons dont respond to clicking. Ive added a hide/unhide behavior to them so when clicked you should see a bigger pic to the left.Ive tried several ways to resolve this but none worked. If i replace the flash icons with jpegs it works again. id rather have the animated icons as i spent a long time doing them.

I also made some transparent animated icons for the navigation but the same thing happens again so you couldnt even navigate. so i temperarly replaced them with gifs. The page works perfectly in in opera.Is there anything i can do?. Ive seen flash buttons working so why dont mine work?

You can see what happens in IE at www.andrewlinton.com ('http://www.andrewlinton.com') and use the temp nav bar at the top. Then go to the 3d page. So far the only icons connected are the top right and bottom left.

Can anyone help?

Thanks in advance

davidj
12-20-2005, 02:05 PM
you have to call the javascript hide/unhide behavior MM_showHideLayers() function within flash actionscript

click the button within flash and press F9 (actionscript editor launches)

add..

on (Release){
getURL('javascript:MM_showHideLayers(arg,arg,arg,a rg)')
}

arg = MM_showHideLayers arguments

drew
12-20-2005, 07:05 PM
davidj thanks for helping,

I dont really know much about javascript but in the part arg,arg, arg etc would i put the location of the layer or would i put the layer name then hide/unhide like in the behavior part in dreamweaver. Could you give me an example of what would go in there?

on (Release){
getURL('javascript:MM_showHideLayers(AmHead04,arg, arg,arg)')
}

Ive put the name of one of the layers but i dont know what else to put.

Many Thanks

drew
12-20-2005, 10:40 PM
Ive looked around the net and had another try on it

on (Release){
getURL('javascript:MM_showHideLayers('AmHead04','' ,'unhide','MarFront','',hide','MarHi','','hide','L iaHeadGI','','hide','LiaGTor','','hide','Lia01','' ,'hide','LiagFace','','hide','AmBod02,'',hide','Am yFront','','hide','AmHead03','','hide')')
};

Im still getting errors on it and it still doesnt work too. Can anyone see whats wrong

Many Thanks

davidj
12-21-2005, 08:48 AM
in your page you need your function between <head> tags


function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}


in your flash select a button then press F9 (actionScript editor launches)
Add the following in ActionScript

on (Release){
getURL('javascript:MM_showHideLayers('Layer1','',' show'))
};


Layer1 is the name of your Layer

drew
12-21-2005, 10:49 AM
Hi,

Ive tried putting in your code but it still doesnt work. I replaced Layer1 with the name of my layer in DW and i tried it as Layer1 too.When i export the button from flash i get errors too. i dont know if this right because in the error it shows all the stuff i written an deleted before in the button.

Il upload the page so you can see where i placed the other code between the head tags. I also removed the show hide behaviors from the buttons in DW seeing as the code has been written into the button in flash.

Unfortunately this doesnt work in IE and now opera too.

Many Thanks

davidj
12-22-2005, 02:31 PM
sorry

this was my fault

it appears that flash dont like arguing (arguments)

try this...

CODE

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}

//add this new function

function callShow(){

MM_showHideLayers('Layer1','','show');

}

new function added above

now in your flash do this

on (Release){
getURL('javascript:callShow());
}