Archive for June, 2008
unable to resolve ‘images/splash.jpg’ for transcoding
unable to resolve 'images/splash.jpg' for transcoding AkiraBike/src index.mxml
Unable to transcode images/splash.jpg. AkiraBike/src index.mxml
There were two issues here. Flex Builder was not displaying the image in the Design view. So I refreshed the design view, saved any changes and tried again. Still no change. Then I tried to embed the image. Nothing. Then I ran the application and still no image.
A clue to discovering the second error, "Unable to transcode images/splash.jpg" could be solved by studying the first error message, "unable [sic] to resolve 'images/splash.jpg'".
Here is the code:
-
<mx:Image x="10" y="10" source="@Embed(source='images/splash.jpg')" width="335" height="243"/>
I'll cut to the point. The project in Flex Builder was out of sync with the new files added to the file system. In other words I saved a new image into the images folder from Photoshop. Flex Builder was taking a nap and didn't know the image was there. So even though I was browsing to it in Flex Builder property view and finding the file, the project needed to be "refreshed" for it to be aware of it. Make sense? Anyway, refresh the project in Flex Builder, double check the path to the image is correct and try again. Peace.
Update: Actually there seems to be a problem with the application states. I can't change states. It all goes back to the base state. State structure:
-base
-- layout
---- home
-- splash
Element type must be followed by either attribute specifications
Element type "ns1:MyComponent" must be followed by either attribute specifications, ">" or "/>".
-
<ns1 :MyComponent id="myframe"
-
fontSize="10
-
editable="false"/>
This error comes from not closing an attribute tag. Look at the font size attribute in the code above. Leaving out the closing quotation mark caused this error.
1 commentDesign mode: Definition of HTML not found. Choose Design > Refresh if this component was recently created.
Design mode: Definition of HTML not found. Choose Design > Refresh if this component was recently created.
Not sure what causes this but if you close down Eclipse and restart it goes away.
No commentsError: default arguments may not be interspersed with other options
compile:
[exec] Adobe ASDoc
[exec] Version 2.0.1 build 155542
[exec] Copyright (c) 2004-2006 Adobe Systems, Inc. All rights reserved.
[exec] command line: Error: default arguments may not be interspersed with other options
[exec] Use 'asdoc -help' for information about using the command line.
BUILD FAILED
C:\Documents and Settings\Judah\My Documents\Flex Builder 2\DraggableLabel\build.xml:57: exec returned: 1
Problem:
The path to some or all of the arguments contain spaces. The current version of asdocs.exe does not handle spaces.
Solution:
Right now the only solution is to move your project directory to path that does not contain spaces. You will also want to move the flex sdk folder to this folder as well.
-
// paths causing the error
-
C:\Documents and Settings\Judah\My Documents\Flex Builder 2\my project
-
C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2
-
-
// path that works with asdocs
-
C:\flexprojects\myproject
-
C:\flexprojects\flexcapacitor\FlexSDK2
Thanks to Jesse for his help in his post here.
-
<!-- Example Asdocs -->
-
<project name="asdoc" default="main" basedir=".">
-
<!-- The Location of FlexSDK on your Computer -->
-
<property name="FLEX_HOME" location="C:\flexprojects\flexcapacitor\FlexSDK2/>
-
-
<!-- The Location of ASDocs on your Computer -->
-
<property name="AsDocs" location="${FLEX_HOME}\bin\asdoc.exe"/>
-
-
<!--
-
The Location of your Application Classes on your Computer
-
NOTE: This Path should be reletive to the build.xml file.
-
NOTE: ${basedir} is an ant property that represents the directory holding the build.xml file
-
NOTE: I have encountered issues with this folder containing Spaces
-
-->
-
<property name="dir.src" location="${basedir}"/>
-
-
<!--
-
The Location you wish to output distribution files to on your Computer
-
-->
-
<property name="dir.dist" location="${basedir}\dist" />
-
-
<target name="compile">
-
<exec executable="${AsDocs}" failonerror="true">
-
<arg line='-doc-classes com.flexcapacitor.controls.DraggableLabel'/>
-
<arg line='-source-path ${dir.src}'/>
-
<arg line='-namespace http://www.flexcapacitor.com/2007/mxml ${dir.src}/manifest.xml'/>
-
<arg line='-output ${dir.asdocs}'/>
-
<arg line='-package com.flexcapacitor.controls "Flex Capacitor controls classes."'/>
-
<arg line='-package com.flexcapacitor.managers "Flex Capacitor managers classes."'/>
-
</exec>
-
</target>
-
</project>
An internal build error has occurred. Right-click for more information.
An internal build error has occurred. Right-click for more information.
I don't know what this issue is? It just started happening. I right click on it select more information and it loads this page,
http://learn.adobe.com/wiki/display/Flex/Flex+Builder+3+Compiler+Errors
It tells me to look at the log file but there is no log file??? hmm...
I'm checking what the issue is for me but until then it looks like others have had this issue:
UPDATE! Well I figured it out. I had a countdown component called "endOfWorkDay1" then I had a method called "endOfWorkDay". The only difference being the "1" at the end of the component id. So when I changed the name of the method to endOfDay the error went away.
So the lesson is look for nearly identical ids and then rename them...
-
// caused error
-
<fc:Countdown id="endOfWorkDay1" updateInterval="ten hundredths" backgroundAlpha="0.0" borderThickness="0"
-
targetDate="{endOfWorkDay()}"
-
text="23 hours 59 min 59 sec 999 ms"
-
runtimeText="[h] hours [m] min [s] sec [ms] ms until 5pm" fontWeight="bold" x="365" y="288" height="33" styleName="candlesFont"/>
-
-
// fixed error
-
<fc:Countdown id="endOfWorkDay1" updateInterval="ten hundredths" backgroundAlpha="0.0" borderThickness="0"
-
targetDate="{endOfDay()}"
-
text="23 hours 59 min 59 sec 999 ms"
-
runtimeText="[h] hours [m] min [s] sec [ms] ms until 5pm" fontWeight="bold" x="365" y="288" height="33" styleName="candlesFont"/>
Additional Resources:
http://michael.omnicypher.com/2007/02/internal-build-error.html
http://www.mail-archive.com/flexcoders@yahoogroups.com/msg59392.html
Error #1501: Error occurred writing to file
Create ASDocs:
[echo] Copying api documentation to project documentation directory
[exec] Loading configuration file C:\projects\flex2\resources\3.0.0\frameworks\flex-config.xml
[exec] An unexpected error occurred.
[exec] Error #1501: Error occurred writing to file C:\projects\flex2\HTMLProject\api\toplevel_classes.xml.
[exec] Documentation was created in C:\projects\flex2\HTMLProject\api\
Not sure what caused this error about but I restarted Flex Builder and it went away. File may have been open or locked.
No commentsAn error has occured. See error log for more details.
An error has occured. See error log for more details.


I don't know what is causing this error or how to fix it but Flex Builder won't start up.
I found this online but I still get the same error.
http://flexworld.wordpress.com/2007/02/03/flex-builder-crash-due-to-multiple-logins/
UPDATE: I reinstalled Flex Builder 2 as JabbyPanda suggested and I'm now back in business. Not sure what the cause was.
5 commentsSecurity error accessing url
[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"]
Problem:
By default the Flash Player allows your site to retrieve data from your domain only. However, when developing with Flash tools, you'll notice that you can point to and pull in data from anywhere. This is because the Flash software grants you special permission for testing purposes. When you put your site on a server "localhost" or "www.anydomain.com", the Flash Player places a security sandbox around it and displays this error when you reach outside of it.
So for example if your Flash site is uploaded to www.flexcapacitor.com and it makes a call to www.google.com/maps.php then an error is thrown because www.flexcapacitor.com and www.google.com are two different domains. If maps.php was on www.flexcapacitor.com in the same directory as your Flash site then because both resources are on the same domain, you are allowed access to the resources there.
-
<!-- SWF is on http://www.server2.com. Correct - Look at url. -->
-
<mx:HTTPService url="http://www.server2.com/page.php" />
-
-
<!-- SWF is on http://www.server2.com. INCORRECT. Look at url. -->
-
<mx:HTTPService url="http://www.google.com/page.php" />
Note: The following URL's, "http://www.flexcapacitor.com" and "http://flexcapacitor.com" are two different domains according to the Flash Player. This includes subdomains. You may want to redirect calls from, "yourdomain.com" to "www.yourdomain.com" or vice versa. Your domain may have an option like this:
<em>How do you like the www in your URL?
- Both http://www.domain.com/ and http://domain.com/ work.
- Add "www." if somebody goes to http://domain.com/
- Remove "www." if somebody goes to http://www.domain.com/</em>
Solutions:
- Add a cross domain policy file on the domain you are calling. Your swf can access resources on other domains if the other domain grants your permission. They do this through a cross-domain file. This is a simple xml file on the other domain (yes, they have to set it up) that says what domains can access what content. Some sites already have cross-domain policy files setup. Here is an <a href="http://www.flexcapacitor.com/content/crossdomain.xml">example</a>. More info <a href="http://curtismorley.com/2007/09/01/flash-flex-tutorial-how-to-create-a-crossdomainxml-file/">here...</a>
- Using a proxy page. You place the proxy page on your site and then you call it. It then gets the remote sites page and passes that back to your page on your server. There are numerous examples online. Here is <a href="http://www.switchonthecode.com/tutorials/using-a-php-proxy-with-flex-to-talk-cross-domain">one...</a>
- Grant the swf permission to access remote sites via the Flash Player Global Security Settings. You can change the security sandbox setting on a file or folder manually. This is useful if you are testing a SWF locally and want to grant it permission to pull data from a remote domain. To do this, open the SWF in the browser. Right click on the SWF and choose settings. In the Security tab (default) choose Advanced. This will take you to a site that displays the Flash Player's settings. On the left column choose Global Settings and then add the file or folder of the swf you are testing. Typically this will be something like, "c:/projects/flex/bin-debug/", "users/judah/documents/flex/bin-debug/" or "http://localhost/". From now on your swf can access data on sites it's not hosted on but remember this solution only grants that specific directory or file on your computer access to remote sites. This change doesn't affect anyone other computer than your own. You will still need to employ another solution listed here.
More info can be found <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14213&sliceId=1">here</a>.
<em>Please reply in the comments below if this helped you or not. </em>
7 commentsWhite space is required between the processing instruction target and data.
White space is required between the processing instruction target and data.
Something in my code was confusing the designer. I wasn't able to move or add any controls. After a while I got the above error. When I looked at the MXML it had changed to:
-
<?xwww.adobe.com/2006/mxml" layout="absolute"
-
xmlns:ns1="com.flexcapacitor.controls.*" backgroundColor="#f6f6f6" backgroundGradientColors="[#f6f6f6, #bbbbbb]">
I changed it back to this:
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx :Application xmlns:mx="http://www.adobe.com/2006/mxml"
-
layout="absolute"
-
xmlns:ns1="com.flexcapacitor.controls.*"
-
backgroundColor="#f6f6f6"
-
backgroundGradientColors="[#f6f6f6, #bbbbbb]"></mx:Application>
and put everything on it's own line. This seems to have fixed the problem.
No commentsError: could not find source for class in namespace
Error
could not find source for class com.flexcapacitor.managers.ParameterProperty
Occurs
This occurs when Flash Builder can't find the source for a class that is specified usually in a linked library.
Solution
Point to the right class. This usually is resolved by checking the libraries included or checking the paths to the file that is mentioned is missing.
Case 1
I moved the class to a new package when this error appeared. My project was linked to a library project where the class was located. It wasn't there anymore of course.
The solution was to open up the library class and select all the classes again. Because I moved the class it was no longer selected in the swc export package. Try this:
1. Open the Library project
2. Open Library Project Properties
3. Flex Library Build Path
4. In the Classes tab select all the classes
When you apply this changes this should build a new swc. Refresh your project.
Case 2
ANT can't find a file giving the same error as above.
Buildfile: C:\projects\flex\DraggableLabel\flexant-build.xml
Create ASDocs:
[exec] Loading configuration file C:\projects\flex\flexcapacitor\FlexSDK2Hotfix2\frameworks\flex-config.xml
[exec] Error: could not find source for class com.flexcapacitor.controls.DraggableLabel.
BUILD FAILED
C:\projects\flex\flexcapacitor\flexant-library.xml:124: exec returned: 1
Total time: 1 second
---
The problem was solved by including the basedir or "./" or "." in the source-path argument. See below.
-
<target name="Create ASDocs">
-
-
<exec executable="${ASDOCS}" failonerror="true">
-
<arg line='-doc-classes ${componentClasses}'/>
-
<arg line='-source-path ${basedir} ${componentSource}'/>
-
<arg line='-namespace http://www.flexcapacitor.com/2007/mxml ${basedir}/manifest.xml'/>
-
<arg line='-window-title "${windowTitle}"'/>
-
<arg line='-main-title "${mainTitle}"'/>
-
<arg line="-output ${asdocsDirectory}"/>
-
<arg line='-package ${componentPackage} "${componentPackageTitle}"'/>
-
</exec>
-
-
</target>
-
-
-
<!-- incorrect -->
-
<arg line='-source-path ${componentSource}'/>
-
-
<!-- correct -->
-
<arg line='-source-path ${basedir} ${componentSource}'/>
-
<arg line='-source-path base/path/ my/directory'/>
-
<arg line='-source-path "./base/path/ my/directory"'/>
Parse error at ‘\n\\\n\t\n\t’.
Error:
Parse error at '\n\\\n\t\n\t'. HTMLComponent/src HTMLInPopUp.mxml line 201
Case:
The following line started producing errors in my application and I couldn't figure out why.
-
// the error was on this line,
-
<filters:DropShadowFilter id="drop1" distance="3" blurX="6" blurY="6" alpha=".6"/>
-
\
Solution:
The problem was that someone (not me) had typed in a backslash "\" on the next line when I wasn't looking. Removing the backslash removed the error.
Whitespace is not allowed before an XML Processing Instruction
Whitespace is not allowed before an XML Processing Instruction (< ? ... ?>). HTMLComponent
Sigh... The problem is that there was whitespace before the xml processing instruction just like the error stated...
-
.
-
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx :Application xmlns:mx="http://www.adobe.com/2006/mxml"
-
layout="absolute"
-
xmlns:fc="com.flexcapacitor.controls.*"
-
xmlns:local="*"
-
backgroundColor="#FFFFFF"
-
backgroundGradientColors="[#417daf, #ffffff]"
-
xmlns:filters="flash.filters.*">
Notice that the there is a line before the < ?xml ?> tag.
1 comment