Is anyone aware of problems using a localConnection on different browsers and on Mac versus PC? I'm working on a project in which I have two Flash files running on an HTML page and the first file sends a "cookie" to the second file using a localConnection. The complication is that the first file loops a series of secondary Flash movies in and out and when each of those movies switches, it needs to send a new frame number to the second movie. I've been working on this for several weeks and have gone through several versions of the files, some of which work on Firefox/PC, some work on IE/PC, some have occasionally worked on the Mac browsers. Code in the sending file is below. Also below is a link to the HTML page that is holding the two movies.
Not an expect AS programmer, so I won't be insulted by any major critiques of the code. Any help is greatly appreciated! http://www.h2xmultimedia.com/clients/_select/index.html Sending File Code: var frames:Array = new Array("2","62","122","182","242","302"); var clips:Array = new Array("images/bars/bar1.swf", "images/bars/bar2.swf", "images/bars/bar3.swf", "images/bars/bar4.swf", "images/bars/bar1.swf", "images/bars/bar2.swf"); waitDelay = 7.5; //in seconds imageCount = -1; frameCount = -1; onTop = createEmptyMovieClip('holder_1', 1); onBottom = createEmptyMovieClip('holder_2', 2); onTop._alpha = 100; onBottom._alpha = 0; holder_1._lockroot = true; holder_2._lockroot = true; loadNextImage = function () { onBottom.loadMovie(clips[imageCount=(imageCount+1)%clips.length]); //send the next frame number - WORKS PERFECTLY IN TESTING ENVIRONMENT BUT NOT IN BROWSERS function sendFrameNumber(bnum){ outgoing_lc = new LocalConnection(); outgoing_lc.send("lc_test", "testme", bnum); delete outgoing_lc; } sendFrameNumber(frames[frameCount=(frameCount+1)%frames.length]); //fade the images onEnterFrame = function() { if (onBottom._width>0) { crossFade(onTop,onBottom); onEnterFrame = null; } } } waitTime = function (seconds) { waitId = setInterval(function() { loadNextImage();clearInterval(waitId);}, seconds*1000); }; loadNextImage(); function crossFade(clip1,clip2) { cross = function (clip1, clip2) { clip1._alpha -= 5; clip2._alpha += 5; if (clip2._alpha >= 100) { temp = onTop; onTop = onBottom; onBottom = temp; clip1.swapDepths(clip2); waitTime(waitDelay); clearInterval(fadeId); } updateAfterEvent(); }; fadeId = setInterval(cross, 2, clip1, clip2); } _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com