Showing posts with label Flex 4. Show all posts
Showing posts with label Flex 4. Show all posts

Sunday, August 09, 2009

Debugging TLF source code

No comments :
Best way to understand what code is doing is to debug it and call certain methods, put some breakpoints and see what is happening inside functions. TLF source is separated in 4 different projects and flash builder allows to add only single source path(as of now in my understanding). So, to debug the source, I had to do few settings to make it work.
I was getting the error 1120: Access of undefined property debug. Then I explored the build file(ant script), which is used to build the swc file. There I found two arguments passed to compc:
<define name="CONFIG::debug" value="${dbg}"/>
<define name="CONFIG::release" value="${rel}"/>
greenshot_2009-08-06_17-16-24
Now, what define does ?
compiler.define: define a global AS3 conditional compilation definition, e.g. -define=CONFIG::debugging,true or -define+=CONFIG::debugging,true (to append to existing definitions in flex-config.xml) -->
I added the following arguments in Additional Compiler Arguments to make my Project problems free.-define+=CONFIG::debug,true -define+=CONFIG::release,false
greenshot_2009-08-06_17-48-12 


 





Then it followed with the following errors:


1046: Type was not found or was not a compile-time constant: ContentElement


1046: Type was not found or was not a compile-time constant: GroupElement


1046: Type was not found or was not a compile-time constant: TextBlock


1046: Type was not found or was not a compile-time constant: TextLine


It was obvious, as these all classes are new, so its a Flash Player mismatch in my settings, after changing my flash player version from flash player 9 to flash player 10, all Problems are gone.





Hope this helps someone who is struggling to debug the tlf source code.

Read More

Sunday, July 26, 2009

Flash Text got better

No comments :

TLF is a Text Layout Framework to handle some complex text, selection, editing. It can be used with Flash Professional or Flex. It is framework agnostic as the entire API is in as3 so it can be used with either flex framework or framework which is available in Flash Professional. TLF is a wrapper on top of FTE(Flash Text Engine), which is new in Flash Player 10. TLF renamed many times, it was previously known as Text Layout Foundation/vellum and now Text Layout Framework.

When to use FTE ?

Flash Text Engine deals with Line and Paragraph Layout and TextLine rendering. When you need only static text then its best to make use of FTE.

When to use TLF ?

When you want to deal with Paragraph Layout, Selection, Editing then make use of TLF. TLF has a markup for text, which can be parsed using E4X. Its basically XML.

Where to find TLF Source?

You will have to checkout from SVN, instructions and other details are available at the below location:

http://opensource.adobe.com/wiki/display/tlf/Text+Layout+Framework

How to get started, which classes I should use etc ?

Below are links to some post I found useful to understand TLF:

http://corlan.org/2009/01/19/how-to-use-text-layout-framework-in-flex-32-or-air-15/

http://corlan.org/2009/02/12/how-to-add-a-scrollbar-to-text-layout-framework/

http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html

and I found a nice presentation from one of TLF engineer, Robin Briggs. You can watch it here:

Text Component Library for Flash Player 10

Demo:

http://labs.adobe.com/technologies/textlayout/demos/

Thanks for stopping by, I will be writing few articles on TLF, keep checking or follow on twitter to get updates.

Cheers,

Chetan Sachdev

Read More

Tuesday, May 19, 2009

Required skin part area cannot be found.

No comments :

Problem:

Error: Required skin part area cannot be found.
at spark.components.supportClasses::SkinnableComponent/findSkinParts()[C:\flexsource\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:549]
at spark.components.supportClasses::SkinnableComponent/loadSkin()[C:\flexsource\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:524]
at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[C:\flexsource\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:280]
at spark.components.supportClasses::SkinnableComponent/createChildren()[C:\flexsource\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:250]
at com.riageeks.geek::GeekBase/createChildren()[C:\geek\GeekBase.as:130]
at mx.core::UIComponent/initialize()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:6510]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:6402]
at mx.core::UIComponent/addChildAt()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:6109]
at spark.components::Group/addItemToDisplayList()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Group.as:1588]
at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Group.as:1153]
at spark.components::Group/setMXMLContent()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Group.as:409]
at spark.components::Group/set mxmlContent()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Group.as:359]
at spark.components::SkinnableContainer/set mxmlContent()[C:\flexsource\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:563]
at spark.components::SkinnableContainer/createDeferredContent()[C:\flexsource\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:1084]
at spark.components::SkinnableContainer/createContentIfNeeded()[C:\flexsource\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:1098]
at spark.components::SkinnableContainer/createChildren()[C:\flexsource\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:843]
at mx.core::UIComponent/initialize()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:6510]
at spark.components::Application/initialize()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Application.as:708]
at thingsapp/initialize()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\flexsource\frameworks\projects\framework\src\mx\managers\SystemManager.as:2263]
at mx.managers::SystemManager/initializeTopLevelWindow()[C:\flexsource\frameworks\projects\framework\src\mx\managers\SystemManager.as:3610]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[C:\flexsource\frameworks\projects\framework\src\mx\managers\SystemManager.as:3395]
at mx.managers::SystemManager/docFrameListener()[C:\flexsource\frameworks\projects\framework\src\mx\managers\SystemManager.as:3253]

Solution: In my case, I forgot to define a SkinPart for a component, you manually have to go through each Skin file and then verify which skin you missed in your component.

Read More

Thursday, May 14, 2009

ArgumentError: Undefined state 'up'.

No comments :

Problem:

ArgumentError: Undefined state 'up'.
at mx.core::UIComponent/getState()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:9030]
at mx.core::UIComponent/findCommonBaseState()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:9050]
at mx.core::UIComponent/commitCurrentState()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:8881]
at mx.core::UIComponent/creationCompleteHandler()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:10429]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:11262]
at mx.core::UIComponent/set initialized()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:1513]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\flexsource\frameworks\projects\framework\src\mx\managers\LayoutManager.as:757]

Solution: You have defined a skin for a component and that skin expects some states to be defined for the component. e.g. a Button expects 4 states to be defined in Skin. Below is a basic skin for a Button.

<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" >

<s:states>
<s:State name="up"/>
<s:State name="over"/>
<s:State name="down"/>
<s:State name="disabled"/>
</s:states>
<s:Rect height="100%" width="100%">
<s:fill>
<s:SolidColor color="#0000FF"/>
</s:fill>
</s:Rect>

</s:SparkSkin>
Read More

Error: Required skin part area cannot be found.

No comments :

Problem:

Error: Required skin part area cannot be found.
at spark.components.supportClasses::SkinnableComponent/findSkinParts()[C:\flexsource\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:549]
at spark.components.supportClasses::SkinnableComponent/loadSkin()[C:\flexsource\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:524]
at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[C:\flexsource\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:280]
at spark.components.supportClasses::SkinnableComponent/createChildren()[C:\flexsource\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:250]
at com.riageeks.geek.core::GeekBase/createChildren()[C:\riageeks\geek\trunk\geek\src\com\rg\geek\core\GeekBase.as:71]
at mx.core::UIComponent/initialize()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:6510]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:6402]
at mx.core::UIComponent/addChildAt()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:6109]
at spark.components::Group/addItemToDisplayList()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Group.as:1588]
at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Group.as:1153]
at spark.components::Group/setMXMLContent()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Group.as:409]
at spark.components::Group/set mxmlContent()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Group.as:359]
at spark.components::SkinnableContainer/set mxmlContent()[C:\flexsource\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:563]
at spark.components::SkinnableContainer/createDeferredContent()[C:\flexsource\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:1084]
at spark.components::SkinnableContainer/createContentIfNeeded()[C:\flexsource\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:1098]
at spark.components::SkinnableContainer/createChildren()[C:\flexsource\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:843]
at mx.core::UIComponent/initialize()[C:\flexsource\frameworks\projects\framework\src\mx\core\UIComponent.as:6510]
at spark.components::Application/initialize()[C:\flexsource\frameworks\projects\flex4\src\spark\components\Application.as:708]
at thingsapp/initialize()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\flexsource\frameworks\projects\framework\src\mx\managers\SystemManager.as:2263]
at mx.managers::SystemManager/initializeTopLevelWindow()[C:\flexsource\frameworks\projects\framework\src\mx\managers\SystemManager.as:3610]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[C:\flexsource\frameworks\projects\framework\src\mx\managers\SystemManager.as:3395]
at mx.managers::SystemManager/docFrameListener()[C:\flexsource\frameworks\projects\framework\src\mx\managers\SystemManager.as:3253]


Solution: In Gumbo, you define your skin part with either required=true or required=false. And then that skin need to be defined in your Skin file, which starts with "SparkSkin". If you have defined required=true then it should be defined out of the <Declarations> tag, if you have defined required=false, then it should be defined in <Declarations> tag. In both the cases, variable name and skin id should match (i.e. variable name defined in your source file and id given in Skin file)

Read More

Tuesday, May 12, 2009

Skin for * cannot be found

No comments :

Problem:

Error: Skin for riageekapp0 cannot be found.
at spark.components.supportClasses::SkinnableComponent/loadSkin()[E:\dev\i11.5\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:460]
at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[E:\dev\i11.5\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:240]
at spark.components.supportClasses::SkinnableComponent/createChildren()[E:\dev\i11.5\frameworks\projects\flex4\src\spark\components\supportClasses\SkinnableComponent.as:210]
at spark.components::SkinnableContainer/createChildren()[E:\dev\i11.5\frameworks\projects\flex4\src\spark\components\SkinnableContainer.as:797]
at mx.core::UIComponent/initialize()[E:\dev\i11.5\frameworks\projects\framework\src\mx\core\UIComponent.as:6632]
at spark.components::Application/initialize()[E:\dev\i11.5\frameworks\projects\flex4\src\spark\components\Application.as:678]
at thingsapp/initialize()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\i11.5\frameworks\projects\framework\src\mx\managers\SystemManager.as:2214]
at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\i11.5\frameworks\projects\framework\src\mx\managers\SystemManager.as:3558]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\i11.5\frameworks\projects\framework\src\mx\managers\SystemManager.as:3343]
at mx.managers::SystemManager/docFrameListener()[E:\dev\i11.5\frameworks\projects\framework\src\mx\managers\SystemManager.as:3201]


 



Solution: I was using different build of Gumbo, so the library(swc) created in one version was not able to found some classes. To fix this error, make sure that you are using same version of build for both your library(swc) and the application project.

Read More

Error #1053

No comments :

Error #1053:

VerifyError: Error #1053: Illegal override of skinParts in com.riageeks.comps.TestComponent.

at flash.display::MovieClip/nextFrame()
at mx.managers::SystemManager/deferredNextFrame()[E:\dev\i11.5\frameworks\projects\framework\src\mx\managers\SystemManager.as:349]
at mx.managers::SystemManager/preloader_initProgressHandler()[E:\dev\i11.5\frameworks\projects\framework\src\mx\managers\SystemManager.as:3230]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/timerHandler()[E:\dev\i11.5\frameworks\projects\framework\src\mx\preloaders\Preloader.as:418]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()


Solution: I was using different build of Gumbo, so the library(swc) created in one version was not able to found some classes. To fix this error, make sure that you are using same version of build for both your library(swc) and the application project.

Read More

Saturday, September 20, 2008

Configure Flex 4

No comments :

Flex 4 (Gumbo) is having nightly builds. And I can’t wait to download every nightly build, which is more than 100 MB. So, I did a checkout of Flex 4 and have build run on my machine. Its well document on how to do a build and setup you need to have, to run Flex 4 build.

Checkout of Flex 4 is more than 200 MB and for me it has taken approx 1 hour on 256 Kbps connection. I prefer to use Tortoise SVN Client to checkin and checkout. You can download it from  the link below:

http://downloads.sourceforge.net/tortoisesvn/TortoiseSVN-1.5.0.13316-win32-svn-1.5.0.msi?download

Install Tortoise SVN Client and then checkout from the link below:

http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/

To setup your system, you need to have the following installed on your machine:

  1. Cygwin (http://www.cygwin.com/setup.exe) (Approx 16 MB)
  2. J2SE 5.0_13 (http://java.sun.com/products/archive/j2se/5.0_13/index.html) File Name: jdk-1_5_0_13-windows-i586-p.exe (Approx 51 MB)
  3. Ant 1.7.0 (http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.0-bin.zip) (Approx 11 MB)

After downloading the above, follow this link:

http://opensource.adobe.com/wiki/display/flexsdk/Setup+on+Windows

C:\WINDOWS\system32\Macromed\Flash\FlashPlayerTrust\FlexSDK.cfg

Add D:\

 

Steps are Incomplete will be updating soon.

Read More

Sunday, July 20, 2008

What's new in Flex 4 (code name: Gumbo)

6 comments :

Below is a link to presentation by Matt Chotin about whats the plan
for Gumbo (Flex 4).
http://flexorg.wip3.adobe.com/gumbo/gumboplan.htm
and to see the Gumbo Architecture, follow the link below:
http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture
Interested in Gumbo Component Framework ? Go checkout from SVN
http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/

Read More