Skip to main content
Inspiring
May 29, 2010
Question

LinkElement Rollout Bug?

  • May 29, 2010
  • 1 reply
  • 1105 views

I have an InlineGraphicElement wrapped in a LinkElement.

When the user rolls out of that LinkElement and onto a display object that is NOT part of the TextFlow the MouseCursor will remain an IBeam and seems to be governed by logic from the TextFlow.

I suspect that the TextFlow only clears certain mouse listeners and cursor control when the underlying container is rolled out of directly and not via a LinkElement.  I couldn't work out how to simulate that event to trigger the clearing of those listeners.

This topic has been closed for replies.

1 reply

josh_onAuthor
Inspiring
June 1, 2010

Here is a demonstration:

http://wwww.theyrule.net/test/TLF_Linked_Image_Rollout.html

The text flow must have a selection manager.

This was published with build 15204 of flex sdk.

Here is the source:

package

{

import flash.display.Sprite;

import flashx.textLayout.container.ContainerController;

import flashx.textLayout.edit.EditManager;

import flashx.textLayout.edit.SelectionManager;

import flashx.textLayout.elements.DivElement;

import flashx.textLayout.elements.InlineGraphicElement;

import flashx.textLayout.elements.LinkElement;

import flashx.textLayout.elements.ParagraphElement;

import flashx.textLayout.elements.SpanElement;

import flashx.textLayout.elements.TextFlow;

import flashx.textLayout.formats.TextDecoration;

import flashx.textLayout.formats.TextLayoutFormat;

public class TLF_Linked_Image_Rollout extends Sprite

{

public function TLF_Linked_Image_Rollout()

{

var bg:Sprite = new Sprite();

bg.graphics.beginFill(0xFFFFFF, 1);

bg.graphics.lineStyle(.25, 0x444444);

bg.graphics.drawRect(10,10,300,200);

addChild(bg);

var tf:TextFlow = new TextFlow();

var sm:SelectionManager = new SelectionManager();

tf.interactionManager = sm;

var fmt:TextLayoutFormat = new TextLayoutFormat();

fmt.paddingTop = 5;

fmt.paddingLeft = 5;

fmt.paddingRight = 5;

var container:Sprite = new Sprite();

container.x = 10;

container.y = 10;

tf.format = fmt;

addChild(container);

var cc:ContainerController = new ContainerController(container, 300, 200);

tf.flowComposer.addController(cc);

var d:DivElement = new DivElement();

var p:ParagraphElement = new ParagraphElement();

var s:SpanElement = new SpanElement();

s.text = "This is a text flow, the blue rectangle is an inline graphic element wrapped in a link.";

var s1:SpanElement = new SpanElement();

s1.text = "The red rectangle is a sprite sitting above the text flow. If you roll over the blue sprite and then on to the red sprite the cursor state incorrectly shows an IBeam.";

var ige:InlineGraphicElement = new InlineGraphicElement();

var blue_rect:Sprite = new Sprite();

blue_rect.graphics.beginFill(0x0000FF, 1);

blue_rect.graphics.drawRect(0,0,100,80);

var a:LinkElement = new LinkElement();

a.href = "http://www.google.com";

ige.source = blue_rect;

ige.textDecoration = TextDecoration.NONE;

tf.addChild(d);

d.addChild(p);

p.addChild(s);

p.addChild(a);

a.addChild(ige);

p.addChild(s1);

tf.flowComposer.updateAllControllers();

var red_rect:Sprite = new Sprite();

red_rect.graphics.beginFill(0xCC0000);

red_rect.graphics.drawRect(0,0,100,60);

red_rect.x = 270;

red_rect.y = 40;

addChild(red_rect);

}

}

}

June 1, 2010

Thanks for the report and the code. I can reproduce the problem on our 1.1 branch (which is closed) but it looks like it's already been fixed on our mainline 2.0 branch (which hopefully we'll be making public soon).

josh_onAuthor
Inspiring
June 1, 2010

Thanks,

I look forward to it.  Can you be any more specific on soon?  More like a week, a month or three months?  Just trying to work out our own timelines - thanks!

Josh