Click here to Skip to main content
15,923,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Y'all,
In an HTML page I am accessing jquery.scrollTo plug-in with an embedded flash.swf file that contains 3 buttons using AS3 ExternalInterface.call("yourFunction"). It works great in just about every browser except IE8 (have not tested in IE6 or 7) which produces an error in the lower left corner of its browser window "Error on page." and no cool scrolling effect – Bummer Dude! The only thing I came across that seemed moderately helpful was to give the embed code an "id" attribute but I am not sure how to even do that.

Please Help Me!!!:confused:

Link:

http://totallytotallyamazing.com[^]

3 JS functions in html HEAD:
function scrollToAbout(){
$(window).scrollTo( {top:'2073px', left:'0px'}, 800 );
}
function scrollToPortfolio(){
$(window).scrollTo( {top:'0px', left:'0px'}, 800 );
}
function scrollToContact(){
$(window).scrollTo( {top:'2779px', left:'0px'}, 800 );
}



Accessing these jquery libraries:

jquery.js
jquery.scrollTo-min.js


The AS3 code from the Flash AS3 buttons:

import flash.external.ExternalInterface;

about.buttonMode = true;
about.mouseChildren = false;
about.addEventListener(MouseEvent.MOUSE_OVER, aboutOver);
about.addEventListener(MouseEvent.MOUSE_OUT, aboutOut);
about.addEventListener(MouseEvent.CLICK, aboutClickHandler);

function aboutOver(event:MouseEvent)
{
	about.gotoAndPlay("overAbout");
};

function aboutOut(event:MouseEvent)
{
	about.gotoAndPlay("outAbout");
};

function aboutClickHandler(event:MouseEvent):void
{
	ExternalInterface.call("scrollToAbout");
};


portfolio.buttonMode = true;
portfolio.mouseChildren = false;
portfolio.addEventListener(MouseEvent.MOUSE_OVER, portfolioOver);
portfolio.addEventListener(MouseEvent.MOUSE_OUT, portfolioOut);
portfolio.addEventListener(MouseEvent.CLICK, portfolioClickHandler);

function portfolioOver(event:MouseEvent)
{
	portfolio.gotoAndPlay("overPortfolio");
};

function portfolioOut(event:MouseEvent)
{
	portfolio.gotoAndPlay("outPortfolio");
};

function portfolioClickHandler(event:MouseEvent):void
{
	ExternalInterface.call("scrollToPortfolio");
};


contact.buttonMode = true;
contact.mouseChildren = false;
contact.addEventListener(MouseEvent.MOUSE_OVER, contactOver);
contact.addEventListener(MouseEvent.MOUSE_OUT, contactOut);
contact.addEventListener(MouseEvent.CLICK, contactClickHandler);

function contactOver(event:MouseEvent)
{
	contact.gotoAndPlay("overContact");
};

function contactOut(event:MouseEvent)
{
	contact.gotoAndPlay("outContact");
};

function contactClickHandler(event:MouseEvent):void
{
	ExternalInterface.call("scrollToContact");
};
Posted
Updated 20-Apr-10 9:08am
v2

Richard,
Thank you very much for your answer!!!
Concerning "the IE code for ActiveX control is what you should look at." can you elaborate on a way around IEs ActiveX control?

I have used swfObject on other flash projects before but do you know if it supports wmode="transparent" or is that just an ignorant question?

Thanks again,
Derek :)
 
Share this answer
 
Hi Richard,

This worked Thank You Again!!!

To some it up: replacing the embed JS code AC_RunActiveContent.js with swfobject.js eliminated the ActiveX error "Error on page." I was encountering with IE.

Of course this change opened another can of worms. The CSS that I had applied to the flash div container no longer worked e.g. position:"fixed" etc. To get around this problem I found a post by Vincent Polite on Google groups and followed his advice. Here it is and I quote:

"When the SWFObject is actually embedded it does replace the div named in
your code, and the css associated with that DOM node disappears.

The recommended approach to deal with this is to create a container div
around your SWFObject div and apply the styles there. Presuming you have
control over the naming convention and the css file, this shouldn't be hard
to resolve."

totallytotallyamazing
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900