Flash Action Script Error Repository

A library of solutions to Actionscript, Flash, Flex and AIR

Archive for the 'Uncategorized' Category

ReferenceError: Error #1069: Property leadingModel not found on String and there is no default value.

ReferenceError: Error #1069: Property leadingModel not found on String and there is no default value.
at flashx.textLayout.elements::LinkElement/computeLinkFormat()[C:\Vellum\branches\v1\1.0\dev\output\openSource\textLayout\src\flashx\textLayout\elements\LinkElement.as:437]

Incorrect Code:

XML:
  1. <s:RichEditableText x="92" y="22" color="#2b4381" editable="false" fontFamily="Myriad Pro" fontSize="17" whiteSpaceCollapse="preserve">
  2.         <s:textFlow>
  3.             <s:TextFlow>
  4.                 <s:linkActiveFormat>
  5.                 </s:linkActiveFormat>
  6.                 <s:p>
  7.                     <s:a href="http://google.com"><s:span color="#f77d0e" textDecoration="none">link</s:span></s:a>
  8.                 </s:p>
  9.             </s:TextFlow>
  10.         </s:textFlow>
  11.     </s:RichEditableText>

Correct:

XML:
  1. <s:RichEditableText x="92" y="22" color="#2b4381" editable="false" fontFamily="Myriad Pro" fontSize="17" whiteSpaceCollapse="preserve">
  2.         <s:textFlow>
  3.             <s:TextFlow>
  4.                 <s:p>
  5.                     <s:a href="http://google.com"><s:span color="#f77d0e" textDecoration="none">link</s:span></s:a>
  6.                 </s:p>
  7.             </s:TextFlow>
  8.         </s:textFlow>
  9.     </s:RichEditableText>

No comments

The project description file (.project) for ‘MyFlexProject’ is missing

The project description file (.project) for 'MyFlexProject' is missing. This file contains important information about the project. The project will not function properly until this file is restored.

This error appeared when I copied my Flex project from a PC to a Mac computer. The first thing to do is look to see if the file is really there or not. In the Finder (a rough equivalent of Windows Explorer) the project directory is not showing any .project file.

Incorrect:
I copied all the flex projects (folders) from my old workspace on my pc and placed them in a new directory on my mac. Then I changed the workspace in Flex Builder 3 to point to that new folder.

Correct:
Method 1
I should have copied all the flex projects (folders) from my old workspace on my pc and placed them in a new directory on my mac. Then in Flex Builder 3 goto File > Import > Other > General > Existing Projects into Workspace > Root folder that contains the flex projects.

Method 2
If I have a single project then export that project as a Flex Archive (only available in Flex Builder 3 or greater). Then in Flex Builder 3 on the second computer goto File > Import > Flex Archive and point to the file.

No comments

ActionScript Warning #1100

Warning: 1100: Assignment within conditional. Did you mean == instead of =?

Description:
AS3 warning 1100 is Adobe watching out for you and helping you out. Flash/Flex let's you know that you are assigning a variable while at the same time evaluating to see if it is true. This AS3 warning is quite easy to understand and well written.

Fix:
To solve Flex/Flash Warning 1100 all you need to do is add another " = " sign inside your conditional making 2 == rather than just one.

Bad Code 1:

Actionscript:
  1. if (topFive[i]="one") {

Good Code 1:

Actionscript:
  1. if (topFive[i]=="one") {

No comments

Element type must be followed by either attribute specifications

Element type "ns1:MyComponent" must be followed by either attribute specifications, ">" or "/>".

XML:
  1. <ns1 :MyComponent id="myframe"
  2.     fontSize="10
  3.     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 comment

Design 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 comments

Error: 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.

Actionscript:
  1. // paths causing the error
  2. C:\Documents and Settings\Judah\My Documents\Flex Builder 2\my project
  3. C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2
  4.  
  5. // path that works with asdocs
  6. C:\flexprojects\myproject
  7. C:\flexprojects\flexcapacitor\FlexSDK2

Thanks to Jesse for his help in his post here.

XML:
  1. <!-- Example Asdocs -->
  2. <project name="asdoc" default="main" basedir=".">
  3.         <!-- The Location of FlexSDK on your Computer -->
  4.         <property name="FLEX_HOME" location="C:\flexprojects\flexcapacitor\FlexSDK2/>
  5.  
  6.         <!-- The Location of ASDocs on your Computer -->
  7.         <property name="AsDocs" location="${FLEX_HOME}\bin\asdoc.exe"/>
  8.  
  9.         <!--
  10.         The Location of your Application Classes on your Computer
  11.         NOTE: This Path should be reletive to the build.xml file.
  12.         NOTE: ${basedir} is an ant property that represents the directory holding the build.xml file
  13.         NOTE: I have encountered issues with this folder containing Spaces
  14.         -->
  15.         <property name="dir.src" location="${basedir}"/>
  16.  
  17.     <!--
  18.         The Location you wish to output distribution files to on your Computer
  19.         -->
  20.         <property name="dir.dist" location="${basedir}\dist" />
  21.  
  22.         <target name="compile">
  23.         <exec executable="${AsDocs}" failonerror="true">
  24.          <arg line='-doc-classes com.flexcapacitor.controls.DraggableLabel'/>
  25.          <arg line='-source-path ${dir.src}'/>
  26.          <arg line='-namespace http://www.flexcapacitor.com/2007/mxml ${dir.src}/manifest.xml'/>
  27.          <arg line='-output ${dir.asdocs}'/>
  28.          <arg line='-package com.flexcapacitor.controls "Flex Capacitor controls classes."'/>
  29.          <arg line='-package com.flexcapacitor.managers "Flex Capacitor managers classes."'/>
  30.         </exec>
  31.         </target>
  32. </project>

No comments

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...

XML:
  1. // caused error
  2. <fc:Countdown id="endOfWorkDay1" updateInterval="ten hundredths" backgroundAlpha="0.0" borderThickness="0"
  3.         targetDate="{endOfWorkDay()}"
  4.         text="23 hours 59 min 59 sec 999 ms"
  5.         runtimeText="[h] hours [m] min [s] sec [ms] ms until 5pm" fontWeight="bold" x="365" y="288" height="33" styleName="candlesFont"/>
  6.  
  7. // fixed error
  8. <fc:Countdown id="endOfWorkDay1" updateInterval="ten hundredths" backgroundAlpha="0.0" borderThickness="0"
  9.         targetDate="{endOfDay()}"
  10.         text="23 hours 59 min 59 sec 999 ms"
  11.         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

1 comment

An error has occured. See error log for more details.

An error has occured. See error log for more details.

An error has occurred

An error has occurred

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 comments

Security 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.

XML:
  1. &lt;!-- SWF is on http://www.server2.com. Correct - Look at url. --&gt;
  2. &lt;mx:HTTPService url="http://www.server2.com/page.php" /&gt;
  3.  
  4. &lt;!-- SWF is on http://www.server2.com. INCORRECT. Look at url. --&gt;
  5. &lt;mx:HTTPService url="http://www.google.com/page.php" /&gt;

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 comments

White 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:

XML:
  1. <?xwww.adobe.com/2006/mxml" layout="absolute"
  2.     xmlns:ns1="com.flexcapacitor.controls.*" backgroundColor="#f6f6f6" backgroundGradientColors="[#f6f6f6, #bbbbbb]">

I changed it back to this:

XML:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx :Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3.     layout="absolute"
  4.     xmlns:ns1="com.flexcapacitor.controls.*"
  5.     backgroundColor="#f6f6f6"
  6.     backgroundGradientColors="[#f6f6f6, #bbbbbb]"></mx:Application>

and put everything on it's own line. This seems to have fixed the problem.

No comments

Error: 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.

XML:
  1. <target name="Create ASDocs">
  2.  
  3.         <exec executable="${ASDOCS}" failonerror="true">
  4.                 <arg line='-doc-classes ${componentClasses}'/>
  5.                 <arg line='-source-path ${basedir} ${componentSource}'/>
  6.                 <arg line='-namespace http://www.flexcapacitor.com/2007/mxml ${basedir}/manifest.xml'/>
  7.                 <arg line='-window-title "${windowTitle}"'/>
  8.                 <arg line='-main-title "${mainTitle}"'/>
  9.                 <arg line="-output ${asdocsDirectory}"/>
  10.                 <arg line='-package ${componentPackage} "${componentPackageTitle}"'/>
  11.         </exec>
  12.  
  13.     </target>
  14.  
  15.  
  16. <!-- incorrect -->
  17. <arg line='-source-path ${componentSource}'/>
  18.  
  19. <!-- correct -->
  20. <arg line='-source-path ${basedir} ${componentSource}'/>
  21. <arg line='-source-path base/path/ my/directory'/>
  22. <arg line='-source-path "./base/path/ my/directory"'/>

No comments

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.

XML:
  1. // the error was on this line,
  2. <filters:DropShadowFilter id="drop1" distance="3" blurX="6" blurY="6" alpha=".6"/>
  3. \

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.

No comments

Next Page »