Using SDK 4.5.0.20967
The error is thrown on line 3182:
while (containerListIndex == -1 && floatIndex > 0)
{
floatIndex--;
floatInfo = _composedFloats[floatIndex - 1];
containerListIndex = _floatsInContainer.indexOf(floatInfo.graphic);
}
floatIndex is 1 when it enters the loop,
then it is decresed to 0,
then null gets assigned to floatInfo - when it is looking for: _composedFloats[-1]
Then it throws an error when it tries to access a property on floatInfo - which is set to null
Here is the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::updateGraphics()[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flas hx\textLayout\container\ContainerController.as:3182]
I am not sure exactly how I am triggering this - I am trying to discern that - but if you have any thoughts - please let me know.
Here is an example of the bug, the yellow box in the TextFlow is an InlineGraphicElement.
Click the red box at the bottom of the flow to start adding text.
It crashes once the InlineGraphicElement is pushed out of the visible area of the container.
http://www.theyrule.net/test/tlf_images/SingleContainerTest.swf
This was published using the SDK 4.5.0.20967
Here is the same file published with HERO - which still has the other inlineGraphic alignment problem - but does not have the runtime error:
http://www.theyrule.net/test/tlf_images/SingleContainerTestHero.swf
Here is the source:
package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.events.MouseEvent; import flash.system.System; import flash.text.TextField; import flash.text.TextFormat; import flashx.textLayout.container.ContainerController; import flashx.textLayout.container.ScrollPolicy; import flashx.textLayout.edit.EditManager; import flashx.textLayout.elements.DivElement; import flashx.textLayout.elements.InlineGraphicElement; import flashx.textLayout.elements.ParagraphElement; import flashx.textLayout.elements.SpanElement; import flashx.textLayout.elements.TextFlow; import flashx.textLayout.formats.TextLayoutFormat; import flashx.textLayout.formats.VerticalAlign; import flashx.textLayout.tlf_internal; import flashx.undo.UndoManager; use namespace tlf_internal; [SWF (width="500", height="700", backgroundColor="#FFFFFF")] public class SingleContainerTest extends Sprite { protected var tf:TextFlow; protected var em:EditManager; protected var um:flashx.undo.UndoManager protected var _bg:Sprite; protected var _spr:Sprite; protected var _cc:ContainerController protected var _init_fmt:TextLayoutFormat; protected var _btn:Sprite; protected var _playing:Boolean = false; protected var _count:int = 0; protected var _graph:Sprite; protected var _print_out:TextField; protected var _last_time:Date = new Date(); protected var _last_five:Array = []; public function SingleContainerTest() { stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; var cw:Number = 200; // the container width var ch:Number = 600; // the container height _bg = new Sprite(); _bg.graphics.lineStyle(.25, 0); _bg.graphics.drawRect(0,0,cw,ch); addChild(_bg); _spr = new Sprite(); addChild(_spr); _graph = new Sprite(); _graph.x = cw + 10; _graph.y = 250; addChild(_graph); _print_out = new TextField(); var fmt:TextFormat = _print_out.defaultTextFormat; fmt.font = "_sans"; _print_out.wordWrap = true; _print_out.multiline = true; _print_out.width = stage.stageWidth - (10 + _graph.x); _print_out.x = _graph.x; _print_out.y = _graph.y + 10; addChild(_print_out); //define TextFlow and manager objects tf = new TextFlow(); um = new UndoManager(); em = new EditManager(um); tf.interactionManager = em; //compose TextFlow to display _cc = new ContainerController(_spr,cw,ch); //_cc.verticalAlign = VerticalAlign.BOTTOM; //_cc.verticalScrollPolicy = ScrollPolicy.ON; tf.flowComposer.addController(_cc); tf.flowComposer.updateAllControllers(); //make a button to add Inline Graphic elements _btn = new Sprite(); _btn.graphics.beginFill(0xFF0000,1); _btn.graphics.drawRect(0,0,120,30); addChild(_btn); _btn.addEventListener(MouseEvent.CLICK, btnClicked); _btn.y = 600; addMessage("1"); addMessage("2"); addMessage("3", true); } public function addMessage(msg:String, add_image:Boolean = false):void { //define elements to contain text var d:DivElement = new DivElement(); var p:ParagraphElement = new ParagraphElement(); var s:SpanElement = new SpanElement(); s.text = msg; //add these elements to the TextFlow p.addChild(s); d.addChild(p); if(add_image){ var sp:Sprite = new Sprite(); sp.graphics.beginFill(0xFFCC00); sp.graphics.drawRect(0,0,100,20); var i:InlineGraphicElement = new InlineGraphicElement(); i.source = sp; i.width = 100; i.height = 20; p.addChild(i); } tf.addChild(d); tf.flowComposer.updateAllControllers(); _cc.verticalScrollPosition = _cc.getContentBounds().height; tf.flowComposer.updateAllControllers(); } protected function btnClicked(e:MouseEvent):void { _playing = !_playing; removeEventListener(Event.ENTER_FRAME, onEnterFrame); if(_playing){ addEventListener(Event.ENTER_FRAME, onEnterFrame); } } protected function onEnterFrame(e:Event):void { _count++; if(_count > 100){ tf.removeChildAt(0); } addMessage("Message Number: " + _count + " " + randomString()); printOut() } protected function printOut():void { var now:Date = new Date(); var tm:Number = (now.getTime() - _last_time.getTime()); _last_five.push(tm); if(_last_five.length > 10) _last_five.shift(); var avg_tm:Number = 0; for(var i:int = 0; i < _last_five.length; i++) avg_tm += _last_five[i]; avg_tm = Math.round(avg_tm/_last_five.length); var elapsed_str:String = "message: \t\t\t"+_count + "\ntime: \t\t\t\t" + tm + "ms" + "\navg of last 10:\t\t" + avg_tm +"ms"; //trace(elapsed_str ); _print_out.text = elapsed_str; _last_time = now; drawGraph(tm); } protected function drawGraph(tm:Number):void { if(_count % 5 == 0){ _graph.graphics.beginFill(0x0); _graph.graphics.drawRect(_count/10,-Math.round(tm/10),1,1); _graph.graphics.beginFill(0xFF0000); _graph.graphics.drawRect(_count/10,-Math.round(System.totalMemory/1000 000),1,1); } } protected function randomString():String { var chars:String = "abcdefghijklmnopqrstuvwzyz "; var chars_len:Number = chars.length; var random_str:String = ""; var num_chars:Number = Math.round(Math.random() * 100); for (var i:int =0; i < num_chars; i++){ random_str = random_str + chars.charAt(Math.round(Math.random() * chars_len)); } return random_str; } } }
I will ask my workmate whether we can release a 3.0 tlf on https://sourceforge.net/adobe/tlf/home/ next week.
I'm not sure the time point is all right. Pls wait for the reply.
Thanks,
Will this fix be back ported into TLF 2.x?
We are looking for a stable version of TLF 2 to get out our next release, scheduled for June 1.
We would also like to make use of a common RSL swz file such as:
http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232 .swz
I can not find a work around to this bug.
I have updated our code to use TLF 2 - but cannot deploy it because of this.
We are in a bind.
There are a growing number of complaints in this forum about this bug - I suspect it will be widespread.
There is no version of TLF 2 available which is usable - I think it would be a great mistake not to back-port the fix for this bug into TLF 2.
We have realized our mistake and want to back port the fix to the the old version of TLF. It need a lot of tests and processes. And we cannot control the time point when flex team will pick up our build. TLF and Flex are not the same team. We are begging flex team to pick up new TLF build these days...Picking up new build also need a lot of test.
1. Yes.
2. TLF 2.1 will be on http://sourceforge.net/projects/tlf.adobe/files this week.
Thanks I see the latest TLF 2.1 files. It still hasn't been included in the Flex SDK - is there any indication that it will be?
Also I could not find an Adobe hosted swz file at: http://fpdownload.adobe.com/pub/swz/tlf/2.1.0.006/textLayout_2.1.0.006 .swz
I came up with that URL from the BUILD and BRANCH numbers in the TextLayoutVersion class - which correspond in the 2.0 builds e.g: http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232 .swz
Is there any indication when TLF 3.0 will be included in the Flex SDK or in the IDE?
Thanks
I uploaded a SWZ to https://sourceforge.net/projects/tlf.adobe/files/2.1/6/
PS: I don't think sourceforge.net can be RSL server, because it redirects you to a new link when downloading and there is time stamp within the redirection link.
You may want to find a server for yourself.
No free service will tolerate hosting this file - we have a 1 gigabit per second connection which would be saturated by this. I understood that the point of hosting these files on the Flash player server was that Adobe was treating these swz files much like the player itself. Something that can be downloaded once and cached and is useful for multiple third parties. One of the reasons that we adopted TLF in the first place was because despite the fact that it had a large Actionscript overhead - that code would be centrally hosted by Adobe and used by many third party sites.
Is there anyway that you can have this swz hosted at the regular location: http://fpdownload.adobe.com/pub/swz/tlf/...
Usually, Flex SDK pick up one build of tlf and then upload the swz to that server.
We will have a try.
But I prefer to upload a tlf 3.0 swz, because I think for now using 2.1 is meaningless.
1. There is still RTE found in 2.1, but which cannot be reproduced in 3.0.
2. In 3.0, there are only one simple feature, performance enhancement and dozens of bug fixes. We did not change the framework and APIs. Since both 2.1 and 3.0 have never go through the tests of Flex SDK, why not to choose 3.0.
3. We are focusing on and sell our 3.0 and don't plan to make any changes on 2.1.
I'd like to +1 the questions about integrating the tlf 2.1 (waiting for the 3.0swz) to my project.
In flashBuilder i have 3 projects:
2 library projects representing my appFramework (core and utils)
1 appProject
In my libraries projects the framework linkage is external.
In parallele in my app Project
So far no luck
I also tried in a release build i did to savagely paste textLayout_2.1.0.6.swz and rename it like the 2.0... one i had (I thought it worked for a second but unfortunatly didn't)
Any hints on a way to use the fixed lib instead of the 2.0 ?
Thanks in advance
In my libraries projects the framework linkage is external.
- I tried to remove textLayout.swc from the flex4.5 linkage and add the one provided here:http://sourceforge.net/projects/tlf.adobe/files/2.1/6/textLayoutBuild. zip (the libs/textLayout.swc file)
- I also tried to replace the swc file in my flex lib : flex4.5\frameworks\libs
In parallele in my app Project
- I changed the RSL and crossdomain URL to one of my server's URL where i uploaded the swz you linked http://sourceforge.net/projects/tlf.adobe/files/2.1/6/textLayout_2.1.0 .6.swz
- Tried with and without the verify RSL digest option.
1. rsl libraries in frameworks\libs are just copies of the libraries on the server. They are not linked in your runtime.
2. it should work that you change link configuration of sdk. But http://sourceforge.net/projects/tlf.adobe/files/2.1/6/textLayout2.0.0. 6.swz will be redirect to another place when you try to download the that swz...So the link showed on sourceforge cannot work. URL for SWZ should always be a direct link. Please wait for the RSL library on Adobe hosted server or you put RSL libraries on your own server.
bogdan_cs4 wrote:
Hi.
I've noticed that TLF 3.0 was launched on sourceforge.
My question is: how can i update my flex sdk to use the new TLF?
I've copied the new folders of TLF 3.0 over the old ones but that does not help.
Any help is apreciated.
Thanks
If you set project as Merge-Into-Code, just place the textlayout.swc in folder \frameworks\libs.
If set as Runtime-Shared-Library, you need to change the URL in configuration file frameworks\flex-config.xml.
I've copied the textLayout.swc file into the \frameworks\libs folder but i keep getting the same error.
Only now I can't see the content of the ContainerController class.
The stack trace only indicates that the error comes from the updateGraphics method.
Are you certain that there isn't anything else to do in order to make the TLF 3.0 work in the flex SDK?
Is there an Ant build neccesary?
Sorry for that.
My project is set to Runtime-Shared-Library.
What URL in particular do I have to modify?
<!-- TextLayout SWC -->
<runtime-shared-library-path>
<path-element>libs/textLayout.swc</path-element>
<rsl-url>http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232 .swz</rsl-url>
<policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
<rsl-url>textLayout_2.0.0.232.swz</rsl-url>
<policy-file-url></policy-file-url>
</runtime-shared-library-path>
Is it here somewhere?
I'm new to flex so please bare with my silly questions. I really appreaciate your help Jin.
For now, there is no available rsl-url for 3.0 rsl library. We are applying for the access of http://fpdownload.adobe.com to upload 3.0 rsl library.
If you have your own server, you can put 3.0 swz on it and use your own url. The url must be direct.
Jin-Huang thank you too much for your help. Could you please help me. I have made chat where i used component textLayout. I had issue with freezing scrollBar. Then i downloaded textLayout 3.0 and issue was fixed. But then i had
new issue at some point chat is blank, wipe and doesn't write any message. Before this happens i catch error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::updateGraphics()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\co ntainer\ContainerController.as:3461]
at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::updateCompositionShapes()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\co ntainer\ContainerController.as:3152]
at flashx.textLayout.compose::StandardFlowComposer/updateCompositionShap es()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\ compose\StandardFlowComposer.as:616]
at flashx.textLayout.compose::StandardFlowComposer/updateToController()[ C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compo se\StandardFlowComposer.as:559]
at flashx.textLayout.container::ContainerController/updateForScroll()[C: \Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\contain er\ContainerController.as:1191]
at flashx.textLayout.container::ContainerController/set verticalScrollPosition()[C:\Vellum\dev\output\openSource\textLayout\s rc\flashx\textLayout\container\ContainerController.as:1057]
at flashx.textLayout.container::ContainerController/autoScrollIfNecessar yInternal()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\text Layout\container\ContainerController.as:1899]
at flashx.textLayout.container::ContainerController/autoScrollIfNecessar y()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\c ontainer\ContainerController.as:1869]
at flashx.textLayout.container::ContainerController/mouseMoveHandler()[C :\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\contai ner\ContainerController.as:2297]
at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::rootMouseMoveHandler()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\co ntainer\ContainerController.as:2305]
I used flex builder 4.5.0. I am sure that i set all properties correct (Merge-Into-Code etc). So can i take source code this library? Maybe should i update flex builder etc. Please help us. Thank you.
http://sourceforge.net/projects/tlf.adobe/files/3.0/
You can download the source code from the link above. Copy the .as file into your project and remove the swc (I mean you compile your application with TLF code, not swc), you will know exactly which line failed.
In many of your post you keep saying that you can just host the libaray on your own server. Ive been trying to do that and i keep getting the following error...
Flex Error #1001: Digest mismatch with RSL http://www.domain.com/test/textLayout.swf. Redeploy the matching RSL or relink your application with the matching library.
Without special settings, application can only take advantage of RSL with Adobe certificate, not test certificate. On SourceForge.net, RSLs are all with test certificate.
You can try the RSL on Adobe server http://download.macromedia.com/pub/swz/tlf/3.0.0.29/textLayout_3.0.0.2 9.swz http://download.macromedia.com/pub/swz/tlf/3.0.0.29/textLayout_3.0.0.2 9.swf
I just uploaded them. There is a delay. Maybe you want to wait for several hours.
I want to clarify, ive seen you mention a few times about the test certificate. But what does that exactly mean?
Are you saying that all textLayout version 3 and higher are only compiled using a test certificate which will NEVER work in a production environment?
If i download the .swz from the link above and host it on my server with my applet.swf the general public still can not run the applet?
If that is true, if it is not possible to use textLayout version 3 in a completed production ready applet then why is it even being offered for use? Granted it was nice of your team to fix the bugs and get a new version ready but if we cant use it... I feel frustrated because our project has already been coded using text flow v3 but if we cant offer it to the public then what was the point? All of that development was wasted as now we will need to downgrade back to mx components.
You jin huang have been helpful so dont take it personal, my frustration is towards the adobe company and their inefficient structure.
I have also uploaded the rsl to http://sourceforge.net/projects/tlf.adobe/files/3.0/current/rsl/. Do remember that the link of sourceforge.net cannot be the link for rsl in the configuration file, because there is a re-direction on that website. For http://download.macromedia.com issue, I have communicated with related colleagues. Sorry for that delay. That server is an Adobe hosted server. It needs to be really cautious to upload something onto Adobe hosted server.
Thank you for the 2nd upload location, i was able to download the files. Yes my intention is to host the files myself as i would not expect my project to rely on the servers of someone else outside of my control.
However i am still wanting to know about the code signing issue.
Are these files signed with only test certificates? Is the swf and swz able to be used by the general public's version of flash player?
OMG, im about to go postal...
I just tried running my project using the new textLayout_3.0.0.29.swz and the error is back. The same error that exsisted in TLF2 which was fixed in version 3 is now back when using the swz. How did that happen? Was build 29 swz accidently compiled with version 2 code?
The error is when using textflow in a spark textarea. If you include an image with EditManager.insertInlineGraphic() an error happens once the graphic scrolls out of the visible area and into the scroll buffer. If i do not use textLayout_3.0.0.29.swz and only use the textLayout.swc from http://sourceforge.net/projects/tlf.adobe/files/3.0/current/textLayout _build.zip/download the error does not happen.
Why do you think the error happens with the swz but not when using the build 29 source directly?
Was there a mistake in building the swz? How can this be fixed?
However, depending on your answer about if build 29 swz was compiled with a test certificate or not, all of this might not matter if we can not use the swz at the production level.
---------- Error Given In Flash Builder ----------
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::updateGraphics()[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flas hx\textLayout\container\ContainerController.as:3182]
at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::updateCompositionShapes()[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flas hx\textLayout\container\ContainerController.as:3080]
at flashx.textLayout.compose::StandardFlowComposer/updateCompositionShap es()[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\fl ashx\textLayout\compose\StandardFlowComposer.as:616]
at flashx.textLayout.compose::StandardFlowComposer/updateToController()[ C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flashx\ textLayout\compose\StandardFlowComposer.as:559]
at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers( )[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flash x\textLayout\compose\StandardFlowComposer.as:517]
at flashx.textLayout.container::TextContainerManager/updateContainer()[C :\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flashx\t extLayout\container\TextContainerManager.as:1343]
at spark.components::RichEditableText/updateDisplayList()[E:\dev\4.y\fra meworks\projects\spark\src\spark\components\RichEditableText.as:2974]
at mx.core::UIComponent/validateDisplayList()[E:\dev\4.y\frameworks\proj ects\framework\src\mx\core\UIComponent.as:8999]
at mx.managers::LayoutManager/validateClient()[E:\dev\4.y\frameworks\pro jects\framework\src\mx\managers\LayoutManager.as:1033]
at mx.core::UIComponent/validateNow()[E:\dev\4.y\frameworks\projects\fra mework\src\mx\core\UIComponent.as:8077]
at Main::ChatWindow$/displayChatText()[C:\Users\User\Flash Projects\ChatBroadcast\src\Main\ChatWindow.as:38]
at Main::ServerListener$/msgFromUser()[C:\Users\User\Flash Projects\ChatBroadcast\src\Main\ServerListener.as:20]
at Main::RemoteClient$/msgFromUser()[C:\Users\User\Flash Projects\ChatBroadcast\src\Main\RemoteClient.as:12]
Firstly, those newly uploaded swz & swf are signed with Adobe certificate. So they are able to be used by the general public's version of flash player. For the error, I think it's your fault. "C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flas hx\textLayout\container\ContainerController.as" is definitely the absolute path on your PC, right? You are compiling with 2.0 code. Please search in the forum for RSL configurations. You are supposed to change flex-config.xml, replace the swc and swf in SDK, replace the link for SWZ, and so on.
North America
Europe, Middle East and Africa
Asia Pacific