[flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK?
Using Flex Builder 3 I had to add the leading slash to Embeds when using Ant as well. I'm pretty sure one of the previous posters is right: it's all about the paths and FB does some magic behind the scenes (adds a leading slash perhaps?) that Ant doesn't. --- In flexcoders@yahoogroups.com, Josh On j...@... wrote: Thanks, I had the problem which prevented ant from seeing the asset files, and that was fixed by adding a slash to the front of the asset path. That problem caused a compile error. This error only happens at run-time and only after compiling with recent builds using ant. I also tried using flex tasks and it produced the same runtime errors. It all works perfectly when I compile using flex_sdk_4.0.0.7219, with ant or otherwise. Josh From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of ag_rcuren Sent: Thursday, October 15, 2009 5:57 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK? I had this problem once and it turns out that when you are using Flex builder it does some magic to the build path. This does not happen when you build with ant and I had to move some files around so that mxmlc could find everything. I believe that mxmlc can only see the src path and its sub directories, someone correct me if I am wrong. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , joshonemail josh@ wrote: It works when compiling using interface in flex - using all sdks. I get the problem when I compile using ANT, so it is most likely my own doing. My build.properties file: SRC_DIR = ${basedir} DEPLOY_DIR = ../bin-debug # Flex 4-Beta 2 4.0.0.10485 Tue Sep 22 2009 # Flex 4-Beta 1 4.0.0.7219 Wed May 13 2009 # FLEX_HOME = C:\\flex_sdk_4.0.0.10547 # FLEX_HOME = C:\\flex_sdk_4.0.0.7219 # FLEX_HOME = C:\\flex_sdk_4.0.0.10485 # FLEX_HOME = C:\\flex_sdk_4.0.0.10988 FLEX_HOME = C:\\flex_sdk_4.0.0.10963 MXMLC_EXE = ${FLEX_HOME}\\bin\\mxmlc.exe FLASHPLAYER_EXE = ${FLEX_HOME}\\runtimes\\player\\10\\win\\FlashPlayer.exe FLEX_TASK_JAR = ${FLEX_HOME}\\ant\\lib\\flexTasks.jar My build.xml: ?xml version=1.0 encoding=utf-8? project name=EmbedTest basedir=../src/ property file=../build/build.properties / echoMXMLC_EXE: ${MXMLC_EXE}/echo !-- - CLEAN - deletes all files from bin-debug -- target name=clean delete includeemptydirs=true fileset dir=${DEPLOY_DIR} includes=**/*/ /delete /target !-- COMPILE -- target name=compile_embed_test echoCOMPILE/echo exec executable=${MXMLC_EXE} dir=${basedir} failonerror=true arg line='${SRC_DIR}\EmbedTest.as' / arg line=-o '${DEPLOY_DIR}\EmbedTest.swf' / arg line=-debug / /exec /target !-- LAUNCH -- target name=launch echoLAUNCH/echo exec executable=${FLASHPLAYER_EXE} errorproperty=trace.output arg line='${DEPLOY_DIR}\EmbedTest.swf' / /exec /target target name=clean compile launch depends=clean,compile_embed_test,launch/ /project The source: package { import flash.display.Bitmap; import flash.display.Sprite; public class EmbedTest extends Sprite { [Embed(source='/image_assets/ui/arrow.gif')] private static var Arrow:Class; public function EmbedTest() { var arrow_bm:Bitmap = new Arrow(); addChild(arrow_bm); } } } I still get the same results as below when using ant with these parameters. Any thoughts appreciated. Josh --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , joshonemail josh@ wrote: Hi, I am embedding a graphic at compile using the Embed metatag in an AS3 project using Flash Builder 4. It compiles in both Beta 1 (build 4.0.0.7219) and Beta 2 (Flex 4-Beta 2 4.0.0.10485) - but in beta 2 it throw runtime errors. Here is how I embed:[Embed(source='/image_assets/ui/arrow.gif')] //the first slash is necessary for the compilerprivate static var Arrow:Class; Here is how I use the asset:new Scrollbar.Arrow() // as a Bitmap This is the runtime error I get after compiling with no errors in 4.0.0.10485 and later:VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found.ReferenceError: Error #1065: Variable Scrollbar_Arrow is not defined. Has the method for embedding assets changed in an Actionscript project? Or am I missing something? likely! Thanks, Josh
RE: [flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK?
Hi, I am using a leading slash in the path to the asset: [Embed(source='/image_assets/ui/arrow.gif')] Are you talking about a different path somewhere? The thing is, it does compile, I would think if it couldn't find the class at compile time then there would be a compile error (which there is when I don't use a leading slash). But I get a runtime error: VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found. I have tried explicitly importing BitmapAsset in the code, and using BitmapAsset as the cast of the instance when I create it, all to no avail. Can anyone else compile an actionscript project against the latest builds (Flex 4 Beta 2 and later) using ant, that employs the {Embed] metatag? I would file a bug - but I am not sure exactly where the bug lies - in the compiler or the SDK or the player, or indeed if there is actually a bug at all - perhaps there has been a change in the way the [Embed] metatag works, or a new compiler instruction, or something . Josh From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of seanmcmonahan Sent: Friday, October 16, 2009 7:20 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK? Using Flex Builder 3 I had to add the leading slash to Embeds when using Ant as well. I'm pretty sure one of the previous posters is right: it's all about the paths and FB does some magic behind the scenes (adds a leading slash perhaps?) that Ant doesn't. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Josh On j...@... wrote: Thanks, I had the problem which prevented ant from seeing the asset files, and that was fixed by adding a slash to the front of the asset path. That problem caused a compile error. This error only happens at run-time and only after compiling with recent builds using ant. I also tried using flex tasks and it produced the same runtime errors. It all works perfectly when I compile using flex_sdk_4.0.0.7219, with ant or otherwise. Josh From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of ag_rcuren Sent: Thursday, October 15, 2009 5:57 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK? I had this problem once and it turns out that when you are using Flex builder it does some magic to the build path. This does not happen when you build with ant and I had to move some files around so that mxmlc could find everything. I believe that mxmlc can only see the src path and its sub directories, someone correct me if I am wrong. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , joshonemail josh@ wrote: It works when compiling using interface in flex - using all sdks. I get the problem when I compile using ANT, so it is most likely my own doing. My build.properties file: SRC_DIR = ${basedir} DEPLOY_DIR = ../bin-debug # Flex 4-Beta 2 4.0.0.10485 Tue Sep 22 2009 # Flex 4-Beta 1 4.0.0.7219 Wed May 13 2009 # FLEX_HOME = C:\\flex_sdk_4.0.0.10547 # FLEX_HOME = C:\\flex_sdk_4.0.0.7219 # FLEX_HOME = C:\\flex_sdk_4.0.0.10485 # FLEX_HOME = C:\\flex_sdk_4.0.0.10988 FLEX_HOME = C:\\flex_sdk_4.0.0.10963 MXMLC_EXE = ${FLEX_HOME}\\bin\\mxmlc.exe FLASHPLAYER_EXE = ${FLEX_HOME}\\runtimes\\player\\10\\win\\FlashPlayer.exe FLEX_TASK_JAR = ${FLEX_HOME}\\ant\\lib\\flexTasks.jar My build.xml: ?xml version=1.0 encoding=utf-8? project name=EmbedTest basedir=../src/ property file=../build/build.properties / echoMXMLC_EXE: ${MXMLC_EXE}/echo !-- - CLEAN - deletes all files from bin-debug -- target name=clean delete includeemptydirs=true fileset dir=${DEPLOY_DIR} includes=**/*/ /delete /target !-- COMPILE -- target name=compile_embed_test echoCOMPILE/echo exec executable=${MXMLC_EXE} dir=${basedir} failonerror=true arg line='${SRC_DIR}\EmbedTest.as' / arg line=-o '${DEPLOY_DIR}\EmbedTest.swf' / arg line=-debug / /exec /target !-- LAUNCH -- target name=launch echoLAUNCH/echo exec executable=${FLASHPLAYER_EXE} errorproperty=trace.output arg line='${DEPLOY_DIR}\EmbedTest.swf' / /exec /target target name=clean compile launch depends=clean,compile_embed_test,launch/ /project The source: package { import flash.display.Bitmap; import flash.display.Sprite; public class EmbedTest extends Sprite { [Embed(source='/image_assets/ui/arrow.gif')] private static var Arrow:Class; public function EmbedTest() { var arrow_bm:Bitmap = new Arrow(); addChild(arrow_bm); } } } I still get the same results as below when using ant with these parameters. Any
[flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK?
--- In flexcoders@yahoogroups.com, joshonemail j...@... wrote: This is the runtime error I get after compiling with no errors in 4.0.0.10485 and later:VerifyError: Error #1014: Class I think your problem is that RSL's are now used by default, and when compiling outside Flex builder, you have not specified a factory class to load the RSL's. Did you see an error like this when compiling? Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option. Try adding the -static-link-runtime-shared-libraries mxmlc option to your build script. -david knape
RE: [flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK?
Try adding the -static-link-runtime-shared-libraries mxmlc option to your build script. Thank you David - that did the trick - I don't know if I ever would have worked that out! Josh
[flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK?
It works when compiling using interface in flex - using all sdks. I get the problem when I compile using ANT, so it is most likely my own doing. My build.properties file: SRC_DIR = ${basedir} DEPLOY_DIR = ../bin-debug # Flex 4-Beta 2 4.0.0.10485Tue Sep 22 2009 # Flex 4-Beta 1 4.0.0.7219 Wed May 13 2009 # FLEX_HOME = C:\\flex_sdk_4.0.0.10547 # FLEX_HOME = C:\\flex_sdk_4.0.0.7219 # FLEX_HOME = C:\\flex_sdk_4.0.0.10485 # FLEX_HOME = C:\\flex_sdk_4.0.0.10988 FLEX_HOME = C:\\flex_sdk_4.0.0.10963 MXMLC_EXE = ${FLEX_HOME}\\bin\\mxmlc.exe FLASHPLAYER_EXE = ${FLEX_HOME}\\runtimes\\player\\10\\win\\FlashPlayer.exe FLEX_TASK_JAR = ${FLEX_HOME}\\ant\\lib\\flexTasks.jar My build.xml: ?xml version=1.0 encoding=utf-8? project name=EmbedTest basedir=../src/ property file=../build/build.properties / echoMXMLC_EXE: ${MXMLC_EXE}/echo !-- - CLEAN - deletes all files from bin-debug -- target name=clean delete includeemptydirs=true fileset dir=${DEPLOY_DIR} includes=**/*/ /delete /target !-- COMPILE -- target name=compile_embed_test echoCOMPILE/echo exec executable=${MXMLC_EXE} dir=${basedir} failonerror=true arg line='${SRC_DIR}\EmbedTest.as' / arg line=-o '${DEPLOY_DIR}\EmbedTest.swf' / arg line=-debug / /exec /target !-- LAUNCH -- target name=launch echoLAUNCH/echo exec executable=${FLASHPLAYER_EXE} errorproperty=trace.output arg line='${DEPLOY_DIR}\EmbedTest.swf' / /exec /target target name=clean compile launch depends=clean,compile_embed_test,launch/ /project The source: package { import flash.display.Bitmap; import flash.display.Sprite; public class EmbedTest extends Sprite { [Embed(source='/image_assets/ui/arrow.gif')] private static var Arrow:Class; public function EmbedTest() { var arrow_bm:Bitmap = new Arrow(); addChild(arrow_bm); } } } I still get the same results as below when using ant with these parameters. Any thoughts appreciated. Josh --- In flexcoders@yahoogroups.com, joshonemail j...@... wrote: Hi, I am embedding a graphic at compile using the Embed metatag in an AS3 project using Flash Builder 4. It compiles in both Beta 1 (build 4.0.0.7219) and Beta 2 (Flex 4-Beta 2 4.0.0.10485) - but in beta 2 it throw runtime errors. Here is how I embed:[Embed(source='/image_assets/ui/arrow.gif')] //the first slash is necessary for the compilerprivate static var Arrow:Class; Here is how I use the asset:new Scrollbar.Arrow() // as a Bitmap This is the runtime error I get after compiling with no errors in 4.0.0.10485 and later:VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found.ReferenceError: Error #1065: Variable Scrollbar_Arrow is not defined. Has the method for embedding assets changed in an Actionscript project? Or am I missing something? likely! Thanks, Josh
[flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK?
I had this problem once and it turns out that when you are using Flex builder it does some magic to the build path. This does not happen when you build with ant and I had to move some files around so that mxmlc could find everything. I believe that mxmlc can only see the src path and its sub directories, someone correct me if I am wrong. --- In flexcoders@yahoogroups.com, joshonemail j...@... wrote: It works when compiling using interface in flex - using all sdks. I get the problem when I compile using ANT, so it is most likely my own doing. My build.properties file: SRC_DIR = ${basedir} DEPLOY_DIR = ../bin-debug # Flex 4-Beta 24.0.0.10485Tue Sep 22 2009 # Flex 4-Beta 14.0.0.7219 Wed May 13 2009 # FLEX_HOME = C:\\flex_sdk_4.0.0.10547 # FLEX_HOME = C:\\flex_sdk_4.0.0.7219 # FLEX_HOME = C:\\flex_sdk_4.0.0.10485 # FLEX_HOME = C:\\flex_sdk_4.0.0.10988 FLEX_HOME = C:\\flex_sdk_4.0.0.10963 MXMLC_EXE = ${FLEX_HOME}\\bin\\mxmlc.exe FLASHPLAYER_EXE = ${FLEX_HOME}\\runtimes\\player\\10\\win\\FlashPlayer.exe FLEX_TASK_JAR = ${FLEX_HOME}\\ant\\lib\\flexTasks.jar My build.xml: ?xml version=1.0 encoding=utf-8? project name=EmbedTest basedir=../src/ property file=../build/build.properties / echoMXMLC_EXE: ${MXMLC_EXE}/echo !-- - CLEAN - deletes all files from bin-debug -- target name=clean delete includeemptydirs=true fileset dir=${DEPLOY_DIR} includes=**/*/ /delete /target !-- COMPILE -- target name=compile_embed_test echoCOMPILE/echo exec executable=${MXMLC_EXE} dir=${basedir} failonerror=true arg line='${SRC_DIR}\EmbedTest.as' / arg line=-o '${DEPLOY_DIR}\EmbedTest.swf' / arg line=-debug / /exec /target !-- LAUNCH -- target name=launch echoLAUNCH/echo exec executable=${FLASHPLAYER_EXE} errorproperty=trace.output arg line='${DEPLOY_DIR}\EmbedTest.swf' / /exec /target target name=clean compile launch depends=clean,compile_embed_test,launch/ /project The source: package { import flash.display.Bitmap; import flash.display.Sprite; public class EmbedTest extends Sprite { [Embed(source='/image_assets/ui/arrow.gif')] private static var Arrow:Class; public function EmbedTest() { var arrow_bm:Bitmap = new Arrow(); addChild(arrow_bm); } } } I still get the same results as below when using ant with these parameters. Any thoughts appreciated. Josh --- In flexcoders@yahoogroups.com, joshonemail josh@ wrote: Hi, I am embedding a graphic at compile using the Embed metatag in an AS3 project using Flash Builder 4. It compiles in both Beta 1 (build 4.0.0.7219) and Beta 2 (Flex 4-Beta 2 4.0.0.10485) - but in beta 2 it throw runtime errors. Here is how I embed:[Embed(source='/image_assets/ui/arrow.gif')] //the first slash is necessary for the compilerprivate static var Arrow:Class; Here is how I use the asset:new Scrollbar.Arrow() // as a Bitmap This is the runtime error I get after compiling with no errors in 4.0.0.10485 and later:VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found.ReferenceError: Error #1065: Variable Scrollbar_Arrow is not defined. Has the method for embedding assets changed in an Actionscript project? Or am I missing something? likely! Thanks, Josh
RE: [flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK?
Thanks, I had the problem which prevented ant from seeing the asset files, and that was fixed by adding a slash to the front of the asset path. That problem caused a compile error. This error only happens at run-time and only after compiling with recent builds using ant. I also tried using flex tasks and it produced the same runtime errors. It all works perfectly when I compile using flex_sdk_4.0.0.7219, with ant or otherwise. Josh From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of ag_rcuren Sent: Thursday, October 15, 2009 5:57 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Does the Embed metatag still work in the latest versions of the SDK? I had this problem once and it turns out that when you are using Flex builder it does some magic to the build path. This does not happen when you build with ant and I had to move some files around so that mxmlc could find everything. I believe that mxmlc can only see the src path and its sub directories, someone correct me if I am wrong. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , joshonemail j...@... wrote: It works when compiling using interface in flex - using all sdks. I get the problem when I compile using ANT, so it is most likely my own doing. My build.properties file: SRC_DIR = ${basedir} DEPLOY_DIR = ../bin-debug # Flex 4-Beta 2 4.0.0.10485 Tue Sep 22 2009 # Flex 4-Beta 1 4.0.0.7219 Wed May 13 2009 # FLEX_HOME = C:\\flex_sdk_4.0.0.10547 # FLEX_HOME = C:\\flex_sdk_4.0.0.7219 # FLEX_HOME = C:\\flex_sdk_4.0.0.10485 # FLEX_HOME = C:\\flex_sdk_4.0.0.10988 FLEX_HOME = C:\\flex_sdk_4.0.0.10963 MXMLC_EXE = ${FLEX_HOME}\\bin\\mxmlc.exe FLASHPLAYER_EXE = ${FLEX_HOME}\\runtimes\\player\\10\\win\\FlashPlayer.exe FLEX_TASK_JAR = ${FLEX_HOME}\\ant\\lib\\flexTasks.jar My build.xml: ?xml version=1.0 encoding=utf-8? project name=EmbedTest basedir=../src/ property file=../build/build.properties / echoMXMLC_EXE: ${MXMLC_EXE}/echo !-- - CLEAN - deletes all files from bin-debug -- target name=clean delete includeemptydirs=true fileset dir=${DEPLOY_DIR} includes=**/*/ /delete /target !-- COMPILE -- target name=compile_embed_test echoCOMPILE/echo exec executable=${MXMLC_EXE} dir=${basedir} failonerror=true arg line='${SRC_DIR}\EmbedTest.as' / arg line=-o '${DEPLOY_DIR}\EmbedTest.swf' / arg line=-debug / /exec /target !-- LAUNCH -- target name=launch echoLAUNCH/echo exec executable=${FLASHPLAYER_EXE} errorproperty=trace.output arg line='${DEPLOY_DIR}\EmbedTest.swf' / /exec /target target name=clean compile launch depends=clean,compile_embed_test,launch/ /project The source: package { import flash.display.Bitmap; import flash.display.Sprite; public class EmbedTest extends Sprite { [Embed(source='/image_assets/ui/arrow.gif')] private static var Arrow:Class; public function EmbedTest() { var arrow_bm:Bitmap = new Arrow(); addChild(arrow_bm); } } } I still get the same results as below when using ant with these parameters. Any thoughts appreciated. Josh --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , joshonemail josh@ wrote: Hi, I am embedding a graphic at compile using the Embed metatag in an AS3 project using Flash Builder 4. It compiles in both Beta 1 (build 4.0.0.7219) and Beta 2 (Flex 4-Beta 2 4.0.0.10485) - but in beta 2 it throw runtime errors. Here is how I embed:[Embed(source='/image_assets/ui/arrow.gif')] //the first slash is necessary for the compilerprivate static var Arrow:Class; Here is how I use the asset:new Scrollbar.Arrow() // as a Bitmap This is the runtime error I get after compiling with no errors in 4.0.0.10485 and later:VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found.ReferenceError: Error #1065: Variable Scrollbar_Arrow is not defined. Has the method for embedding assets changed in an Actionscript project? Or am I missing something? likely! Thanks, Josh