Blog Post RSS ?

Blogs » Flash » Unexpected ActionScript Behavior
 

Unexpected ActionScript Behavior

by sgrosvenor

I was working on a project the other day using the XMLConnector component to see how much time it would save me. It took about 60 seconds to pull the data from the schema, set up the bindings and get it pushing data to a custom list box…that was all fine. I then proceeded to get the application pushing and pulling data from a SQL 2000 database with no problems.

The problems arose when using the onLoad event handler after the LoadVars.sendAndLoad()operation to trigger a function to update the XMLConnector and get the refreshed content into a standard list box which had an XML data feed.

You’d think that XMLConnectorInstance.trigger(); would work first time round. In actual fact, it would never work as expected, and only seemed to reset the list box position strangely enough rather than the content. Weird behavior I thought, so I copied and pasted the line again to call the trigger and it all worked fine and the list box updated with new content.

Why does it take two method calls to instantiate the XML refresh? Not sure, but something I’m investigating at the moment. It looks like I may just write have to write my own custom XMLConnector classes!

Which nicely brings me onto my next point…What’s the strangest ActionScript behavior that you’ve seen, or the simplest piece of ActionScript that produces the most unexpected results? Have you been subject to working with components or the Flash API that has had methods, events or properties deprecated between versions?

Let’s hear some of your ‘ActionScript Oddly Enough’ stories!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Ping.fm
  • Twitthis

Related posts:

  1. How To Manage Work When The Unexpected Happens Keeping up with work when a personal emergency happens can...
  2. Don’t Misuse REL as a Custom Attribute There is a common misconception that 'rel' is an attribute...

This post has 4 responses so far

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Follow SitePoint on...