Copy link to clipboard
Copied
I originally posted something similiar in the "Using Flash Builder" section but decided to post something here thinking it would get more coder eyes.
This worked in Flash Builder 4.5 using the Flex 4.6 SDK with the AIR 3.5 SDK.
However in Flash Builder 4.7 using the Flex 4.6 SDK with the AIR 3.5 SDK the following:
package
{
import flash.display.Sprite;
public class TestProject extends Sprite
{
[Embed(source = "Image.png", mimeType = "image/png", compression="true", quality="80")]
private static var _imageClass:Class;
public function TestProject()
{
}
}
}
Is generating these errors:
Error 1:
Internal error in outgoing dependency subsystem, when generating code for: C:\Users\users\Adobe Flash Builder 4.7\TestProject\src\Image.png: java.lang.ArrayIndexOutOfBoundsException: 0
at com.adobe.flash.compiler.internal.units.EmbedCompilationUnit.analyze( EmbedCompilationUnit.java:224)
at com.adobe.flash.compiler.internal.units.EmbedCompilationUnit.handleOu tgoingDependenciesRequest(EmbedCompilationUnit.java:193)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase.processOu tgoingDependenciesRequest(CompilationUnitBase.java:886)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase.access$50 0(CompilationUnitBase.java:107)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase$6$1.call( CompilationUnitBase.java:378)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase$6$1.call( CompilationUnitBase.java:374)
at com.adobe.flash.compiler.internal.units.requests.RequestMaker$1.call( RequestMaker.java:228)
at com.adobe.flash.compiler.internal.units.requests.RequestMaker$1.call( RequestMaker.java:222)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) Image.png /TestProject/src line 0 Flex Problem
Error 2:
The definition of base class Bitmap was not found.
With a warning:
Definition flash.utils.Bitmap could not be found.
If you drop the quality param:
package
{
import flash.display.Sprite;
public class TestProject extends Sprite
{
[Embed(source = "Image.png", mimeType = "image/png", compression="true")]
private static var _imageClass:Class;
public function TestProject()
{
}
}
}
The errors change to:
Internal error in ABC generator subsystem, when generating code for: C:\Users\user\Adobe Flash Builder 4.7\TestProject\src\TestProject.as: java.lang.NullPointerException
at com.adobe.flash.compiler.internal.embedding.transcoders.JPEGTranscode r.equals(JPEGTranscoder.java:220)
at com.adobe.flash.compiler.internal.embedding.EmbedData.equals(EmbedDat a.java:522)
at java.util.WeakHashMap.eq(Unknown Source)
at java.util.WeakHashMap.get(Unknown Source)
at com.adobe.flash.compiler.internal.workspaces.Workspace.getCanonicalEm bedData(Workspace.java:933)
at com.adobe.flash.compiler.internal.units.EmbedCompilationUnitFactory.g etEmbedData(EmbedCompilationUnitFactory.java:120)
at com.adobe.flash.compiler.internal.units.EmbedCompilationUnitFactory.g etCompilationUnit(EmbedCompilationUnitFactory.java:62)
at com.adobe.flash.compiler.internal.tree.as.EmbedNode.resolveCompilatio nUnit(EmbedNode.java:116)
at com.adobe.flash.compiler.internal.tree.as.EmbedNode.resolveCompilatio nUnit(EmbedNode.java:126)
at com.adobe.flash.compiler.internal.tree.as.EmbedNode.resolveCompilatio nUnit(EmbedNode.java:43)
at com.adobe.flash.compiler.internal.units.EmbedCompilationUnitFactory.c ollectEmbedDatas(EmbedCompilationUnitFactory.java:136)
at com.adobe.flash.compiler.internal.as.codegen.ABCGenerator.generate(AB CGenerator.java:184)
at com.adobe.flash.compiler.internal.units.ASCompilationUnit.handleABCBy tesRequest(ASCompilationUnit.java:374)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase.processAB CBytesRequest(CompilationUnitBase.java:870)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase.access$30 0(CompilationUnitBase.java:107)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase$4$1.call( CompilationUnitBase.java:309)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase$4$1.call( CompilationUnitBase.java:305)
at com.adobe.flash.compiler.internal.units.requests.RequestMaker$1.call( RequestMaker.java:228)
at com.adobe.flash.compiler.internal.units.requests.RequestMaker$1.call( RequestMaker.java:222)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) TestProject.as /TestProject/src line 0 Flex Problem
Internal error in outgoing dependency subsystem, when generating code for: C:\Users\user\Adobe Flash Builder 4.7\TestProject\src\TestProject.as: java.lang.NullPointerException
at com.adobe.flash.compiler.internal.embedding.transcoders.JPEGTranscode r.equals(JPEGTranscoder.java:220)
at com.adobe.flash.compiler.internal.embedding.EmbedData.equals(EmbedDat a.java:522)
at java.util.WeakHashMap.eq(Unknown Source)
at java.util.WeakHashMap.get(Unknown Source)
at com.adobe.flash.compiler.internal.workspaces.Workspace.getCanonicalEm bedData(Workspace.java:933)
at com.adobe.flash.compiler.internal.units.EmbedCompilationUnitFactory.g etEmbedData(EmbedCompilationUnitFactory.java:120)
at com.adobe.flash.compiler.internal.units.EmbedCompilationUnitFactory.g etCompilationUnit(EmbedCompilationUnitFactory.java:62)
at com.adobe.flash.compiler.internal.tree.as.EmbedNode.resolveCompilatio nUnit(EmbedNode.java:116)
at com.adobe.flash.compiler.internal.tree.as.EmbedNode.resolveCompilatio nUnit(EmbedNode.java:126)
at com.adobe.flash.compiler.internal.tree.as.EmbedNode.resolveCompilatio nUnit(EmbedNode.java:43)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase.updateEmb edCompilationUnitDependencies(CompilationUnitBase.java:946)
at com.adobe.flash.compiler.internal.units.ASCompilationUnit.handleOutgo ingDependenciesRequest(ASCompilationUnit.java:458)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase.processOu tgoingDependenciesRequest(CompilationUnitBase.java:886)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase.access$50 0(CompilationUnitBase.java:107)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase$6$1.call( CompilationUnitBase.java:378)
at com.adobe.flash.compiler.internal.units.CompilationUnitBase$6$1.call( CompilationUnitBase.java:374)
at com.adobe.flash.compiler.internal.units.requests.RequestMaker$1.call( RequestMaker.java:228)
at com.adobe.flash.compiler.internal.units.requests.RequestMaker$1.call( RequestMaker.java:222)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) TestProject.as /TestProject/src line 0 Flex Problem
If you try to set compression to false:
package
{
import flash.display.Sprite;
public class TestProject extends Sprite
{
[Embed(source = "Image.png", mimeType = "image/png", compression="false")]
private static var _imageClass:Class;
public function TestProject()
{
}
}
}
You get the following:
The attribute compression can't be used with the mime type: image/png
Change it to jpeg:
package
{
import flash.display.Sprite;
public class TestProject extends Sprite
{
[Embed(source = "Image.png", mimeType = "image/jpeg", compression="false")]
private static var _imageClass:Class;
public function TestProject()
{
}
}
}
You get the following:
The attribute compression can't be used with the mime type: image/jpeg
Is anyone else getting these same results with Flash Builder 4.7 with Flex SDK 4.6 and AIR SDK 3.5? I expect that we still should be able to compress embedded assets within Flash Builder?
Copy link to clipboard
Copied
Upgraded Flex 4.6 SDK to use the new AIR 3.6 SDK and the Flash Builder 4.7 to use the new AIR 3.6 SDK with the new compiler and I am still getting this. I had some other people try these steps and they got the exact same error so it doesn't seem to be just me. Is noone here getting this or am I the only one trying to embed a png directly into a Flash Builder project? =/
Copy link to clipboard
Copied
Remove the compression option. The error goes away. I assume that compression for PNG is automatic.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now