The White Zone Is For Loading XML

A question on DIRECT-L about sending a command from ActionScript to Lingo using a URL beginning with the string "lingo:" made me think that perhaps a post about the interrelationship between Flash and Director might be useful, since I hadn’t done anything on the subject for a while.

The question involved trying to trigger a Lingo handler with the XML.sendAndLoad in order to load data into a Flash sprite from the host Director movie. The intention was to get XML content and specify a destination for the data within the Flash movie in one operation, I assume.

The thing that’s important to understand here is that the ActionScript getURL function that supports the "lingo:" and "event:" functionality doesn’t actually tell Flash to do anything, it’s a command that passes data to the Flash movie container, whether that’s Director or a Web browser.

When you execute a getURL with a string beginning "http://" in a movie embedded in a Web page, the message goes to the browser and the browser loads a page. Flash does nothing with the command.

Likewise, when you use getURL in a Flash sprite in Director, it’s passed directly to the Flash Asset Xtra, which is then in charge of doing something with the string data. The movie itself is finished with the command.

The loading commands (for MovieClips, XML, etc.) on the other hand are completely internal to Flash. They actually return data to Flash and therefore do not send a message to the container application.

It’s not incredibly difficult to get XML-formatted data from Director into Flash — the last several applications I’ve worked on read faux-Unicode (you don’t want to know how screwy that is) Japanese XML files from the hard drive for manipulation in Director and display in Flash — but the only conduit for passing messages through from ActionScript to Lingo is that getURL command.