Skip to main content
March 14, 2009
Answered

Bug in InlineGraphicElement with embedded asset

  • March 14, 2009
  • 2 replies
  • 608 views
embedded asset set to source of InlineGraphicElement does not show up until a real edit operation occurs
src:
var bullet:InlineGraphicElement = new InlineGraphicElement();
bullet.source = " http://www.adobe.com/shockwave/download/images/flashplayer_100x100.jpg";
//new bulletClass();
bullet.width = 15;
bullet.height = 15;
var pf:ParagraphFormat = new ParagraphFormat();
pf.marginLeft = 20;
pf.textIndent = 0;
p.paragraphFormat = pf;
var sp:SpanElement = new SpanElement();
sp.digitWidth='10';
sp.fontFamily='courier';
sp.fontSize = 10;
sp.textAlpha = 0.1;
sp.text='.';
p.addChildAt(0,sp);
p.addChildAt(0,bullet);
_textFlow.flowComposer.updateAllContainers();

....'
private function graphicStatusChangeEvent(e:StatusChangeEvent):void
{
for each(var bm:bulletMap in map)
{
if(bm.bullet == e.element)
{
trace('found');
bm.para.textIndent = -InlineGraphicElement(bm.bullet).actualWidth -12;
_textFlow.flowComposer.updateAllContainers();
}
}
//InlineGraphicElement(e.element).graphic.addEventListener(MouseEvent.CLICK, onBulletClick);
_textFlow.flowComposer.updateAllContainers();
}

if i replaced embed source with normal url , it loads and shows up correctly.

Any idea on it ? A bug ?

This topic has been closed for replies.
Correct answer rdermer
FYI: What's happening here is that composition is being recursively called. With the embedded graphic the status is being set during the first call to updateAllContainers and then the event handler recursively calls into updateAllContainers. That is confusing the composer.

Rather than requiring the caller to figure that out I'm adding a boolean to the composer so that calls such as updateAllContainers etc simply return on recursive calls. Once that's done the example is working.

It'll take a while for the fix to percolate through the system and be posted.

Note that simply adding your own booleans around the first call to updateAllContainers may not quite work. You'll need to also call compose again if you see a recursive call - there is one more internal change to do with delayed handling of the format change made in the event handler.

By the way you are using a fairly old build - I think it would be worth updating to buid 370.

Richard

2 replies

rdermerCorrect answer
Adobe Employee
March 16, 2009
FYI: What's happening here is that composition is being recursively called. With the embedded graphic the status is being set during the first call to updateAllContainers and then the event handler recursively calls into updateAllContainers. That is confusing the composer.

Rather than requiring the caller to figure that out I'm adding a boolean to the composer so that calls such as updateAllContainers etc simply return on recursive calls. Once that's done the example is working.

It'll take a while for the fix to percolate through the system and be posted.

Note that simply adding your own booleans around the first call to updateAllContainers may not quite work. You'll need to also call compose again if you see a recursive call - there is one more internal change to do with delayed handling of the format change made in the event handler.

By the way you are using a fairly old build - I think it would be worth updating to buid 370.

Richard
Adobe Employee
March 16, 2009
It's a bug.

Thanks for the report.
Richard