Thursday, January 22, 2009

Little AS3 notes.

When using the TextFormat on a textfield, always setTextFormat after changing the textfield.text value.

Tuesday, January 6, 2009

Call failed at flash when attempting ZendAMF.

Implementing database data retrieval through flash with ZendAMF.

What I did:
1. Create bootstrap file and class file in web root (bootstrap.php & classfile.php)
2. Create another php file outside the web root to mask the connection details.
3. Create flash file and attempt to connect.

Call failed
Error opening URL 'http://localhost/bootstrap.php'
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.Failed
at asMain/::doConnect()
at asMain$iinit()

Alright! This error is silly. The reason why I (or you) get this error is because there's a problem with the xml files (either the bootstrap or the class files). One of these could be the cause:
1. The path specified at the bootstrap file is pointing to a broken link. Check include paths and spelling errors.
2. Select statement or connection details wrong at the class file.
3. There is no number 3.

Since I'm using Zend with xammp on Windows, the include path in the php.ini file was set to xammp/php/pear so I wasn't able to include the Zend gateway file correctly. I added another path to the end of the 'include_path' variable. By doing 'dirname(__FILE__)', the current directory could be attained. Also for the backward slash, you have to type '\\' instead of '\' because of it being an escape character.