Forum Moderators: open

Message Too Old, No Replies

any idea why this doesn't work on a mac?

         

ch1mp

5:12 pm on May 5, 2010 (gmt 0)

10+ Year Member



hey all,

this little API to go with a flash movie doesn't work on a mac, windows is fine as onComplete gets called successfully, but the mac just won't have it...

function Peeler(myName)
{
var _ref = myName;
var backgroundColour = null;
var flipSideColour = null;
var contentWidth = null;
var contentHeight = null;
var contentPath = null;
var contentX = null;
var contentY = null;
var contentURL = null;
this.onComplete = null;

this.setColours = function (bgCol,flipCol)
{
backgroundColour = bgCol;
flipSideColour = flipCol;
}

this.setContentDims = function (w,h)
{
contentWidth = w;
contentHeight = h;
}

this.setContentPos = function (x,y)
{
contentX = x;
contentY = y;
}

this.setContentPath = function (path)
{
contentPath = path;
}

this.setContentClickThrough = function (clickThrough)
{
contentURL = clickThrough;
}

this.embedPeel = function (targetDIV,pathToSWF)
{
var flashvars = {};
flashvars._backgroundColour = backgroundColour;
flashvars._flipSideColour = flipSideColour;
flashvars._contentWidth = contentWidth;
flashvars._contentHeight = contentHeight;
flashvars._contentPath = contentPath;
flashvars._contentX = contentX;
flashvars._contentY = contentY;
flashvars._contentURL = contentURL;
flashvars._ref = _ref;
var params = {};
params.wmode = "transparent";
params.allowscriptaccess = "always";
var attributes = {};
swfobject.embedSWF(pathToSWF, targetDIV, "100%", "100%", "8.0.0", false, flashvars, params, attributes);
}
}


the on complete function is set like this...


var peel = new Peeler("peel");
peel.onComplete = peelDone;


anyone see why onComplete won't fire on a mac?

thanks in advance,

tom.

Fotiman

5:19 pm on May 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't see anything that calls the onComplete function, so I can't see why this would work on ANY platform.

ch1mp

5:23 pm on May 5, 2010 (gmt 0)

10+ Year Member



it gets called from a flash movie and works in chrome, FF and IE on windows with no worries.

might it be something to do with scope being handled differently on a mac? any case where...


peel.onComplete();


...wouldn't call peelDone?

Fotiman

5:33 pm on May 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well, from the code you provided I don't see a peelDone function either. It does, however, sound like this could be a scope issue. Unfortunately, I don't have a lot of experience with Flash-to-JavaScript execution, or with mac's, so I can only speculate.

Perhaps you could try something like this as a test:


this.onComplete = function () {
alert('onComplete executed');
};


(and remove peel.onComplete = peelDone;, just for testing purposes).

whoisgregg

8:14 pm on May 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does it work on any Mac browser? It's pretty odd for something to work on all browsers for one OS and no browsers for a different OS.

Makes me suspect it's a Flash problem, as all the browsers use the same plug-in.