Pages: [1] 2
  Print  
Author Topic: :::CS5 Bug::: New CS5 Text Layout Framework Issues + Workaround  (Read 4192 times)
gfxcomplex
Gaia Novice
*
Posts: 4


« on: May 26, 2010, 09:56:49 PM »

I get two different errors at the preloading of a page that has a new TLF on it's stage.

The first error I get if I go directly to that page is

Illegal override of isRelatedObjectInaccessible in RemappedMouseEvent. ("goggling this will get you some flex errors related to the TLF").
in debug mod it says the error above is thrown  at com.gaiaframework.assets::PageAsset/decorate() and   at com.gaiaframework.assets::PageAsset/onComplete()

and some times I get this error ("dont know why this error vs that error").

TypeError: Error #1034: Type Coercion failed: cannot convert com.gfxcomplex.fox_architcts::PortfolioPage__Preloader__@d082f21 to com.gaiaframework.api.IPage.
   at com.gaiaframework.assets::PageAsset/decorate()
   at com.gaiaframework.assets::PageAsset/onComplete()

I put a MonsterDebugger.trace() call before everything in both PageAsset/decorate() and PageAsset/onComplete() and the trace was never called even though the error says it was thrown there.

I know this error is only related to the TLF on the stage since I only get the errors with it on the stage.

The fact I see a "isRelatedObjectInaccessible" error sometimes makes me think that some thing in gaia is checking the datatype of the text filed and is thinking it's an old fashion text filed and not a new TLF text filed. But since I cant find that code I cant say for sure.

I have tried to set the stage instance to auto create thinking that may fix it but with no luck.

I would like to use the new TLF, please look in to this.

Thanks.

« Last Edit: June 04, 2010, 12:15:45 PM by steven » Logged
Funkwarrior
Gaia User
**
Posts: 48


« Reply #1 on: May 27, 2010, 02:56:57 PM »

Same issue here...
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3863


gaiaframework
WWW
« Reply #2 on: May 27, 2010, 03:11:03 PM »

Sometimes, Flash throws misleading errors when it can't figure out the reason something didn't work. It makes you think the error is elsewhere, and since everything is running through Gaia, Gaia gets caught up in the stack trace.

Before I'm going to be convinced it's Gaia fault (which I doubt), you should simulate this by making a swf that loads another swf. In that loaded swf do your TLF stuff and see if you get errors.
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
gfxcomplex
Gaia Novice
*
Posts: 4


« Reply #3 on: May 28, 2010, 07:07:44 AM »

I have to be blunt with you, I'm not gonna spend to much of my time trying to fix the problem I found when using gaia with CS5 and the TLFTextField  I will just move on to a framework that works.  Now all of the being said cause you "doubt" my time and effort to explain the problem I had created  for you and need to be "convinced"

If gaia is not at fault why is it when I create the following it throws an error?

Reproduce the problem:
1: create new Gaia site.
2: Place new TLFTextField on home page stage. ("did this with pure AS3 and just by placing it on stage")
3: test project. ("throws error* at run time").

*error.
Gaia Framework (AS3) v3.2.2
TypeError: Error #1034: Type Coercion failed: cannot convert pages::HomePage__Preloader__@2f08a121 to com.gaiaframework.api.IPage.
   at com.gaiaframework.assets::PageAsset/decorate()
   at com.gaiaframework.assets::PageAsset/onComplete()
VerifyError: Error #1014: Class flash.text.engine::FontDescription could not be found.


Now I tried what you said  by just creating 2 swf files and loading the one that has a TLFTextField  on it's stage into the other. This works as you would think, just fine. But when I work with the gaia framework I get the error.

Now if you cant be bothered to look into this problem then I cant be bothered to continue to support gaia.

And for the record I have seen three other people state the same issue.   Angry
I cant imagine that gaia has got to were it is today by dismissing everyone who has ever stated a problem.

« Last Edit: May 28, 2010, 09:25:14 AM by gfxcomplex » Logged
bebber
Gaia Fan
***
Posts: 99



WWW
« Reply #4 on: May 28, 2010, 08:56:27 AM »

You should respect more Steven's work.
Gaia is here thanks to the great work made by him.
Logged
gfxcomplex
Gaia Novice
*
Posts: 4


« Reply #5 on: May 28, 2010, 09:23:22 AM »

Who said I don't respect Steven's work?
After all I use it and have advocated for it many times.

What I don't respect is the way I was dismissed when I reported a bug.
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3863


gaiaframework
WWW
« Reply #6 on: May 28, 2010, 10:25:23 AM »

Have you done what I asked? Have you created two swfs, one that loads the other, each with a document class, and put the TLF in the swf being loaded?

In other words, have you done your due diligence as a developer debugging something? You would not believe the number of times people post to the forum blaming Gaia when it ends up being an AS3 issue or some oversight on their part.

I asked you to help me help you. Gaia is not magic and it's not some crazy code. It's basic AS3. The main.swf loads other swfs. It's not rocket science, but you would not believe the number of components that are written that don't account for being loaded at runtime. Many Flash developers only ever use a single swf.

I have been a Flash developer a VERY long time. I'm not being arrogant when I say it's not Gaia's fault. Coercion errors are never Gaia's fault. That being said, I'm going to take a look at the issue myself and let you know what I find out.
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3863


gaiaframework
WWW
« Reply #7 on: May 28, 2010, 10:54:10 AM »

So here's what I've found out in just a few minutes.

The issue has to do with Adobe's TLF engine implementation.  They wrote their own custom preloader to load the runtime shared library that contains the TLF engine.

The issue specifically is that you cannot cast a swf as an interface when using the TLF engine. This has nothing to do with Gaia.  This is not Gaia's fault.

I will report this to the Flash team.

Here's a simple example to prove that it has nothing to do with Gaia.

Make a main.fla and give it this document class:

Code:
package
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.events.Event;
import flash.net.URLRequest;

public class Main extends MovieClip
{
private var loader:Loader;

public function Main()
{
super();
init();
}
private function init():void
{
addChild(loader = new Loader());
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
loader.load(new URLRequest("other.swf"));
}
private function onLoadComplete(event:Event):void
{
ICustom(loader.content).customFunc();
}
}
}

Make other.fla and give it this document class:

Code:
package
{
import flash.display.MovieClip;
import fl.text.TLFTextField;

public class Other extends MovieClip implements ICustom
{
public var TLF_Foo:TLFTextField;

public function Other()
{
super();
}
public function customFunc():void
{
trace("custom func called");
}
}
}

Here's the ICustom interface class:

Code:
package
{
public interface ICustom
{
function customFunc():void;
}
}

This is what you will see.

Code:
TypeError: Error #1034: Type Coercion failed: cannot convert Other__Preloader__@2dedf121 to ICustom.
at Main/onLoadComplete()

I'm glad you ran into this. It's a nasty bug that the Flash team needs to fix.
« Last Edit: May 28, 2010, 11:55:56 AM by steven » Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3863


gaiaframework
WWW
« Reply #8 on: May 28, 2010, 11:39:24 AM »

It's actually much worse than I originally thought.  You can't even call public functions on a loaded swf that uses the TLF engine.

http://www.stevensacks.net/2010/05/28/flash-cs5-tlf-engine-causes-errors-with-loaded-swfs/
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3863


gaiaframework
WWW
« Reply #9 on: May 28, 2010, 12:17:15 PM »

The workaround is to go into your AS3 settings and change the Runtime Shared Library Default linkage to "Merged Into Code" for any page .flas that use TLF.  This will increase the size of your swf by 125k, though.

You might be able to put it into index and share it using ApplicationDomain current, but I'm not sure yet.
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
gfxcomplex
Gaia Novice
*
Posts: 4


« Reply #10 on: May 28, 2010, 01:07:22 PM »

Sorry I came off as a dick,  I really thought you were just blowing me off.
Thanks for looking into it for me.

Your right this is way bigger a problem then it should be.

I don't fully understand the problem with it. Is this a crossdomain issue with the Runtime shared lib?
My problem is that I never used runtime shard libs before.

Logged
fixedmachine
Gaia User
**
Posts: 12


fixedmachine
« Reply #11 on: May 31, 2010, 09:58:21 PM »

Here is the solution:
http://kb2.adobe.com/cps/838/cpsid_83812.html

I've tested first one with setting "Custom preloader loop" and moving everything to frame #2 - it's working.

Edit:
I've tested SafeLoader with Gaia and it's working fine too.
I've just replaced Loader with SafeLoader in DisplayObjectAsset and IDisplayObject.
« Last Edit: June 01, 2010, 05:48:31 PM by fixedmachine » Logged
WideC
Gaia User
**
Posts: 37


« Reply #12 on: June 03, 2010, 01:27:32 AM »

I just felt I have to write this. Respect, respect people. No need to get so upset that fast.
The amount of work Steven put into to GAIA is really amazing!!!

Niklas
Logged
marcelebrate
Gaia Novice
*
Posts: 4


« Reply #13 on: June 08, 2010, 09:29:15 PM »

Can anyone provide a zipped working example of this? Despite a day's worth of efforts, I have not been able to get this to work. I have a feeling there's some combination of settings I am missing and it'd be great to compare.

I have tried both solutions in the Adobe TechNote – both merging the RSL into the code while moving assets and classes to frame 2 as well as replacing the Loader instances in IDisplayObject and DisplayObjectAsset with SimpleLoader. Both still result in my getting a "VerifyError: Error #1014: Class flash.text.engine::FontDescription could not be found."

My process thus far:
 1. Create a new Gaia site from scratch and scaffold with default site.xml.
 2. Add new TLF textfield in Flash CS5 IDE at Frame 1 (using ActionScript transitions)
 3. Publish.

No compile errors but I get the FontDescription error at runtime. Both TechNote solutions give me the same result.

I understand this is a Flash/TLF issue and not a Gaia issue, but people using the Gaia framework seem to be the first folks running into this issue and solving it.

Thanks in advance!

-Marcel Ray

(For what it's worth, I am already Gaia donor/license holder.)
Logged
marcelebrate
Gaia Novice
*
Posts: 4


« Reply #14 on: June 08, 2010, 10:26:57 PM »

I think I pinpointed my issue when creating a project from scratch.

Gaia was setting main.fla and preload.fla to target Flash Player 9 instead of Flash Player 10, despite my selecting FP10 in the project setup (I triple checked). Once I changed the both of them to target Flash Player 10 and republished, my home.fla and its TLF content loaded without issue.

Hopefully this helps someone else since, in this case, it was a minor issue with an initial Gaia project that could easily be overlooked.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc