Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
tensioncore
Posts: 323
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers
Accepted Solution

Label String to Dispatch Shared data event

Alright, I'm in a pickle. I want to Click a button (A label to be exact).

 

So I've got my Label

I've got and event listener for the label click

 

And now I want to take the Text String of the label and use it in a dispatch event while sending a page change event (2 dispatch events at once to a 2nd page)

 

On this second page I Need to know what the string of the button pressed was so I can further process events.

 

Basically this is my event flow:

  • Click button
  • Dispatch event (to signal second page to open)
  • Dispatch event (sending the string)(which I can't figure out how to do)
  • Show second page
  • Dynamically load information based on the Button pressed from the first page (which I know how to do, I just need to know how to get that String of the button that was pressed)

 

I have everything working perfect except for the string button dilemma. There will be many buttons (rather labels) involved.

CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Label String to Dispatch Shared data event

Every event has a "target" attribute.  The target is the object that originally dispatched the event.  For example, a LabelButton dispatches an event on click, you can cast the target back to that object to know some things about that target (assuming the target is still in memory).

 

private function ButtonClicked( event : Event ) : void

{

  trace( 'button ' + LabelButton( event.target ).label ); 

 

If you are passing an intermediate event and you want to carry information with that event, then you can create your own Event class by extending the base Event class and adding attributes that you want to carry along.  You may also want to look at the meta event class which allows you to attach meta information with the event class being dispatched.

 

Please use plain text.
Developer
tensioncore
Posts: 323
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers

Re: Label String to Dispatch Shared data event

pretty much exactly what I was looking for I was just reading about the EventListener and Event Handling on various sites. Thanks as always for the help!
CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Please use plain text.
Developer
tensioncore
Posts: 323
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers

Re: Label String to Dispatch Shared data event

[ Edited ]

FAIL

nvm this post

CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Please use plain text.