Troubleshooting

     

Why can't I get ActionScript-to-JavaScript communication to work?

graphics/troubleshooting_icon.jpg

You need to complete several steps before this communication will work: Set the ID parameters of both the OBJECT and EMBED tags, set the swLiveConnect parameter of the EMBED tag, and include a JavaScript function to get the message and a VBScript function to pass the message from VBScript to JavaScript. If any one of these elements is missing or contains a mistake, the communication does not work. Also, check to make sure your browser supports this communication.


I can get ActionScript-to-JavaScript communication to work on my machine, but it doesn't work for others.

Chances are the users are using browsers that do not support this type of communication. They also could have simply turned off JavaScript or ActiveX in their browsers. Some organizations have this feature turned off by default in all their browsers for security reasons.

I can't get Perl scripts to run on my server. What am I doing wrong?

It is important to realize that CGI programming is a different skill than Flash programming. If an electrician needs to have some water pipes moved to be able to run some wires, he would usually call a plumber to do the job rather than move them himself. Some Flash programmers can take on the extra skill of CGI programming, whereas others find it difficult to learn. If you're having trouble, you will definitely want to team up with someone else to get the job done.

I am including variables in the OBJECT movie parameter. They work fine in Internet Explorer for Windows, but other browsers don't get them.

You probably forgot to add the variables to the src parameter of the EMBED tag, or there is a typo in the EMBED tag but not the OBJECT tag. Internet Explorer for Windows uses the OBJECT tag and ignores the EMBED tag, whereas Netscape and other browsers use the EMBED tag but ignore the OBJECT tag.

I'm sure that my CGI program is done right and should work, but I still can't get Flash to load data from it.

You can and should always test your CGI programs from your browser with HTML. That is, you should browse an HTML page that submits to the CGI script or contains a Flash movie that submits to the CGI script. Place the HTML, SWF, and CGI files on the server and browse them through an http:// URL. For GET method programs, you can add the variables to the browser's address line. For POST method programs, you can create a simple HTML page with a form that calls the CGI program just as you would expect the Flash movie to do. The only change to the CGI program would be to have it set the MIME type to text/html . If you test the CGI program this way, you can determine whether the problem lies with the CGI program or your Flash movie.

XML

After importing an XML document, I can't find the nodes that I expect to be there. Is there a way to verify that the import worked?

There are many ways to verify a document after import. The easiest is to use the toString() function with trace to send the XML object to the Output window. You can also check the status property of the object. If either shows problems, your XML document must have errors in it. You can go through it line by line to find the missing or misspelled tag, or you can use a third-party XML creation tool to check for errors. You can also open the document in Microsoft Internet Explorer, which catches some basic problems, such as multiple top-level nodes.

After importing an XML document, I end up with a lot of blank text nodes. Why is that?

Any whitespace in your document, such as returns or tabs, is converted to little useless text nodes unless you set the ignoreWhite property of the XML object to true before parsing.

I can get the name of a node, but I can't seem to get the value of that same node. Why not?

Nodes don't have names and values; they have names or values. Chances are that the value you seek is actually the text node that is a child of the node with the name.

Why can't I access the sound in my loaded movie?

Here's a typical problem scenario: You have a movie ”call it soundsInHere. The soundsInHere.fla movie has a sound file in its Library with the linkage name "ByeBye" and code on the Main Timeline that looks like this:

 mySound = new Sound(); mySound.attachSound("ByeBye"); mySound.start(); 

When you test the soundsInHere movie on its own, the sound plays fine. But when you use loadMovie() to load the soundsInHere.swf file into another movie, the sound doesn't play.

The solution is to add the keyword this in the soundsInHere.fla file, as follows (with the keyword emphasized in bold):

 mySound = new Sound(  this  ); mySound.attachSound("ByeBye"); mySound.start(); 

If you publish the soundsInHere.swf file again, it should work.

This was an issue in Flash 5, and it's still an issue in Flash MX 2004. You can find a tech note on it at www.macromedia.com/support/flash/ts/documents/attached_sound.htm



Using Macromedia Studio MX 2004
Special Edition Using Macromedia Studio MX 2004
ISBN: 0789730421
EAN: 2147483647
Year: N/A
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net