Tag Archives: solution

(Object)#0 message = “faultCode:INVALID_AMF_MESSAGE faultString:’Invalid AMF message’ faultDetail:’ Warning: Cannot modify header information – headers already sent by (output started at /a/long/path/to/a/site/root/fileDirectory/my_necessary_class.php:464) in /a/long/path/to/a/site/root/amfphp/core/shared/exception/php4Exception.php on line 38 ‘” name = “Error” rootCause = (null)

Hi,

After 10 hours of endless efforts, I have fixed this problem. I’ve tested some php files on my server with AMFPHP and Flex. Everything is working as I expected. However, when I moved all of these files to my clients server, I started to get error from AMFPHP browser as follows;

(Object)#0
message = “faultCode:INVALID_AMF_MESSAGE faultString:’Invalid
AMF message’ faultDetail:’Warning: Cannot modify header
information – headers already sent by
(output started at /a/long/path/to/a/site/root/fileDirectory/
my_necessary_class.php:464) in
/a/long/path/to/a/site/root/amfphp/core/shared/exception/php4Exception.php
on line 38
‘”
name = “Error”
rootCause = (null)

What da hell? Everything was fine. What happend now? There is a guy
who got this type of error from AMFPHP and his solution for
the problem is here. It can work for you. But, it doesn’t work for me.
in order to get rid of this problem, I checked my .htaccess file
in my server. As you know .htaccess is a hidden file in your server.
So first of all, make activate ‘show invisible files’ option from
your ftp application. Then, make a back-up of .htaccess file and
open it in a text editor. When I opened my client’s .htaccess,
I realized that there is two lines of code that blocking the server
to use PHP 5. However, my PHP classes are optimized for PHP 5.
Here is the solution, just delete these codes which blocks your PHP
version. By the way, you may not have anything in your .htaccess.
In this case, probably the first link solves your problem.

Passing variables and parameters from HTML to AS3

Trust me. This is the working one. There are many examples on several web pages. However, non of them tell exactly what they do!!!! If you follow these steps you can’t miss it.

1- create a new fla file

2- type onto first frame in actions panel,

var tf:TextField = new TextField();
tf.autoSize = TextFieldAutoSize.LEFT;
tf.border = true;
addChild(tf);

var value1:String = root.loaderInfo.parameters.s0;
var value2:String = root.loaderInfo.parameters.s1;
tf.text = value1+ “\n” +value2;

3- Publish this .fla (Do not forget to check “html” from “publish setting”)

4- Open your published html file in Dreamveawer and type your two parameters(s0 and s1 which are shown in red);

<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>html_pass</title>
<script language=”javascript”>AC_FL_RunContent = 0;</script>
<script src=”AC_RunActiveContent.js” language=”javascript”></script>
</head>
<body bgcolor=”#ffffff”>
<!–url’s used in the movie–>
<!–text used in the movie–>
<!– saved from url=(0013)about:internet –>
<script language=”javascript”>
if (AC_FL_RunContent == 0) {
alert(“This page requires AC_RunActiveContent.js.”);
} else {
AC_FL_RunContent(

‘codebase’,’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0′,

‘width’,’550′,

‘height’,’400′,

‘id’,’html_pass’,

‘align’,’middle’,

‘src’,’html_pass’,

‘flashvars’,’s0=jkljkljkljkl.flv576767&s1=bbbb’,

‘quality’,’high’,

‘bgcolor’,’#ffffff’,

‘name’,’html_pass’,

‘allowscriptaccess’,’always’,

‘allowfullscreen’,’false’,

‘pluginspage’,’http://www.macromedia.com/go/getflashplayer’,’movie’,’html_pass’ );

//end AC code
}
</script>
<noscript>
<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″

codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0″ width=”550″

height=”400″

id=”html_pass”

align=”middle”>

<param name=”allowScriptAccess” value=”always” />
<param name=”allowFullScreen” value=”false” />
<param name=”FlashVars” value=”s0=jkljkljkljkl.flv 576767&amp;s1=bbbb”>
<param name=”movie” value=”html_pass.swf” />

<param name=”quality” value=”high” />

<param name=”bgcolor” value=”#ffffff” />

<embed src=”html_pass.swf” FlashVars=”s0=jkljkljkljkl.flv 576767&amp;s1=bbbb”

quality=”high” bgcolor=”#ffffff” width=”550″ height=”400″ name=”html_pass” align=”middle” allowScriptAccess=”always” allowFullScreen=”false” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” />
</object>
</noscript>
</body>
</html>

after this. Save your html file and run. The point is, you have to check your variables via html file. If you only run swf file, you can’t pass variable from html.

source: pass variable from html 2

Flash Unicode Font Embedding Problem

For a week I’ve been working on a project which I have to use Turkish characters. Although my embedded font indicates Turkish characters, it isn’t shown in the swf file.  Firstly I check the xml file. You know it has to be in UTF-8 encoding format. I tried many many many solutions for this problem. But I can’t manage it to work.  Then I open FontLab and realize that problem is my font. The problem is, it has Turkish characters but some of them has wrong “Unicode” names.

So my solution is, Firstly I delete characters which I can’t see in swf file. Then, I define them again with “create new Glymph”. For instance,

Ş = Scedilla

ş=scedilla

ı=dotlessi

Secondly, I change some of the font info settings from “file” menu to learn it Turkish characters. Finally, I generate font and embed it to my swf file. It works. Hope it helps someone .

DispatchEvent :How to use it?

untitled-1

In some cases dispatchEvent expression can be very useful.  For example; you can communicate with other classes that you ceated by dispatchEvent.  Basically I created a class and put a tween function. When tween finishes, my class dispatches as “TweenFinished”. In main fla file I added an EventListener to instance name of the class. Usually I have missed that part so my dispatcher doesn’t work as I expected.

EventListener listens to  “TweenFinished”. When it gets this message, ball moves to center of the stage.  So my main class is;

click here to download source.

text=Error #2036: Load Never Completed.

While I was preparing my web site, I didn’t get this error from Flash’s debugger. However, when I uploaded content to my server I got this error from IE. In Firefox there is no such error. But I can’t see the the image that should be loaded.

Today I’ve fixed it with a “WEIRD” way. I use xml for my mp3Player and when you select a song from playlist, player acquires image path, file name and info text about composition. So , firstly

I checked my xml file for the slip in spellings. The first mistake of mine is capital letter issue,
– For Example path of the file is
<song id=”1″ songname=”something” image=”images/audio.jpg” info=”bla blal blalal”></song>

list goes like this.  In action script class I typed it “Image“. Somehow flash ignored this and loaded related jpg file correctly. So I updated all “image” words to “Image“. But it wasn’t fixed.

After lots of experiments, I changed the name of image file from”audio” to “something_else” and WEIRDLY it worked 🙂

Really I have no idea about that. May be it is a bug. Because “audio” is so general word.

So if you encountered such an error, try to change your file names something like password 🙂

– dont forget to delete browser’s cache, history…

-carefully check your xml paths.