Sunday, March 28, 2010

5001: Base64.as error!

5001: The name of package 'com.dynamicflash.util' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Documents and Settings\D\Desktop\TempImp\test\Base64.as

My test.fla is in C:\Documents and Settings\D\Desktop\TempImp\test\test.fla

I setted my prefrences in settings as C:\Documents and Settings\D\LocalSettings\Adobe\Flash CS4\en\configuration\classess\Base64\src\com\dynam?iclfash\util\

And I even copied the Base64.as file into C:\Documents and Settings\D\Desktop\TempImp\test\

but again i get the same error!Even setted the classpath as C:\Documents and Settings\D\Desktop\TempImp\test\com\dynamicflash\u?til

no use!

here is my flash code: temme if its correct:
-------------------------------------------
import com.adobe.images.JPGEncoder;
import com.dynamicflash.util.Base64;
var jpgSource:BitmapData = new BitmapData (sketch_mc.width, sketch_mc.height);
jpgSource.draw(sketch_mc);
var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
//converting to base64
var sbase64:String = Base64.encodeByteArray(jpgStream);
//sending...
var Access:URLRequest = new URLRequest();
Access.url= ''www.axeleron.net/flashtest/get_images.php'';
Access.method=URLRequestMethod.POST;
Access.data= sbase64;
//EncodedImageString is the response string of the Base64 Encoder class.
var LODR:URLLoader = new URLLoader();
LODR.load(Access);

-----------------------------------------------------------------------------
please help ! coz i m working with classess for the first time ...Learning only!...

5001: Base64.as error!

If the path to Base64.as is

C:\Documents and Settings\D\LocalSettings\Adobe\Flash CS4\en\configuration\classess\Base64\src\com\dynamicflash\util\Base64.as

the path you add to classpaths must be

C:\Documents and Settings\D\LocalSettings\Adobe\Flash CS4\en\configuration\classess\Base64\src

5001: Base64.as error!

still gettin this error!

5001: The name of package 'com.dynamicflash.util' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Documents and Settings\D\Desktop\TempImp\test\Base64.as

com.dynamicflash.util

that means:

Create three subfolders com, dynamicflash inside com and util inside dynamicflash, put the Base64.as file in it. So the path would be

C:\Documents and Settings\D\Desktop\TempImp\test\com\dynamicflash\util\Base64.as

Just as the error message says.

I got the 5001 error and fixed it in Linkage in Symbol properties. I had the path declared correctly in Publish Settings (as you have discussed here) and correct in my package {} declarations, but was still getting the 5001 error. My main AS3 class is for a MovieClip in the .fla library, not a Document class for the .fla file. This main class must extend MovieClip (import flash.display.MovieClip). When I ctrl-click the MovieClip Symbol in the library, choose Symbol Properties and link my class (com.customer.project.MyClass) as the Base class of the Symbol, it fixes the path error. For the Class field (one field above in Symbol Properties), I put the name of the MovieClip Symbol and let the compiler make that class.

Here is my setup:

directory structure: Users/Me/Documents/Customer/Project/src/com/customer/project

1. the .fla file is in the src directory, alongside the com directory

2. the MovieClip Symbol in the .fla library is called MyClass

3. the MyClass.as file extends MovieClip and lives in the 'project' directory as above (not Project)

MyClass.as

package com.customer.project{

import flash.display.MovieClip;

import com.customer.project.MyClassUtil; // optional as example

public class MyClass extends MovieClip{

(properties and methods)

}

}

3. in Publish Settings in the .fla, I added the Source path: Users/Me/Documents/Customer/Project/src

4. in Symbol Properties panel, Linkage section:

4a. Check - Export for ActionScript

4b. Check - Export in frame 1

4c. Identifier - leave empty

4d. Class: MyClass (click OK to let compiler build)

4e. Base class: com.customer.project.MyClass

All the best,

Paul

No comments:

Post a Comment