Re: [flexcoders] AMFPHP Sessions

2007-03-04 Thread Anthony Lee
 Can someone provide and example of how to use AMFPHP with sessions.
  I can't seem to get it to work.

Ditto. Sessions are referenced all over the place but I couldn't find
a working example.

tonio


[flexcoders] Re: LegendItem inheritance

2007-03-04 Thread vigen2000
can anyone shed some light on the issue? someone has some experience
with legend item?

--- In flexcoders@yahoogroups.com, vigen2000 [EMAIL PROTECTED] wrote:

 Hi,
 
 It seems that the only way to change the legendItem behavior and look
 is to inherit from it. but what i found out that the
 nameLabel(UITextField) property (the actual label component)is private
 and therefor cannot be accessed from my custom LegendItem component. 
 
 What i want to do is to change the wordWrap to true.
 
 any ideas/solutions?
 
 thanks,
 vigen





Re: [flexcoders] Re: How does sprite listener work?

2007-03-04 Thread leds usop
the modal alert window causes  your problem.  When the
modal Alert activates, it 'forces' your mouse to leave
that sprite and hence making it think that a mouse
rollOUT  event took place.  try this to verify:

?xml version=1.0 encoding=utf-8?
mx:Application
xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical 
mx:Script

![CDATA[
import mx.controls.Alert;

private function mouseDoubleClickListener
(event:MouseEvent):void
{

var cmt:Sprite=new Sprite();

cmt.graphics.lineStyle
(2,0x00, 1);
cmt.graphics.beginFill
(0xff,1) ;
cmt.graphics.drawCircle(event.localX, event.localY,
10);

cmt.graphics.endFill() ;
a.rawChildren.addChild(cmt);
cmt.hitArea=cmt;
cmt.addEventListener(MouseEvent.ROLL_OVER,
mouseOverListener);
cmt.addEventListener(MouseEvent.ROLL_OUT,
mouseOutListener);
b.mouseEnabled=false;
//}
}

private var ctr:int=0;

private function mouseOverListener
(event:MouseEvent):void
{   
testtext.text=rollover:  +ctr.toString();
ctr++;

}

private function mouseOutListener
(event:MouseEvent) :void
{

testtext.text= rollout:  +ctr.toString();
ctr++;
}

]]
/mx:Script
mx:Panel id=a mouseEnabled=false
mx:Canvas id=b width=474 height=471 
doubleClick=mouseDoubleClickListener(event)
doubleClickEnabled=true/
/mx:Panel
mx:Text id=testtext text=Text/
/mx:Application


You will see that the counter only increments once for
every mouseover and mouse out.

Cheers,
-leds



--- Sandwish [EMAIL PROTECTED] wrote:

 Thanks,Gordon!
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application
 xmlns:mx=http://www.adobe.com/2006/mxml; 
 layout=vertical
 mx:Script
   ![CDATA[
   import mx.controls.Alert;
   
   private function mouseDoubleClickListener
 (event:MouseEvent):void
   {
   
   var cmt:Sprite=new 
 Sprite();
   
   cmt.graphics.lineStyle
 (2,0x00,1);
   cmt.graphics.beginFill
 (0xff,1);
   cmt.graphics.drawCircle
 (event.localX,event.localY,10);   
   
   cmt.graphics.endFill();
   a.rawChildren.addChild
 (cmt);
   cmt.addEventListener
 (MouseEvent.ROLL_OVER, mouseOverListener);
   cmt.addEventListener
 (MouseEvent.ROLL_OUT, mouseOutListener);
   //}
   }
   
   private function mouseOverListener
 (event:MouseEvent):void   
   {   
   Alert.show(rollover);
   
   }
   
   private function mouseOutListener
 (event:MouseEvent):void   
   {   
   Alert.show(rollout);
   }
   
   ]]
 /mx:Script
   mx:Panel id=a
   mx:Canvas id=b width=500 height=500 
 doubleClick=mouseDoubleClickListener(event) 
 doubleClickEnabled=true/
   /mx:Panel
 /mx:Application
 
 Run the code and the problem is obvious.
 
 Regards.
 
 --- In flexcoders@yahoogroups.com, Gordon Smith
 [EMAIL PROTECTED] wrote:
 
  It's not obvious to me why that would be
 happening.  Can you post 
 the
  code for a simple app which demonstrates the
 problem?
   
  - Gordon
  
  
  
  From: flexcoders@yahoogroups.com 
 [mailto:[EMAIL PROTECTED] On
  Behalf Of Sandwish
  Sent: Tuesday, February 27, 2007 11:22 AM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] How does sprite listener
 work?
  
  
  
  I new a sprite and addeventlistener which listens
 roll_over and
  roll_out event. But after a circle is drawn with
 beginfill and
  endfill, each time I roll inside the circle, both
 events get 
 invoked.
  I don't know why? :(
  
  Thanks in advance!
  Regards,
  Sand
 
 
 
 



 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com


[flexcoders] datagrid - alert dialog on selection change

2007-03-04 Thread Adam Royle
Hey all,

I have a datagrid where I want to show a dialog (confirmation) box before the 
selection has changed. I have developed the following code which intercepts the 
change event. The basics of my method are: 

- save selectedIndices on selection change
- intercept change event and show confirmation if doPreventChange variable is 
true
- if user clicks OK, then proceed with new selection, otherwise revert to 
previous selection

Even though this code works, I'm hoping someone might be able to give me 
pointers on how to make it better (cleaner, more OO).

Cheers,
Adam




?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute 
creationComplete=init()
 mx:Script
  ![CDATA[
   import mx.controls.Alert;
   import mx.collections.ArrayCollection;
   import mx.events.CloseEvent;
   
   [Bindable]
   public var doPreventChange:Boolean = true;
   
   [Bindable]
   public var dataProvider:ArrayCollection;
   
   [Bindable]
   public var debug:String = ;
   
   public var dg_selectedIndices:Array = [];
   public var dg_selectedIndices_capture:Array;
   
   public function init():void
   {
dataProvider = new ArrayCollection();
dataProvider.addItem({col1:'My',col2:'data',col3:'goes'});
dataProvider.addItem({col1:'in',col2:'here',col3:'as'});
dataProvider.addItem({col1:'a',col2:'demonstration',col3:'grid'});

dg.addEventListener(customChange,customChange);

   }
   
   public function dataChange(event:Event):void
   {
if (doPreventChange){
 // make a copy of selected indices in case the user clicks OK
 dg_selectedIndices_capture = event.target.selectedIndices.slice();
 // set selected indices back to what it was before the change
 event.target.selectedIndices = dg_selectedIndices.slice();
 
 var strAlert:String = Really change the selection?;
 Alert.show(strAlert, Alert, Alert.OK | Alert.CANCEL, this, 
confirmSelectionChange, null, Alert.OK);

} else {
 // make a backup of the selected indices in case we need to revert
 dg_selectedIndices = event.target.selectedIndices.slice();
 dg.dispatchEvent(new Event(customChange));
}
   }
   
   public function confirmSelectionChange(event:CloseEvent):void
   {
if (event.detail == Alert.OK){
 // set the selected indices back to what the user intended
 dg.selectedIndices = dg_selectedIndices_capture.slice();
 dg.dispatchEvent(new Event(customChange));
}
   }
   
   public function customChange(event:Event):void
   {
debug += Datagrid selection change\n;
   }
   
  ]]
 /mx:Script

 mx:DataGrid id=dg x=14 y=11 width=409 height=309 
dataProvider={dataProvider} allowMultipleSelection=true 
change=dataChange(event)
  mx:columns
   mx:DataGridColumn headerText=Column 1 dataField=col1/
   mx:DataGridColumn headerText=Column 2 dataField=col2/
   mx:DataGridColumn headerText=Column 3 dataField=col3/
  /mx:columns
 /mx:DataGrid
 mx:Button x=442 y=10 label=Toggle Prevent Change click=doPreventChange 
=! doPreventChange width=175/
 mx:Label x=442 y=40 text=Prevent Change = {doPreventChange}/
 mx:TextArea x=442 y=66 width=194 height=254 text={debug}/
 
/mx:Application


Re: [flexcoders] AMFPHP Sessions

2007-03-04 Thread aaron smith

Are you trying to use sessions in your service methods? You can use
$_SESSION['whatever'] ='something'

AMFPHP automatically handles sessions for you and sends back a header
to Flash with a redirect to the gateway with the PHPSESSID appended
to the query, meaning cookieless sessions are supported.

What is appended to the gateway url is the SESSION_ID. with that ID it
restores session data per request, for you to use in $_SESSION['asdf']. So
if in some method you set $_SESSION['auth'] = 1. Then in another method you
can say if($_SESSION['auth']==1) blah blah blah..

As far as i'm aware this still works. I have not tested in amfphp 1.9..
Maybe i'll eat my words, I'm hungry anyway though.

-Aaron



On 3/4/07, Anthony Lee [EMAIL PROTECTED] wrote:


   Can someone provide and example of how to use AMFPHP with sessions.
 I can't seem to get it to work.

Ditto. Sessions are referenced all over the place but I couldn't find
a working example.

tonio
 



[flexcoders] Tab woes in Flex 2.0...

2007-03-04 Thread doctorperhaps
I am trying to align my text and icon to be centered in my
TabNavigator tabs. The problem is that the text can be styled to be
aligned center, but the icon doesn't follow suit. It just looks
terrible. Normally it would look fine, but I need the TabBar to fill a
certain space and each tab to be a fraction of that space. 

I rather not have to extend the class if I don't have to. But I will
if I must. Has anyone ever done this successfully?

Thanks.



[flexcoders] Making itemRenders call a function on the component they're in

2007-03-04 Thread João Saleiro
Hello,

i have a List using a checkbox as an itemRender. I need the checkboxes 
to call a function inside the component where the List is in.  I know 
itemRenderers receive a data, but i do not know how can i access the 
component where the List is in. Also, is there a best practice to solve 
this situation?

Thanks,

João Saleiro


Re: [flexcoders] Making itemRenders call a function on the component they're in

2007-03-04 Thread leds usop
brute force solution would be to include a reference
to  the list component in the data being passed to the
item renderer. there are probably other ways to do
this.
but Id rather have the renderer dispatch a custom
event and handle that in the list component... then in
the handler, call that function.

--- João Saleiro [EMAIL PROTECTED] wrote:

 Hello,
 
 i have a List using a checkbox as an itemRender. I
 need the checkboxes 
 to call a function inside the component where the
 List is in.  I know 
 itemRenderers receive a data, but i do not know
 how can i access the 
 component where the List is in. Also, is there a
 best practice to solve 
 this situation?
 
 Thanks,
 
 João Saleiro
 



 

Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.


[flexcoders] Re: Making itemRenders call a function on the component they're in

2007-03-04 Thread João
Thanks for your suggestion. But that would include extending the List
Component so that it receives an handler, and register and event
listener for each element of the ArrayCollection, right?

João Saleiro



Re: [flexcoders] Re: Making itemRenders call a function on the component they're in

2007-03-04 Thread leds usop
oh no. not really. my bad, what i mean is, have the
component containing the list handle that event. So
it's just a matter of bubbling that event. and in that
handler, you can call that event.. or you can even
make that function itself as the event handler.



--- João [EMAIL PROTECTED] wrote:

 Thanks for your suggestion. But that would include
 extending the List
 Component so that it receives an handler, and
 register and event
 listener for each element of the ArrayCollection,
 right?
 
 João Saleiro
 
 



 

Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front


[flexcoders] Overlay TileList

2007-03-04 Thread jmfillman
I have a number of TileLists who will need to cover other TileLists 
occasionally. The problem I am having is that even if the first 
TileList completely covers the second TileList, the second TileList can 
be accessed right in the middle of the first TileList. I really don't 
want to make the second TileList.visible=false, but I don't see any 
other way. Basically, if the first TileList expands over the second, I 
want it to cover the second TileList so it can't be seen or accessed.
 



[flexcoders] Simple form submit example

2007-03-04 Thread nasawebguy
I need basic example code for a simple form submit. 
I'm using a flex form 
and have a ColdFusion CFC to do the insert. 

What I need is what gets the two talking?

I'm not using FDS at this point. Just ColdFusion MX7.02.

I assume I should use a remoteobject, but I don't know how to pass 
the flex form data to it when the user click submit.

What goes in the onclick on the submit button?
What AS do I need to pass the form data to the remoteobject?
What should the remoteobject look like to pass the data to the CFC?

I'm just learning flex, but I'm used to ColdFusion flash forms using 
cfinvoke arguments. I assume it is done using remoteobject instead 
of cfinvoke. But I'm open to the easiest way to do it.

Thanks,
Don






[flexcoders] Re: Making itemRenders call a function on the component they're in

2007-03-04 Thread João
Great, thanks! That should work just fine. 

But in the meanwhile i've realized that i need the checkboxes to
access some data on the component to define their selected state.
The right solution would be to change my dataProvider
(listOfAllSports:ArrayCollection) of SportVO (id:Number, name:String)
so it included another field on the VO's (selected:Boolean), but that
would change the meaning of my VO's (bad practice).

So i'm stuck. Or i find a way of having a dataProvider which is a
modified version of my listOfAllSports including a selected:Boolean
for each VO, or i find a way of making my itemRenderers access data on
my component (bad practice). I can't figure out how to solve this,
since, for the first solution, i would need two ArrayCollections
binded but with different datatypes. 


Flex is a new world to me, i'm loving it, but hating being stuck all
the time i try to do something new.

João Saleiro



[flexcoders] Bizarre Accordion Compilation Issue

2007-03-04 Thread jjkruse1
My app is suddenly failing to compile, giving the following error:

TypeError: Error #1034: Type Coercion failed: cannot convert 
mx.controls::[EMAIL PROTECTED] to mx.core.Container.
at 
mx.containers::Accordion/mx.containers:Accordion::commitSelectedIndex()
[C:\dev\GMC\sdk\frameworks\mx\containers\Accordion.as:1580]

There are two accordions in the app, both populated with forms. I've 
deleted all the labels that were in the forms previously, but still 
get the same error. I'm at a complete loss here. Any ideas?




[flexcoders] TabNavigator - reset to the first tab

2007-03-04 Thread Flayoo

Hi,
how can I set the tabIndex to 0, if the dataProvider changes ?

mx:TabNavigator id=tab width=600 height=300 
mx:Repeater id=itxt dataProvider={infodaten} repeatEnd=init()
v:InfoTextzeile sprache={itxt.currentItem.spr} 
/v:InfoTextzeile
/mx:Repeater
/mx:TabNavigator

I tried:

public function init ():void
{
tab.selectedIndex = 0
Log.Debug(Index + tab.selectedIndex);
}

But this doesn´t work because tab.selectedIndex is always 0

Thanks,
Flayoo





Re: [flexcoders] Re: How does sprite listener work?

2007-03-04 Thread sand wish
Thanks leds,
really helpful!

Additionally, the default hitarea is sprite itself. cmt.hitArea= cmt; can be 
omitted.
^ ^

- 原始邮件 
发件人: leds usop [EMAIL PROTECTED]
收件人: flexcoders@yahoogroups.com
已发送: 2007/3/4(周日), 下午8:45:09
主题: Re: [flexcoders] Re: How does sprite listener work?

the modal alert window causes your problem. When the
modal Alert activates, it 'forces' your mouse to leave
that sprite and hence making it think that a mouse
rollOUT event took place. try this to verify:

?xml version=1.0 encoding=utf- 8?
mx:Application
xmlns:mx=http://www.adobe. com/2006/ mxml
layout=vertical 
mx:Script

![CDATA[
import mx.controls. Alert;

private function mouseDoubleClickLis tener
(event:MouseEvent) :void
{

var cmt:Sprite=new Sprite();

cmt.graphics. lineStyle
(2,0x00, 1);
cmt.graphics. beginFill
(0xff,1) ;
cmt.graphics. drawCircle( event.localX, event.localY,
10);

cmt.graphics. endFill() ;
a.rawChildren. addChild( cmt);
cmt.hitArea= cmt;
cmt.addEventListene r(MouseEvent. ROLL_OVER,
mouseOverListener) ;
cmt.addEventListene r(MouseEvent. ROLL_OUT,
mouseOutListener) ;
b.mouseEnabled= false;
//}
}

private var ctr:int=0;

private function mouseOverListener
(event:MouseEvent) :void
{ 
testtext.text= rollover:  +ctr.toString( );
ctr++;

}

private function mouseOutListener
(event:MouseEvent) :void
{

testtext.text=  rollout:  +ctr.toString( );
ctr++;
}

]]
/mx:Script
mx:Panel id=a mouseEnabled= false
mx:Canvas id=b width=474 height=471 
doubleClick= mouseDoubleClic kListener( event)
doubleClickEnabled= true/
/mx:Panel
mx:Text id=testtext text=Text/ 
/mx:Application

You will see that the counter only increments once for
every mouseover and mouse out.

Cheers,
-leds

--- Sandwish sandwish_mx@ yahoo.com. cn wrote:

 Thanks,Gordon!
 
 ?xml version=1.0 encoding=utf- 8?
 mx:Application
 xmlns:mx=http://www.adobe. com/2006/ mxml 
 layout=vertical 
 mx:Script
 ![CDATA[
 import mx.controls. Alert;
 
 private function mouseDoubleClickLis tener
 (event:MouseEvent) :void
 {
 
 var cmt:Sprite=new 
 Sprite();
 
 cmt.graphics. lineStyle
 (2,0x00, 1);
 cmt.graphics. beginFill
 (0xff,1) ;
 cmt.graphics. drawCircle
 (event.localX, event.localY, 10); 
 
 cmt.graphics. endFill() ;
 a.rawChildren. addChild
 (cmt);
 cmt.addEventListene r
 (MouseEvent. ROLL_OVER, mouseOverListener) ;
 cmt.addEventListene r
 (MouseEvent. ROLL_OUT, mouseOutListener) ;
 //}
 }
 
 private function mouseOverListener
 (event:MouseEvent) :void 
 { 
 Alert.show( rollover );
 
 }
 
 private function mouseOutListener
 (event:MouseEvent) :void 
 { 
 Alert.show( rollout) ;
 }
 
 ]]
 /mx:Script
 mx:Panel id=a
 mx:Canvas id=b width=500 height=500 
 doubleClick= mouseDoubleClic kListener( event) 
 doubleClickEnabled= true/
 /mx:Panel
 /mx:Application
 
 Run the code and the problem is obvious.
 
 Regards.
 
 --- In [EMAIL PROTECTED] ups.com, Gordon Smith
 [EMAIL PROTECTED]  wrote:
 
  It's not obvious to me why that would be
 happening. Can you post 
 the
  code for a simple app which demonstrates the
 problem?
  
  - Gordon
  
   _ _ __
  
  From: [EMAIL PROTECTED] ups.com 
 [mailto:[EMAIL PROTECTED] ups.com] On
  Behalf Of Sandwish
  Sent: Tuesday, February 27, 2007 11:22 AM
  To: [EMAIL PROTECTED] ups.com
  Subject: [flexcoders] How does sprite listener
 work?
  
  
  
  I new a sprite and addeventlistener which listens
 roll_over and
  roll_out event. But after a circle is drawn with
 beginfill and
  endfill, each time I roll inside the circle, both
 events get 
 invoked.
  I don't know why? :(
  
  Thanks in advance!
  Regards,
  Sand
 
 
 
 

 _ _ _ _ _ _
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail. yahoo.com





___ 
雅虎免费邮箱-3.5G容量,20M附件 
http://cn.mail.yahoo.com/

[flexcoders] Re: Trouble retrieving embedded cuePoints with Flex VideoDisplay

2007-03-04 Thread Mark Judd
While I'm still uncertain as to why the .cuePoints array isn't easily
accessible to the videoDisplay or the CuePointManager, I did manage to
get to the information another way -- by listening to the
metadataReceived event:

  videoDisplay.addEventListener('metadataReceived', handler); 

and then coding the handler to retrieve the cuePoints via

   function handler (ev: MetadataEvent): void {
 var cuePoints: Array = ev.info.cuePoints;
 ...
   }





[flexcoders] TabNavigator - reset to the first tab

2007-03-04 Thread maticpel
Hi,
how can I set the tabIndex to 0, if the dataProvider changes ?

Example: http://www.ubuntuusers.de/paste/8035/

If you click on the second tab and then button 5 Seiten you see the
content of the first tab but the second tab is always selected. 

Thanks,
Flayoo 



[flexcoders] Flex htmlText Size

2007-03-04 Thread danneri21
Hi all,

I have a Rich Text Editor which value (htmlText) is stored in a
database.

With just typing anything in and not modifying the size, color etc. it
always turns out like this:

TEXTFORMAT LEADING=2P ALIGN=LEFTFONT FACE=Verdana SIZE=10
COLOR=#0B333C LETTERSPACING=0 KERNING=0

When I output the data from the database with PHP, here is what it turns
out to be:

Link to image
http://img259.imageshack.us/img259/3638/flexhtmltexttp1.png

What's wrong?




[flexcoders] Bizarre Accordion Compilation Issue--Never Mind

2007-03-04 Thread jjkruse1
Sorry to bother on this. Found spurious label component in code not 
shown in design layout. Sheesh! 2 hrs blown.



Re: [flexcoders] Storing VO in Sessions AMFPHP?

2007-03-04 Thread Patrick Mineault
It's been mentioned and solved here:

http://nothinghappens.net/?p=127

Patrick

Kevin a écrit :

 looks like my problem is: __PHP_Incomplete _Class_Name  
  __PHP_Incomplete_ Class Object


 from PHP.net:
 'If you have saved an object in session, you must define the class of 
 the object before the session_start( ).
 If you don't do that, php will not know the class of the object, and 
 his type will be __PHP_Incomplete_ Class.'

 Has anyone found a work around for this with AMFPHP?  My thought is 
 that i have to try to modify some of the AMFPHP code to add includes 
 before the session start...I am wondering if it is worth it.

 - Kevin




 On Mar 3, 2007, at 4:23 PM, Kevin wrote:

 Does anyone know of a problem with storing VO's in session with PHP?
 It doesn't seem to be working and before try to make it work, I
 figured it was best to see if it is even possible.

 Thanks, Kevin


  



Re: [flexcoders] Can I use Flash Library items in Flex, if so, how?

2007-03-04 Thread greg h

Mark,

I have had success making calls to my AS3 SWFs  compiled in Flash
using the Flash
Professional 9 ActionScript 3.0
Previewhttp://labs.adobe.com/technologies/flash9as3preview/
.

The Flash Professional 9 ActionScript 3.0 Preview has been public for over
8 months.  I say shame on Adobe for publishing nothing on how to integrate
Flash authored AS3 SWFs into Flex 2 apps.  Nothing.

But huge thanks to Jesse Warden.  If you have not already, please review the
following 2 posts by Jesse on the topic.  Note:  the first link includes
downloadable code.  It has been a few weeks since I was in either Jesse or
my code.  I do recall that in the first article Jesse documented a few
requirements that I had not seen elsewhere and likely never would have
guessed.

Flash 9 Button in Flex 2, August 27, 2006
http://www.jessewarden.com/archives/2006/08/flash_9_button.html

Integrating a Flash Interface into Flex 2, December 17, 2006
http://www.jessewarden.com/archives/2006/12/integrating_a_f.html

If you are still unable to accomplish what you need to after reviewing
Jesse's posts, please post back and I will go into the code and see if I can
provide you a walkthrough.

Of course, please also post back if you do succeed in getting your Flash
authored AS3 SWFs working in Flex 2.

hth,

g

On 3/3/07, Mark [EMAIL PROTECTED] wrote:


I'm trying to load a flash 9 SWF into Flex with some luck.  I can
get it in there with SWFLoader but now how can I use something from
the Flash Library… or can I?

I get this error when I run the code below ReferenceError: Error
#1065: Variable Radar is not defined.  But when I Dismiss All
then click the button in the app it will move the radar movieClip
that sits on the Flash Stage.  I'm confused as to what this error is.

For the library item - If it was being done in Flash, I'd use
attachMovie () like:

var cPoint:MovieClip = circle.attachMovie(pointer, 'point' +
counter, 0 + counter, {_x:centerX + x, _y:centerY + y, date:cDate});

which would place the item on the stage as many times as I need it
depending on the number of nodes from my XML.  Is there a way to do
this in Flex using my loaded SWF?

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute creationComplete=init(event)
mx:Script
![CDATA[
import flash.events.*;
import flash.net.URLRequest;
import mx.controls.SWFLoader;
import mx.utils.ObjectUtil;
[Bindable]
private var loaded:Boolean = false;
private var swfContent:MovieClip;
private var myLoader:SWFLoader = new SWFLoader();

private function init(e:Event):void{
myLoader.showBusyCursor = true;
myLoader.addEventListener
(Event.INIT,loadHandler);
this.addChild(myLoader);
myLoader.y = 25;
myLoader.x = 25;
myLoader.load(Flash/radarFlexNoScript.swf);
}
private function loadHandler(e:Event):void{
loaded = true;
swfContent = e.target.content;
}

private function setRadar ():void {
//swfContent.getChildByName('radar').x = 0;
swfContent.radar.y += 20;
//swfContent.addChild('myPoint');
}


]]
/mx:Script
mx:Button click=setRadar() label=Set Something /
/mx:Application



RE: [flexcoders] Can I use Flash Library items in Flex, if so, how?

2007-03-04 Thread David Mendels
Hello,
 
BTW, we are looking to make this workflow much easier in the releases of
Flash Professional and FlexBuilder this year.
 
-David



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of greg h
Sent: Sunday, March 04, 2007 7:02 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Can I use Flash Library items in Flex, if so,
how?



Mark,

I have had success making calls to my AS3 SWFs  compiled in Flash using
the Flash Professional 9 ActionScript 3.0 Preview
http://labs.adobe.com/technologies/flash9as3preview/ .

The Flash Professional 9 ActionScript 3.0 Preview has been public for
over 8 months.  I say shame on Adobe for publishing nothing on how to
integrate Flash authored AS3 SWFs into Flex 2 apps.  Nothing.

But huge thanks to Jesse Warden.  If you have not already, please review
the following 2 posts by Jesse on the topic.  Note:  the first link
includes downloadable code.  It has been a few weeks since I was in
either Jesse or my code.  I do recall that in the first article Jesse
documented a few requirements that I had not seen elsewhere and likely
never would have guessed.

Flash 9 Button in Flex 2, August 27, 2006
http://www.jessewarden.com/archives/2006/08/flash_9_button.html
http://www.jessewarden.com/archives/2006/08/flash_9_button.html 

Integrating a Flash Interface into Flex 2, December 17, 2006
http://www.jessewarden.com/archives/2006/12/integrating_a_f.html
http://www.jessewarden.com/archives/2006/12/integrating_a_f.html 

If you are still unable to accomplish what you need to after reviewing
Jesse's posts, please post back and I will go into the code and see if I
can provide you a walkthrough.

Of course, please also post back if you do succeed in getting your Flash
authored AS3 SWFs working in Flex 2.

 hth,

 g


On 3/3/07, Mark [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote: 

I'm trying to load a flash 9 SWF into Flex with some luck.  I
can
get it in there with SWFLoader but now how can I use something
from
the Flash Library... or can I?

I get this error when I run the code below ReferenceError:
Error 
#1065: Variable Radar is not defined.  But when I Dismiss All
then click the button in the app it will move the radar
movieClip
that sits on the Flash Stage.  I'm confused as to what this
error is. 

For the library item - If it was being done in Flash, I'd use
attachMovie () like:

var cPoint:MovieClip = circle.attachMovie(pointer, 'point' +
counter, 0 + counter, {_x:centerX + x, _y:centerY + y,
date:cDate}); 

which would place the item on the stage as many times as I need
it
depending on the number of nodes from my XML.  Is there a way to
do
this in Flex using my loaded SWF?

?xml version=1.0 encoding=utf-8? 
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml
http://www.adobe.com/2006/mxml 
layout=absolute creationComplete=init(event)
mx:Script
![CDATA[ 
import flash.events.*;
import flash.net.URLRequest;
import mx.controls.SWFLoader;
import mx.utils.ObjectUtil;
[Bindable]
private var loaded:Boolean = false;
private var swfContent:MovieClip;
private var myLoader:SWFLoader = new
SWFLoader();

private function init(e:Event):void{
myLoader.showBusyCursor = true;
myLoader.addEventListener
(Event.INIT,loadHandler);
this.addChild(myLoader);
myLoader.y = 25;
myLoader.x = 25;
myLoader.load(Flash/radarFlexNoScript.swf);
}
private function loadHandler(e:Event):void{
loaded = true;
swfContent = e.target.content;
}

private function setRadar ():void {
//swfContent.getChildByName('radar').x =
0;
swfContent.radar.y += 20;
//swfContent.addChild('myPoint');
}


]]
/mx:Script
mx:Button click=setRadar() label=Set Something / 
/mx:Application



 


[flexcoders] Web Service Error Handling Problem

2007-03-04 Thread Chua Chee Seng
Hi all,

I am building a data adapter using web service.  The
mx.rpc.soap.WebService class works fine for me except in handling the
exception thrown from server side.  The problem cause that I found out
from the docs is that Flash Player doesn't read the SOAP Fault details
when the Response status code is 500.

The following URL suggest a solution:

http://stackoverflowexception.blogspot.com/2007/02/handing-web-service-exception-in-flex.html

However, after I set the status code to 200 by using response wrapper,
I got the result handler get called and not the fault handler as
explained by the URL.

Does anyone have better idea to achieve exception handling of web service?

Thanks.

Best Regards,
Chua Chee Seng



[flexcoders] Problems with The E4X approach to XML processing

2007-03-04 Thread allenyoungsjtu
Hi all,

I want to process some xml documents using actionscript. The document
is something like this:

[code]
private var blockXML:XML =
  blocks
block id='001'
  point x='0' y='0' /
  point x='50' y='0' /
  point x='0' y='50' /
/block
  /blocks;
[/code]

I thought I could use the statement as follows:

[code]
blockXML.block[0]
[/code]

to get the block id='001' / node, but it turned out that as cannot
recognise block as blockXML's property.

Is there something wrong with my approach? Or I just cannot write it
in this way? Thanks a lot!



[flexcoders] Initial Release: FlexCRUD -- Create Update Delete for Flex/amfphp/cairngorm

2007-03-04 Thread Mike Crowe
Hi Folks,

I've posted working code to http://www.crowefun.com/flexcrud

You can think of this as either:
a) A full working demo of Cairngorm/amfphp
or
b) A full template generator to build your base code.

It is based on:
* Adobe Flex 2
* Cairngorm
* AMFPHP (version 1.9+)
* PHP Doctrine – Database ORM (database abstraction layer)
* DaoFlex ActionScript models – I liked how they tied events to
each data change
* XPanel logging target from Farata Systems

Simply enter your database information, create the example database
(just create database, PHP Doctrine creates all the tables) and try it
out.

Note: The UnitTest's (both the PHP side and the Flex/amfphp side are
fully working here. Please LMK if you have an issue.




--- In flexcoders@yahoogroups.com, dorkie dork from dorktown
[EMAIL PROTECTED] wrote:

 it sounds very useful to me. the link doesn't seem to work for me.
 
 On 2/24/07, Mike Crowe [EMAIL PROTECTED] wrote:
 
  Hi folks,
 
  I'm in the process of releasing my system generation utility via
  riaforge.  Essentially, I'm using about 15 templates to generate 
  100 files.
 
  From a 1' perspective, I have created a generic template based
  system that generates:
 
* Cairngorm commands:  Get, GetAll, Save, Delete
* Cairngorm events:  GetSuccess, GetFailure, etc.
* Cairngorm control file
* amfphp Remote Delegate
* amfphp ViewObject for both Actionscript and PHP
* amfphp Service dispatcher
* amfphp DTO file to save ViewObject to database
* Unit test structures for testing both PHP-Database and Flex-
  PHP-Database operations for all tables.
* etc.
 
  I based the database on PHP Doctrine, which handles all my database
  interaction in a very clean manner.
 
  Here's the help I need.  To me, I think this will be very helpful to
  somebody *starting* a new project.  It will generate all the core
  tables, events, commands, and directories for a basic system.
  However, I need some review from the Flex community to tell me if
  I'm way off base on this.  If it isn't useful, please be honest and
  provide that feedback.
 
  Here's the initial wiki documenting the core.  I'll shoot to release
  the full code tomorrow:
 
  http://www.your-solutions.us/doku.php/start
 
  TIA
  Mike
 
 
 
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
  Yahoo! Groups Links
 
 
 
 





[flexcoders] How to Copy object with same base class

2007-03-04 Thread Dan
Hi,

Does anyone know the way how to copy two objects of differet class say 
D1 and D2, that derived from the same B1 base class?
Is that i need to copy all the attribute from B1 one by one in D1 to D2 
explicity

The reason i want to do it is because the DTO from the server side is 
quite different from what a datagrid or other client side component 
expected, so what i trying to do is to flatten some of the attribute of 
those DTO first ( a type conversion ). and the B1 is some how some 
version keeping information which i don't want to touch with.

Any people has any idea? Thx for any opinion.

Daniel 



Re: [flexcoders] Problems with The E4X approach to XML processing

2007-03-04 Thread greg h

Hi allenyoungsjtu,

When I run your code, this is what I get returned:

block id=001
 point x=0 y=0/
 point x=50 y=0/
 point x=0 y=50/
/block

Is this what you meant by the block id='001' / node?  If not, could you
please cut and paste in the return value that you would expect given the
value of blockXML.  Or what are you seeing that leads you to conclude it
turned out that as cannot recognise block as blockXML's property?

Here is my MXML:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 

   mx:Script
   ![CDATA[

   [Bindable]
   private var blockXML:XML =
blocks
  block id='001'
point x='0' y='0' /
point x='50' y='0' /
point x='0' y='50' /
  /block
/blocks;

   ]]
   /mx:Script

   mx:TextArea text={blockXML.block[0]}
   height=100%
   width=90%/

/mx:Application

hth,

g

On 3/4/07, allenyoungsjtu [EMAIL PROTECTED] wrote:


Hi all,

I want to process some xml documents using actionscript. The document
is something like this:

[code]
private var blockXML:XML =
  blocks
block id='001'
  point x='0' y='0' /
  point x='50' y='0' /
  point x='0' y='50' /
/block
  /blocks;
[/code]

I thought I could use the statement as follows:

[code]
blockXML.block[0]
[/code]

to get the block id='001' / node, but it turned out that as cannot
recognise block as blockXML's property.

Is there something wrong with my approach? Or I just cannot write it
in this way? Thanks a lot!



[flexcoders] I want to write a tutorial

2007-03-04 Thread danneri21
Hey guys,

I want to write another tutorial on Flex.

So far I've written on how to create a login system with flex and php,
and an mp3 player in flex.

Any suggestions on what I should do next?

I'm fresh out of ideas :p



Re: [flexcoders] I want to write a tutorial

2007-03-04 Thread Sajid Hussain

Using AmfPhp as FDS  like sabreAmf  I saw one artcile on that and if amfphp 
supports  

Php webServices and Flex 
Flex and Php Streaming Flv 
Flex and Appollo Differce  

danneri21 [EMAIL PROTECTED] wrote:  Hey guys,
 
 I want to write another tutorial on Flex.
 
 So far I've written on how to create a login system with flex and php,
 and an mp3 player in flex.
 
 Any suggestions on what I should do next?
 
 I'm fresh out of ideas :p
 
 
 
   

 
-
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.

RE: [flexcoders] How to align chart items in two charts?

2007-03-04 Thread Ely Greenfield
 
 
 
That's just what we like to hear ;)
 
Ely.
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mikhail Shevchuk
Sent: Saturday, March 03, 2007 12:39 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] How to align chart items in two charts?



Wow. Its amazing how simple the solution is. Thanks, Ely.


2007/3/2, Ely Greenfield [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
: 



 
 
by default charts compute their gutterLeft and gutterRight
dynamically, but if you need to get two charts to align, you can set
them to explicit values. You lose a little bit of flexibility in
axis/label layout...it will fit the axes to the space available rather
than choosing the best space available for the labels, but if you choose
appropriate values it should work fine.
 
Ely.
 



From: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com http://yahoogroups.com ] On Behalf
Of Mikhail Shevchuk
Sent: Friday, March 02, 2007 1:44 AM
To: Flex
Subject: [flexcoders] How to align chart items in two charts?




Hello, Flexcoders.

I have two charts one below another. They are quite similar and
use the same horizontal axeses. But the problem is that I can't get the
correct chart view. The problem is that they have different positions of
start and end points on the canvas. How to align those vertical axes
vertically? I've attached two small pictures to show you what I mean. 

Saying another words, I need to align the chart points
vertically, as axes.

Thanks.
-- 
A vivid and creative mind characterizes you. 








-- 
A vivid and creative mind characterizes you. 

 


Re: [flexcoders] I want to write a tutorial

2007-03-04 Thread Adam Royle
How bout a tutorial on how to write the next killer app?


  - Original Message - 
  From: danneri21 
  To: flexcoders@yahoogroups.com 
  Sent: Monday, March 05, 2007 3:38 PM
  Subject: [flexcoders] I want to write a tutorial


  Hey guys,

  I want to write another tutorial on Flex.

  So far I've written on how to create a login system with flex and php,
  and an mp3 player in flex.

  Any suggestions on what I should do next?

  I'm fresh out of ideas :p



   

RE: [flexcoders] legend on top of chart

2007-03-04 Thread Ely Greenfield
 
 
Hi Marc.  The easiest way is to just put your chart in a canvas, and put
the legend on top of it.  I've been meaning to make a simple annotation
that just owns a legend, but haven't gotten around to it.  It shouldn't
be too much work, so if you want to take it on, the community would
appreaciate it ;)
 
Ely.
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of mr19
Sent: Saturday, March 03, 2007 2:16 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] legend on top of chart




Hi all -

Is there anyway to put the Legend component ON the chart? I'd like to
move
my legend to the upper left hand corner of my chart but can't seem to
pull
it off.

TIA,
Marc
-- 
View this message in context:
http://www.nabble.com/legend-on-top-of-chart-tf3340394.html#a9290337
http://www.nabble.com/legend-on-top-of-chart-tf3340394.html#a9290337 
Sent from the FlexCoders mailing list archive at Nabble.com.



 


Re: [flexcoders] I want to write a tutorial

2007-03-04 Thread Bjorn Schultheiss

1 on papervision 3d and flex 2 ;)

On 05/03/2007, at 4:38 PM, danneri21 wrote:


Hey guys,

I want to write another tutorial on Flex.

So far I've written on how to create a login system with flex and php,
and an mp3 player in flex.

Any suggestions on what I should do next?

I'm fresh out of ideas :p







[flexcoders] Files/Libs for Tomcat 5x to run FLEX applications

2007-03-04 Thread techunar
Hello there, 

Currently I am running  testing my applications on FDS-TOMCAT
available at:
http://coenraets.org/blog/2007/01/flex-test-drive-server-for-java-developers-tomcat-based/

Now I want to deploy my applications on Tomcat 5x, in past I just
copied the WEB-INF folder of fds-tomcat  pasted all files in WEB-INF
of my Tomcat  it was all running. 

Please help me, if anyone has the checklist of what files should be
included in libs or jars folders etc, in order to run applications of
Flex on Tomcat which utilizes Hibernate. ( files like mySQL connector
driver, hibernate resources etc).



[flexcoders] Disable Clicks while on busyCursor

2007-03-04 Thread Bjorn Schultheiss
Hey,

Is there a way to disable all mouse clicks while CursorManager is set  
to busyCursor?


Regards,

Bjorn


[flexcoders] Re: Flex Prototyping Best Practices

2007-03-04 Thread akhilbhaskar
I've actually been using Cairngorm
(http://labs.adobe.com/wiki/index.php/Cairngorm) as a
micro-architecture for my apps.  Once I have most of my back-end
architecture in place, I simply create a Mock Business Delegate and
populate the values in that class using my real DTOs.  Once you know
where the values are actually coming from, simply swap out your mock
object with the real HTTPService/DataService,etc call.

-Akhil Bhaskar
Amentra, Inc. (http://www.amentra.com)


--- In flexcoders@yahoogroups.com, Jeffry Houser [EMAIL PROTECTED] wrote:

 
   I've been hard coding sample data into ArrayCollections.
 
   I bet there are better ways, though.
 
 
 
 At 05:19 PM 3/2/2007, Clarke Bishop wrote:
 
 I've become a big believer in iterative development and in starting 
 my Flex apps by working on the U/I. Then, only after I can freeze 
 the U/I, do I start on the backend.
 
 It's easy enough to drag some controls into an application, but I'm 
 not as sure the best ways to populate the controls with sample data. 
 What's the best practice? And what way makes it easiest to modify 
 the sample data and ultimately switch to developing the back end 
 with minimum impact on my Flex code?
 
 If any of you have any other tips for a good Flex development 
 process, I'd love to hear your thoughts on that, too!
 
 Thanks,
 
 Clarke
 
 
 --
 Jeffry Houser, Software Developer, Writer, Songwriter, Recording
Engineer
 AIM: Reboog711  | Phone: 1-203-379-0773
 --
 My Company: http://www.dot-com-it.com
 My Podcast: http://www.theflexshow.com
 My Blog: http://www.jeffryhouser.com
 Connecticut Macromedia User Group: http://www.ctmug.com





[flexcoders] Re: I want to write a tutorial

2007-03-04 Thread iko_knyphausen

Here comes a list of ideas:

1. First you should define who your audience is. Keep in mind, very
good tutorials have been made already - so if you want to add value, you
have to explore uncharted territory. Login is a start, but it will not
win you a Pulitzer prize...
2. I think you should analyze this message board...it will tell you
what people are struggling with at various stages. Add to the mix, what
you yourself have been struggling with.
3. Make sure that what you write about is not hear-say (or read
somewhere) but actual experience. You will need to back it up,
reproduce cases, etc. You cannot teach what you have not experienced. In
other words, don't try anything abstract.
4. On a positive note: I think you could write an entire tutorial on
how to best use the DataGrid control. It's a highly complex topic, with
plenty of depth to dive into.
5. On a lighter note, a good movie about teaching is the recent DVD
release of Guardian. I am mentioning it because I think it illustrates
the importance of experience.

Other than that, good luck - and hopefully a good tutorial...



[flexcoders] graphics Class

2007-03-04 Thread sanjaypmg
Hi All,

I have drawn some graphical objects on runtime using graphics class in 
Flex/Flash.

I want to save that drawing in my local hardisk or some other location.

How can I do that? pls give me some hint.

Or

Is there anyway to export a JPG, GIF or PNG etc..?

Kinldy help me out.

Thanks in Advace,
SS



[flexcoders] How Can I save the drawing made at runtime

2007-03-04 Thread sanjaypmg
Hi All,

I have made a screen where user can draw some SHAPES using graphics 
class at runtime using . I wanna give a functionality to save that 
object/drwaings once the it is completed. And He/She can open it 
whenever he/she wants.

How can I save that objects? or Is there anyway to export those 
objects as JPG, GIF or PNG, etc..?

Pls help me to do this..

Thanks in Advance,
SS