Archive

Archive for February, 2008

Daylife widget

February 19th, 2008 Randy 2 comments

Categories: Uncategorized Tags:

External Interface with javascript confirm “bug”

February 4th, 2008 Randy 2 comments

I am working with External Interface in Flash and I encountered a problem which I am recreating here. Below you should see a Flash based (AS3) button that says "Show Alert". If you click it a javascript confirm dialog will appear. You will also notice that the button stays in it's down state. If you wait more that 15 seconds to confirm, the Flash Player complains that a script has been running too long. This is unexpected since I would assume that clicking a button in Flash and Javascript responding after a confirm dialog should be an asynchronous event. I tried this using the "MouseEvent.MOUSE_UP" event and got the same result. See below for the error response, javascript and actionscript code.

 

(note: you should see "from javascript" when you agree to the confirmation dialog box if the call succeeds. If the call fails and you have the debug Flash Player version installed you should see an alert window with the error below. If you do not have the debug player and the call fails you will see nothing.)

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at ()
at flash.external::ExternalInterface$/_evalJS()
at flash.external::ExternalInterface$/call()
at showAlert_fla::MainTimeline/handleClick()

Funny though. Flex has no problem:

JavaScript:
  1. function fromFlash(){
  2.     if(confirm("Talk to Flash?")) toFlash();
  3. }
  4.  
  5. function toFlash(){
  6.     thisMovie("showAlert").toFlash("from javascript");
  7. }
  8.  
  9. function thisMovie(movieName) {
  10.     if (navigator.appName.indexOf("Microsoft") != -1) {
  11.         return window[movieName]
  12.     }
  13.     else {
  14.         return document[movieName]
  15.     }
  16. }

Actionscript:
  1. alertButton.addEventListener(MouseEvent.CLICK, handleClick);
  2.  
  3. ExternalInterface.addCallback("toFlash", responseFromJavascript);
  4.  
  5. function handleClick(p_evt:MouseEvent):void{
  6.     responseTF.text = "";
  7.     ExternalInterface.call("fromFlash");
  8. }
  9.  
  10. function responseFromJavascript(p_response:String):void{
  11.     responseTF.text = p_response;
  12. }

Categories: Flash development Tags:

Creating Flash content with Sprout

February 3rd, 2008 Randy No comments

I have been playing around with Sprout and I am blown away. As a flex developer and a visual communication designer I know how hard it is to build a really awesome UI. It takes hard work. Iteration. Tweeking and more tweeking. Sweating over pixels! The Sprout guys have done an AMAZING job with this Flex app. And the kudos don't end there. It is a great idea and a slick implementation. Here is my first sprout. At this time it does not seem to be able to load the news feed ... not sure what is up with that.

UPDATE: I tinkered with the RSS URL and got it to work. Yay!


Download Full Movie Online Street Kings download movie Behind Enemy Lines II: Axis of Evil download movie The Station Agent download movie Sister Act 2: Back in the Habit download movie Reversible Errors download movie Retrograde download movie Sister Act download movie Radio download movie Prince Valiant download movie Play dead download movie Cry for help download movie Witchboard download movie Conan the barbarian download movie Fire down below download movie Dadnapped download movie Groundhog day download movie sites for free ringtones att cell ringtones classic crime ringtones mp3 ringtones for nextel Street Kings download movie Behind Enemy Lines II: Axis of Evil download movie The Station Agent download movie Sister Act 2: Back in the Habit download movie Reversible Errors download movie Retrograde download movie Sister Act download movie Radio download movie Prince Valiant download movie Iron Road download movie Beat Street download movie Dr T and the Women download movie Doubt download movie Catch and Release download movie Reach for Me download movie The Fourth Protocol download movie Adulthood download movie The Avengers download movie Hanger download movie Fighting Words download movie Satan's Playground download movie Affinity download movie Click download movie The Tender Hook download movie The Forbidden Kingdom download movie Blancaflor, la hija del diablo download movie Liberty Kid download movie The Virgin Suicides download movie Northfork download movie Mad Max download movie Toy Story download movie Cheerleader Camp download movie Lightning Bug download movie Takedown download movie Sky Captain and the World of Tomorrow download movie The Babe download movie