[flexcoders] How does one implement IBitmapDrawable

2009-06-01 Thread Stephen More
Given this code:

var bitmapData:BitmapData;
bitmapData.draw( IBitmapDrawable( target ) );


What method(s) does target need to implement so that bitmapData will
have valid data in it ?
Can anyone provide an example ?


-Thanks


Re: [flexcoders] How does one implement IBitmapDrawable

2009-06-01 Thread Stephen More
The docs do not say much about IBitmapDrawable:
http://livedocs.adobe.com/flex/3/langref/flash/display/IBitmapDrawable.html

In your example lets say I create:
MyUIComponet extends UIComponet

What method do I need to write in MyUIComponet such that I can respond
back with an embeded image instead of  the rendering of the children
of UIComponet when IBitmapDrawable is called ?




On Mon, Jun 1, 2009 at 6:08 PM, Rick Winscot  wrote:
 IBitmapDrawable is implementd by flash.display.DisplayObject... of which
 Flex mx.core.UIComponet extends. So... If you want to create something that
 you can groggle BitmapData with – that’s a pretty good place to start.

 http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html

 Cheers,

 Rick Winscot


 On 6/1/09 4:39 PM, Stephen More  wrote:

 Given this code:

 var bitmapData:BitmapData;
 bitmapData.draw( IBitmapDrawable( target ) );

 What method(s) does target need to implement so that bitmapData will
 have valid data in it ?
 Can anyone provide an example ?




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:flexcoders-dig...@yahoogroups.com 
mailto:flexcoders-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
flexcoders-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[flexcoders] URLLoader + Binary != URLStream

2009-05-26 Thread Stephen More
I would think that I could load a swf using either URLLoader or
URLStream. As it turns out only my URLStream is returning the correct
data.
Can anyone provide a fix to the following code that makes URLLoader
work correctly ?

import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.net.URLStream;

private var loader:URLLoader;
private var stream:URLStream;

private function init():void
{
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE, loaderComplete);
loader.load( new URLRequest( Slide1.swf ) );

stream = new URLStream();
stream.addEventListener(Event.COMPLETE, streamComplete);
stream.load( new URLRequest( Slide1.swf ) );

}

private function streamComplete(event:Event):void {

var rawBytes:ByteArray = new ByteArray();
stream.readBytes( rawBytes, rawBytes.length );
trace( Length:  + rawBytes.length );

dumpData( rawBytes );
}

private function loaderComplete(event:Event):void {

var rawBytes:ByteArray = new ByteArray();
rawBytes.writeObject( loader.data );
trace( Length:  + rawBytes.length );

dumpData( rawBytes );
}

private function dumpData( ba:ByteArray )
{
ba.position = 0;
var index:int = 0;
var tracer:int;
while( ba.position  5)
{
tracer = ba.readByte();
trace( index + :  + tracer.toString(16));
index = index + 1;
}
}


[flexcoders] can one access mx.core.Container from within a SWFLoader

2009-05-20 Thread Stephen More
Lets say I have 2 compiled flex applications:
main.swf - contains a View Stack
components.swf - contains 2 mx.containers.Panel

within main.swf can one use SWFLoader ( or something else ) to add 1
of the panels from components.swf as a child of the view stack within
main.swf ?


I know this can easily be done outside of flex by using
flash.display.Loader on plain swf files.

When you boil it down, I am really trying to compile a
mx.containers.Panel into a reusable component. Can this be done ?

-Thanks
Steve More


[flexcoders] Displaying Extremely large fonts

2009-02-17 Thread Stephen More
Is there a way to display extremely large fonts in Flash ?

I have tried:

var format:TextFormat = new TextFormat();
format.font = Verdana;
format.color = 0x00;

format.size = 72;
[TextLineMetrics ascent:72, descent:16, leading:0, width:40, height:88, x:2]

format.size = 144;
[TextLineMetrics ascent:127, descent:27, leading:0, width:71, height:154, x:77]

format.size = 288;
[TextLineMetrics ascent:127, descent:27, leading:0, width:71, height:154, x:77]

But the height never gets larger than 154.

textfield.width = stage.stageWidth;
textfield.height = stage.stageHeight;

I am looking to display text almost as large as the stage, do I need
to use a different font or an embedded font ?


-Thanks


Re: [flexcoders] Wrapping Text in Alert

2008-12-23 Thread Stephen More
On Tue, Dec 23, 2008 at 5:54 AM, Manish Jethani
manish.jeth...@gmail.com wrote:
 Is there an easy way to get text inside of a mx.controls.Alert to wrap ?

 It already wraps.

 The text is wrapping in your example, but it does not wrap tight enough as
 it is overflowing the edges.
 How can the text wrap such that all text will fall within myAlert.width ?

 I just looked at the source, and I'm sorry to say that the algorithm
 for calculating the width of the text object is fixed and cannot be
 overridden. The width is calculated based on the length of the title
 text and the width of the buttons (both factors). Any width you set on
 the Alert object has no effect on the width of the text inside it.

 Your options are to either chop up the text programmatically into
 multiple lines, so it appears to be wrapped, or patch the framework's
 AlertForm component to respect the width assigned to it.

I think I will go for option 3 Creating custom pop-up windows with
the PopUpManager:

http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/


[flexcoders] Wrapping Text in Alert

2008-12-22 Thread Stephen More
Is there an easy way to get text inside of a mx.controls.Alert to wrap ?

-Thanks
Steve More


Re: [flexcoders] Wrapping Text in Alert

2008-12-22 Thread Stephen More
On Mon, Dec 22, 2008 at 5:39 PM, Manish Jethani
manish.jeth...@gmail.com wrote:
 Is there an easy way to get text inside of a mx.controls.Alert to wrap ?

 It already wraps.

 mx:Button click=Alert.show('The quick brown fox jumped over the
 wall. The quick brown fox jumped over the wall. ...') /

 Perhaps you want to reduce the width of the box?

Here is a little background, my flex application is really small
width 125 x height 300.

I would like the Alert box to be slightly smaller than the flex application.

import mx.controls.Alert;
import mx.managers.PopUpManager;

private function showAlert() : void
{
var myAlert:Alert = Alert.show('The quick brown fox
jumped over the wall. The quick brown fox jumped
 over the wall. ...');
myAlert.width = Application.application.width - 20;
PopUpManager.centerPopUp( myAlert );
}

The text is wrapping in your example, but it does wrap tight enough as
it is overflowing the edges.
How can the text wrap such that all text will fall within myAlert.width ?

I am attaching a screen shot.

-Steve
attachment: alert.png

Re: [flexcoders] WebDAV and Flex - Any sample code or opensource widgets available . . ?

2008-12-09 Thread Stephen More
How exactly do you envision WebDAV being used with flash ?

Couldn't one use flash.net.Socket to connect to port 80 and
communicate using the WebDAV protocol ?


On Tue, Dec 9, 2008 at 2:10 PM, Seth Hodgson shodg. wrote:
 Unfortunately, the Player currently limits the set of allowed HTTP methods
 to just GET and POST.

 This means that PUT, DELETE, HEAD, etc. as well as all the WebDAV extension
 methods are not allowed.

 Anyone who cares about this area should vote for this bug:
 https://bugs.adobe.com/jira/browse/SDK-12200
 And perhaps add a new bug specifically regarding WebDAV, although support
 for that would definitely be lower priority.

 As a workaround for core HTTP methods, you could use the proxy service in
 BlazeDS or LCDS which does supports all the core methods (mod PUT apparently
 - not sure why that one's not included, possibly a doc error). We use
 HTTPClient internally in the proxy service, and this library doesn't support
 WebDAV extension methods so you'd still be out of luck with WebDAV
 integration there as well.

 Best,
 Seth

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of marty_martian
 Sent: Tuesday, December 09, 2008 7:35 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] WebDAV and Flex - Any sample code or opensource
 widgets available . . ?

 I have searched through the archives for this user group but see very
 little discussion on WebDAV with Flex. It looks like some folks have
 been trying to do it as far back as 2006 but no samples or pointers to
 samples or open source widgets have been posted.

 Related to this, can anyone share:

 - samples
 - pointers to samples
 - open source widgets

 Most Grateful,

 Christopher
 


[flexcoders] clearing out mx:DateField

2008-12-09 Thread Stephen More
Within flex I have:
 mx:DateField id=effective /

Once a user selects a date, I can not clear it out using actionscript.

I have tried:
 effective.selectedDate = null;
 effective.selectedDate = undefined;
neither one has worked.

How can one clear out the mx:DateField ?

-Thanks


Re: [flexcoders] clearing out mx:DateField

2008-12-09 Thread Stephen More
On Tue, Dec 9, 2008 at 2:44 PM, Ryan Graham Ryan. wrote:
 effective.selectedDate = null;
 This should clear it.  Perhaps the actionscript function containing this
 code isn't getting called.

Sort of.

My flex also has a mx:List with a dataProvider.

I try to clear the List with:
 myitems.selectedItems = null;

This is actually clearing the List, but every line of code after this
not executing.

So I guess the real question is what is the right way to clear a mx:List ?


 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Stephen More
 Sent: Tuesday, December 09, 2008 12:18 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] clearing out mx:DateField



 Within flex I have:
 mx:DateField id=effective /

 Once a user selects a date, I can not clear it out using actionscript.

 I have tried:
 effective.selectedDate = null;
 effective.selectedDate = undefined;
 neither one has worked.

 How can one clear out the mx:DateField ?

 -Thanks

 This message is private and confidential. If you have received it in error,
 please notify the sender and remove it from your system.
 


Re: [flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-08 Thread Stephen More
I am now using e4x as you suggest.

I wrote a custom dataTipFunction to display the correct information.

I have tried many things, but I have not been able to get the X - axis
labels working.

How can I write a custom axis label rendering for the below code ?

?xml version=1.0?
!-- charts/HTTPServiceToXMLListCollection.mxml --
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
creationComplete=srv.send()
  mx:Script![CDATA[
 import mx.utils.ArrayUtil;
  ]]/mx:Script

  mx:HTTPService id=srv url=data.xml resultFormat=e4x /

  mx:XMLListCollection id=myAC source={srv.lastResult.result} /

  mx:Panel title=Line Chart
 mx:LineChart id=chart dataProvider={myAC} showDataTips=true
mx:horizontalAxis
   mx:CategoryAxis categoryField=month/
/mx:horizontalAxis
mx:series
   mx:LineSeries yField=apple name=Apple/
   mx:LineSeries yField=orange name=Orange/
   mx:LineSeries yField=banana name=Banana/
/mx:series
 /mx:LineChart
  /mx:Panel
/mx:Application



On Thu, Jul 3, 2008 at 7:41 AM, Stephen More step.om wrote:
 On Wed, Jul 2, 2008 at 6:29 PM, Tracy Spratt tsp...com wrote:
 I advise using resultFormat=e4x, a result handler function, and an
 instance variable to hold the xmlResult.

 I started out using e4x until I ran into what I think is a bug:
 https://bugs.adobe.com/jira/browse/SDK-15976

 DataTips in mx:LineChart does not like the e4x format.

 I guess I should go back to using e4x and write a custom
 dataTipFunction that actually works.


 -Steve


 The best performance, especially in a multi-renderer DataGrid, will be if
 you manually convert the XML node data ino an ArrayCollection of strongly
 typed value objects.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Sean Clark Hess
 Sent: Wednesday, July 02, 2008 4:05 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Inspecting data from HTTPService result to an
 ArrayCollection



 Ah, got it.

 The mx:Model tag converts everything to a flat object.  So the minute you
 use it, you no longer have xml.

 It's still easy enough to loop through though.

 var result:Object = myData.getItemAt(0);
 for (var name:String in result)
 {
 trace(name +  ::  + result[name]);
 }

 should output
 apple :: 81768
 orange :: 60310
 banana :: 43357

 On Wed, Jul 2, 2008 at 1:46 PM, Stephen More [EMAIL PROTECTED] wrote:

 Here is my output:

 DEBUG: 2 null
 [object Object]
 CHECK : false
 CHECK : false

 Here is all the code:
 ?xml version=1.0?
 !-- charts/XMLFileToArrayCollectionDataProvider.mxml --
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 width=100% height=100%
 mx:Script
 import mx.utils.ArrayUtil;
 /mx:Script

 mx:Model id=results source=../assets/data.xml/
 mx:ArrayCollection id=myData
 source={ArrayUtil.toArray(results.result)}
 /

 mx:Panel title=Line Chart
 mx:LineChart id=chart dataProvider={myData} showDataTips=true
 mx:horizontalAxis
 mx:CategoryAxis categoryField=month/
 /mx:horizontalAxis
 mx:series
 mx:LineSeries yField=banana displayName=Banana/
 mx:LineSeries yField=apple displayName=Apple/
 mx:LineSeries yField=orange displayName=Orange/
 /mx:series
 /mx:LineChart

 mx:Button id=iconButton label=Button with Icon
 labelPlacement=right color=#993300
 click=printMessage(event);/

 mx:Script
 ![CDATA[

 import flash.events.Event;

 // Event handler function to print a message
 // describing the selected Button control.
 private function printMessage(event:Event):void {
 //message.text += event.target.label +  pressed + \n;

 var myXML:XML;
 myXML = myData.getItemAt(0) as XML;

 trace( DEBUG:  + myData.length +   + myXML );
 trace( myData.getItemAt(0) );

 trace(CHECK :  + (myData.getItemAt(0) is XML));

 trace(CHECK :  + (myData.getItemAt(0) is XMLList));
 }

 ]]
 /mx:Script

 /mx:Panel
 /mx:Application

 On Wed, Jul 2, 2008 at 3:34 PM, Sean Clark Hess [EMAIL PROTECTED] wrote:
 What do you get when you trace myData.getItemAt(0)? That will return null
 if it isn't an XML. You can do this too:

 trace(CHECK :  + (myData.getItemAt(0) is XML));

 You can check to see if it is an XMLList too, but I thought looking at it,
 it seemed like a flat xml.

 On Wed, Jul 2, 2008 at 1:32 PM, Stephen More [EMAIL PROTECTED]
 wrote:

 Thats what I was thinking but when I try:

 var myXML:XML;
 myXML = myData.getItemAt(0) as XML;
 trace( DEBUG:  + myXML );

 I get
 DEBUG: null

 On Wed, Jul 2, 2008 at 2:30 PM, Sean Clark Hess [EMAIL PROTECTED]
 wrote:
  Each row is an xml object...
 
  So, (myData.getItemAt(i) as XML).children()
 
  Then you could loop through the children and ask them for their name.
  After
  the as XML step you can do anything you can normally do with the XML
  object
 
  On Wed, Jul 2, 2008 at 12:11 PM, Stephen More [EMAIL PROTECTED]
  wrote:
 
  ( Example code taken from:
  http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
  Here is the dataset I am trying

Re: [flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-03 Thread Stephen More
On Wed, Jul 2, 2008 at 6:29 PM, Tracy Spratt tsp...com wrote:
 I advise using resultFormat=e4x, a result handler function, and an
 instance variable to hold the xmlResult.

I started out using e4x until I ran into what I think is a bug:
https://bugs.adobe.com/jira/browse/SDK-15976

DataTips in mx:LineChart does not like the e4x format.

I guess I should go back to using e4x and write a custom
dataTipFunction that actually works.


-Steve


 The best performance, especially in a multi-renderer DataGrid, will be if
 you manually convert the XML node data ino an ArrayCollection of strongly
 typed value objects.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Sean Clark Hess
 Sent: Wednesday, July 02, 2008 4:05 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Inspecting data from HTTPService result to an
 ArrayCollection



 Ah, got it.

 The mx:Model tag converts everything to a flat object.  So the minute you
 use it, you no longer have xml.

 It's still easy enough to loop through though.

 var result:Object = myData.getItemAt(0);
 for (var name:String in result)
 {
 trace(name +  ::  + result[name]);
 }

 should output
 apple :: 81768
 orange :: 60310
 banana :: 43357

 On Wed, Jul 2, 2008 at 1:46 PM, Stephen More [EMAIL PROTECTED] wrote:

 Here is my output:

 DEBUG: 2 null
 [object Object]
 CHECK : false
 CHECK : false

 Here is all the code:
 ?xml version=1.0?
 !-- charts/XMLFileToArrayCollectionDataProvider.mxml --
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 width=100% height=100%
 mx:Script
 import mx.utils.ArrayUtil;
 /mx:Script

 mx:Model id=results source=../assets/data.xml/
 mx:ArrayCollection id=myData
 source={ArrayUtil.toArray(results.result)}
 /

 mx:Panel title=Line Chart
 mx:LineChart id=chart dataProvider={myData} showDataTips=true
 mx:horizontalAxis
 mx:CategoryAxis categoryField=month/
 /mx:horizontalAxis
 mx:series
 mx:LineSeries yField=banana displayName=Banana/
 mx:LineSeries yField=apple displayName=Apple/
 mx:LineSeries yField=orange displayName=Orange/
 /mx:series
 /mx:LineChart

 mx:Button id=iconButton label=Button with Icon
 labelPlacement=right color=#993300
 click=printMessage(event);/

 mx:Script
 ![CDATA[

 import flash.events.Event;

 // Event handler function to print a message
 // describing the selected Button control.
 private function printMessage(event:Event):void {
 //message.text += event.target.label +  pressed + \n;

 var myXML:XML;
 myXML = myData.getItemAt(0) as XML;

 trace( DEBUG:  + myData.length +   + myXML );
 trace( myData.getItemAt(0) );

 trace(CHECK :  + (myData.getItemAt(0) is XML));

 trace(CHECK :  + (myData.getItemAt(0) is XMLList));
 }

 ]]
 /mx:Script

 /mx:Panel
 /mx:Application

 On Wed, Jul 2, 2008 at 3:34 PM, Sean Clark Hess [EMAIL PROTECTED] wrote:
 What do you get when you trace myData.getItemAt(0)? That will return null
 if it isn't an XML. You can do this too:

 trace(CHECK :  + (myData.getItemAt(0) is XML));

 You can check to see if it is an XMLList too, but I thought looking at it,
 it seemed like a flat xml.

 On Wed, Jul 2, 2008 at 1:32 PM, Stephen More [EMAIL PROTECTED]
 wrote:

 Thats what I was thinking but when I try:

 var myXML:XML;
 myXML = myData.getItemAt(0) as XML;
 trace( DEBUG:  + myXML );

 I get
 DEBUG: null

 On Wed, Jul 2, 2008 at 2:30 PM, Sean Clark Hess [EMAIL PROTECTED]
 wrote:
  Each row is an xml object...
 
  So, (myData.getItemAt(i) as XML).children()
 
  Then you could loop through the children and ask them for their name.
  After
  the as XML step you can do anything you can normally do with the XML
  object
 
  On Wed, Jul 2, 2008 at 12:11 PM, Stephen More [EMAIL PROTECTED]
  wrote:
 
  ( Example code taken from:
  http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
  Here is the dataset I am trying to work with:
 
  data
  result month=Jan-04
  apple81768/apple
  orange60310/orange
  banana43357/banana
  /result
  result month=Feb-04
  apple81156/apple
  orange58883/orange
  banana49280/banana
  /result
  /data
 
  The flex code will look like this:
  mx:HTTPService
  id=srv
  url=../assets/data.xml
  useProxy=false
  result=myData=ArrayCollection(srv.lastResult.data.result)
  /
 
  How can I interrogate the ArrayCollection named myData so that it will
  return apple, orange, and banana ?
  I am not looking to get the numerical values, I want to get the xml
  name.
 
  -Thanks
  Steve More
 
 





 


[flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-02 Thread Stephen More
( Example code taken from:
http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
Here is the dataset I am trying to work with:

data
result month=Jan-04
apple81768/apple
orange60310/orange
banana43357/banana
/result
result month=Feb-04
apple81156/apple
orange58883/orange
banana49280/banana
/result
/data

The flex code will look like this:
mx:HTTPService
 id=srv
 url=../assets/data.xml
 useProxy=false
 result=myData=ArrayCollection(srv.lastResult.data.result)
  /


How can I interrogate the ArrayCollection named myData so that it will
return apple, orange, and banana ?
I am not looking to get the numerical values, I want to get the xml name.

-Thanks
Steve More


Re: [flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-02 Thread Stephen More
Thats what I was thinking but when I try:

   var myXML:XML;
   myXML = myData.getItemAt(0) as XML;
   trace( DEBUG:  + myXML );

I get
   DEBUG: null



On Wed, Jul 2, 2008 at 2:30 PM, Sean Clark Hess [EMAIL PROTECTED] wrote:
 Each row is an xml object...

 So, (myData.getItemAt(i) as XML).children()

 Then you could loop through the children and ask them for their name. After
 the as XML step you can do anything you can normally do with the XML object

 On Wed, Jul 2, 2008 at 12:11 PM, Stephen More [EMAIL PROTECTED]
 wrote:

 ( Example code taken from:
 http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
 Here is the dataset I am trying to work with:

 data
 result month=Jan-04
 apple81768/apple
 orange60310/orange
 banana43357/banana
 /result
 result month=Feb-04
 apple81156/apple
 orange58883/orange
 banana49280/banana
 /result
 /data

 The flex code will look like this:
 mx:HTTPService
 id=srv
 url=../assets/data.xml
 useProxy=false
 result=myData=ArrayCollection(srv.lastResult.data.result)
 /

 How can I interrogate the ArrayCollection named myData so that it will
 return apple, orange, and banana ?
 I am not looking to get the numerical values, I want to get the xml name.

 -Thanks
 Steve More

 


Re: [flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-02 Thread Stephen More
Here is my output:

DEBUG: 2 null
[object Object]
CHECK : false
CHECK : false


Here is all the code:
?xml version=1.0?
!-- charts/XMLFileToArrayCollectionDataProvider.mxml --
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
width=100% height=100%
  mx:Script
 import mx.utils.ArrayUtil;
  /mx:Script

  mx:Model id=results source=../assets/data.xml/
  mx:ArrayCollection id=myData
source={ArrayUtil.toArray(results.result)}
  /

  mx:Panel title=Line Chart
 mx:LineChart id=chart dataProvider={myData} showDataTips=true
mx:horizontalAxis
   mx:CategoryAxis categoryField=month/
/mx:horizontalAxis
mx:series
   mx:LineSeries yField=banana displayName=Banana/
   mx:LineSeries yField=apple displayName=Apple/
   mx:LineSeries yField=orange displayName=Orange/
/mx:series
 /mx:LineChart

mx:Button id=iconButton label=Button with Icon
 labelPlacement=right color=#993300
click=printMessage(event);/

mx:Script
![CDATA[

import flash.events.Event;

// Event handler function to print a message
// describing the selected Button control.
private function printMessage(event:Event):void  {
  //message.text += event.target.label +  pressed + \n;

var myXML:XML;
myXML = myData.getItemAt(0) as XML;
trace( DEBUG:  + myData.length +   + myXML );
trace( myData.getItemAt(0) );
trace(CHECK :  + (myData.getItemAt(0) is XML));
trace(CHECK :  + (myData.getItemAt(0) is XMLList));
}

  ]]
/mx:Script

/mx:Panel
/mx:Application




On Wed, Jul 2, 2008 at 3:34 PM, Sean Clark Hess [EMAIL PROTECTED] wrote:
 What do you get when you trace myData.getItemAt(0)?  That will return null
 if it isn't an XML.  You can do this too:

 trace(CHECK :  + (myData.getItemAt(0) is XML));

 You can check to see if it is an XMLList too, but I thought looking at it,
 it seemed like a flat xml.

 On Wed, Jul 2, 2008 at 1:32 PM, Stephen More [EMAIL PROTECTED] wrote:

 Thats what I was thinking but when I try:

 var myXML:XML;
 myXML = myData.getItemAt(0) as XML;
 trace( DEBUG:  + myXML );

 I get
 DEBUG: null

 On Wed, Jul 2, 2008 at 2:30 PM, Sean Clark Hess [EMAIL PROTECTED]
 wrote:
  Each row is an xml object...
 
  So, (myData.getItemAt(i) as XML).children()
 
  Then you could loop through the children and ask them for their name.
  After
  the as XML step you can do anything you can normally do with the XML
  object
 
  On Wed, Jul 2, 2008 at 12:11 PM, Stephen More [EMAIL PROTECTED]
  wrote:
 
  ( Example code taken from:
  http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
  Here is the dataset I am trying to work with:
 
  data
  result month=Jan-04
  apple81768/apple
  orange60310/orange
  banana43357/banana
  /result
  result month=Feb-04
  apple81156/apple
  orange58883/orange
  banana49280/banana
  /result
  /data
 
  The flex code will look like this:
  mx:HTTPService
  id=srv
  url=../assets/data.xml
  useProxy=false
  result=myData=ArrayCollection(srv.lastResult.data.result)
  /
 
  How can I interrogate the ArrayCollection named myData so that it will
  return apple, orange, and banana ?
  I am not looking to get the numerical values, I want to get the xml
  name.
 
  -Thanks
  Steve More
 
 

 


[flexcoders] can I dispatch a dataTipFunction event

2008-04-08 Thread Stephen More
I currently have a working mx:LineChart with a dataTipFunction that
shows up on mouse over.

I would like to add some animation to this Chart, is there a way to
show dataTip1, sleep some, then show dataTip2, sleep, etc without
having the user mouse over the data points ?


-Thanks
Flex newbie


[flexcoders] Dump any Data Structure

2008-04-04 Thread Stephen More
Perl has Data::Dumper (
http://search.cpan.org/~ilyam/Data-Dumper-2.121/Dumper.pm )
It will output any data structure structure to output.

Is there any equivalent method/object in flex ?

-Thanks
Flex newbie


[flexcoders] Re: Problem with DataGrid itemFocusIn event

2008-04-03 Thread Stephen More
Is there anyway to get the selected row from a DataGrid without it
being editable ?

It seems others have had this problem also:
http://www.mail-archive.com/flexcoders@yahoogroups.com/msg41468.html
https://bugs.adobe.com/jira/browse/SDK-11690


-Thanks
Flex newbie


[flexcoders] Re: Problem with DataGrid itemFocusIn event

2008-04-03 Thread Stephen More
Yes, a mx.events.ListEvent should be used instead of a mx.events.DataGridEvent;



On Thu, Apr 3, 2008 at 1:33 PM, Stephen More [EMAIL PROTECTED] wrote:
 Is there anyway to get the selected row from a DataGrid without it
  being editable ?

  It seems others have had this problem also:
 http://www.mail-archive.com/flexcoders@yahoogroups.com/msg41468.html
 https://bugs.adobe.com/jira/browse/SDK-11690


  -Thanks
  Flex newbie