[Flashcoders] How will asfunction work in AS3/MXML? Jester?

2006-01-30 Thread Tom Bray
If I have a link like this in a Flex2 TextArea like this:

a href='asfunction:doSomething,foo'click here/a

Where do I put my doSomething() method?

-Tom
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How will asfunction work in AS3/MXML? Jester?

2006-01-30 Thread Tom Bray
Thanks, Jesse.  I was able to find the right event using the code
hints in Flexbuilder (see below) but I'm stuck until I find out how
asfunction has changed so I can actually trigger the event.  I'll hold
my breath until the docs come back...

import flash.events.*

private function init():Void
{
myTextArea.addEventListener( TextEventType.LINK, 
linkClickHandler );
}

public function linkClickHandler( event:TextEvent ):Void
{
myTextArea.text = worked;
}

On 1/30/06, JesterXL [EMAIL PROTECTED] wrote:
 Docs are down, but here's some psuedo code for you:

 import flash.util.trace;
 your_txt.addEventListener(TextStuff.LINK, onHyperlinkClicked);

 function onHyperlinkClicked( event:Event )
 {
 trace(You clicked on  + event.target); // your_txt
 trace(The text is:  + event.text); // doSomething
 }

 I think asfunction is changed to something else; again, wait until the docs
 come back up to get confirmation on WHAT it actually changed to, but that's
 the basic code.  Whatever you store after the newAsfunction: is passed
 into the text property of the event.

 Only thing is, the text is just for context now, meaning doSomething is no
 longer a function that is called, and the comma no longer seperates that as
 the argument; it's basically just text that is passed into the event, so you
 could remove doSomething, and leave foo.  doSomething could be your event
 listener function passed to the textField.addEventLisetener for example.


 - Original Message -
 From: Tom Bray [EMAIL PROTECTED]
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Sent: Tuesday, January 31, 2006 1:33 AM
 Subject: [Flashcoders] How will asfunction work in AS3/MXML? Jester?


 If I have a link like this in a Flex2 TextArea like this:

 a href='asfunction:doSomething,foo'click here/a

 Where do I put my doSomething() method?

 -Tom
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flexbuilder 2: how can I hide subcontrols oftheRichTextEditor?

2005-12-14 Thread Tom Bray
Thanks again.  Now, I'd like to update the layout of the subcontrols
to account for extra space left by the ones I've hidden.  Is that
possible?  Would I need to actually remove individual subcontrols with
removeChild()? And can I move all the subcontrols so they're above the
textarea instead of below?  Are the class files for these controls
available somewhere so I can figure out the answers to these questions
myself?

Thanks,

Tom

On 12/13/05, JesterXL [EMAIL PROTECTED] wrote:
 Right idea, wrong event.  Use creationComplete (another might work, but this
 is the safest):

 mx:RichTextEditor

 id=my_rte

 width=100% height=100%

 creationComplete=hideMofos()/



 - Original Message -
 From: Tom Bray [EMAIL PROTECTED]
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Sent: Tuesday, December 13, 2005 8:36 PM
 Subject: Re: [Flashcoders] Flexbuilder 2: how can I hide subcontrols
 oftheRichTextEditor?


 Thanks, Jesse.  Now, what if I want to hide those mofos automagically
 when the app loads so the user never sees them?  I've been trying to
 call the hideMofos() method like this:

 mx:RichTextEditor title=Input id=my_rte width=100%
 height=100%  initialize=hideMofos()/

 But I get a runtime error that makes me think I need to wait for those
 subcontrols to initialize. Correct?

 -Tom

 On 12/13/05, JesterXL [EMAIL PROTECTED] wrote:
  This works:
 
  ?xml version=1.0 encoding=utf-8?
 
  mx:Application xmlns:mx=http://www.macromedia.com/2005/mxml; xmlns=*
 
  mx:Script
 
  ![CDATA[
 
 
  private function hideMofos():Void
 
  {
 
  my_rte.fontFamilyCombo.visible = false;
 
  my_rte.alignButtons.visible = false;
 
  my_rte.linkTextInput.visible = false;
 
  }
 
  ]]
 
  /mx:Script
 
  mx:Button
 
  label=Hide Buttons
 
  click=hideMofos() /
 
  mx:RichTextEditor
 
  id=my_rte
 
  width=100% height=100% /
 
  /mx:Application
 
 
 
  - Original Message -
  From: Tom Bray [EMAIL PROTECTED]
  To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
  Sent: Tuesday, December 13, 2005 7:42 PM
  Subject: [Flashcoders] Flexbuilder 2: how can I hide subcontrols of
  theRichTextEditor?
 
 
  I'd like to hide the font chooser, align buttons, and the link text
  field in my RTE component.  My first attempt was to set the _visible
  property of the linkTextInput subcontrol to false in the RTE's
  initialize event handler.  This throws errors at runtime and they
  aren't particularly helpful at figuring out what the problem is.
 
  Thanks,
 
  Tom
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Flexbuilder 2: Drag Drop

2005-12-14 Thread Tom Bray
How can I prevent the data in the dragSource from being deleted from
the dragInitiator?  I'm using MM's drag  drop example below. When you
drag an item from one list to the other, the data is removed from the
dragInitiator and I don't want that to happen. I tried supplying my
own dragComplete event handler for the dragInitiator list, but that
didn't work.  I'm a little surprised that the default behavior is to
delete the data from initiator.  (The docs suggest that it isn't the
default behavior.)


?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2005/mxml;
width=500 height=200 borderStyle=solid backgroundColor=#FF
creationComplete=initApp()
mx:Script
![CDATA[
private function initApp():Void {
srclist.dataProvider = ['Reading', 'Television',
'Movies'];
destlist.dataProvider =[];
}
]]
/mx:Script

mx:HBox
mx:VBox
mx:Label text=Available Activities /
mx:List id=srclist height=100 multipleSelection=true
dragEnabled=true/
/mx:VBox

mx:VBox
mx:Label text=Activities I Like /
mx:List id=destlist height=100 dropEnabled=true /
/mx:VBox
/mx:HBox
/mx:Application
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flexbuilder 2: how can I hide subcontrols of theRichTextEditor?

2005-12-13 Thread Tom Bray
Thanks, Jesse.  Now, what if I want to hide those mofos automagically
when the app loads so the user never sees them?  I've been trying to
call the hideMofos() method like this:

mx:RichTextEditor title=Input id=my_rte width=100%
height=100%  initialize=hideMofos()/

But I get a runtime error that makes me think I need to wait for those
subcontrols to initialize. Correct?

-Tom

On 12/13/05, JesterXL [EMAIL PROTECTED] wrote:
 This works:

 ?xml version=1.0 encoding=utf-8?

 mx:Application xmlns:mx=http://www.macromedia.com/2005/mxml; xmlns=*

 mx:Script

 ![CDATA[


 private function hideMofos():Void

 {

 my_rte.fontFamilyCombo.visible = false;

 my_rte.alignButtons.visible = false;

 my_rte.linkTextInput.visible = false;

 }

 ]]

 /mx:Script

 mx:Button

 label=Hide Buttons

 click=hideMofos() /

 mx:RichTextEditor

 id=my_rte

 width=100% height=100% /

 /mx:Application



 - Original Message -
 From: Tom Bray [EMAIL PROTECTED]
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Sent: Tuesday, December 13, 2005 7:42 PM
 Subject: [Flashcoders] Flexbuilder 2: how can I hide subcontrols of
 theRichTextEditor?


 I'd like to hide the font chooser, align buttons, and the link text
 field in my RTE component.  My first attempt was to set the _visible
 property of the linkTextInput subcontrol to false in the RTE's
 initialize event handler.  This throws errors at runtime and they
 aren't particularly helpful at figuring out what the problem is.

 Thanks,

 Tom
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders