RE: [flexcoders] database question

2009-04-03 Thread shaun mccran

You can simply do a select on the first 'id' if your query is ordered 
correctly, like:

 

Select top1 id

from table

order by id desc

 

Or there may be a function in access to return the latest ID. In MS SQL and 
MySql there are similar functions such as:

 

SELECT LAST_INSERT_ID() AS lastInsertID FROM mytable

 

Simply do another insert on the second table then.



Shaun McCran
 
T:  07792 783 184
E:  sh...@mccran.com
W: www.mccran.co.uk


 



To: flexcoders@yahoogroups.com
From: johndoemat...@yahoo.com
Date: Fri, 3 Apr 2009 07:38:11 +
Subject: [flexcoders] database question





hi i know this is not a flex question but is related to flex anyway. i have an 
access database with two tables A and B. the two are related in that the 
primary key of A(which is autonumber) is related to the foreign key in B. not i 
would like that when i insert data in the two tables A and B the foreign key of 
B is set to equal to the auto generated Primary key of A. How can i do this 
with coldfusion. i dont wanna do it in access itself but in the coldfusion 
query. thanks









_
Share your photos with Windows Live Photos – Free.
http://clk.atdmt.com/UKM/go/134665338/direct/01/

RE: [flexcoders] Re: database question

2009-04-03 Thread shaun mccran

You can do that in MS SQL with a trigger.

 

Think of it as an event that fires when a condition is met.

 

IE when table A gets a new entry, the trigger on the ID field will perform a 
specified script. (your insert into Table 2)

 

Not sure if its possible in Access tho.

 

These guys seem to think not:

http://forums.databasejournal.com/showthread.php?threadid=44091


Shaun McCran
 
T:  07792 783 184
E:  sh...@mccran.com
W: www.mccran.co.uk


 



To: flexcoders@yahoogroups.com
From: johndoemat...@yahoo.com
Date: Fri, 3 Apr 2009 15:51:11 +
Subject: [flexcoders] Re: database question





Here is a thought(i know am grasping at straws but will try).is there a way to 
set the foreign key field in table B to equal the primary Key field of table A 
so that when an entry is made it reflects. more like binding the two fields 
together.









_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/

RE: [flexcoders] Re: Creating exceptions to an eventlistener

2009-04-02 Thread shaun mccran

Hi,

 

I'm using 

 

outerCanvas.addEventListener( MouseEvent.MOUSE_DOWN, moveWindow );

 

where outerCanvas is the canvas that holds another canvas, that hold the 
datagrid (whew!)

 

So trace(event.currentTarget) always returns phoneBook0.outerCanvas, 
(phoneBook is the app name) 

 

So I'm unable to trap where the event has been fired from?


 

Thanks

Shaun

 




To: flexcoders@yahoogroups.com
From: timh...@aol.com
Date: Wed, 1 Apr 2009 18:31:50 +
Subject: [flexcoders] Re: Creating exceptions to an eventlistener






Hi,

First, make sure, in the Canvas tag, that mouseChildren=true. You can
also check in the drag event handler function if the currentTarget is a
canvas or not:

if ( !event.currentTarget is Canvas )
{
event.stopImmediatePropagation;
}

There are probably better ways to do this, but this is a quick fix.

-TH

--- In flexcoders@yahoogroups.com, smccran s_mcc...@... wrote:

 Hi all,

 I've got a canvas with an event listener, that allows the user to drag
the canvas around.

 The only problem is that I have a datagrid inside this canvas, and the
event listener is interfering with it.

 IE I cannot drag the slider in the datagrid, or resize the column etc,
as the event listener kicks in and moves the whole canvas instead.

 How can I create an exception for the datagrid?

 Thanks
 Shaun










_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/

RE: [flexcoders] Re: Creating exceptions to an eventlistener

2009-04-02 Thread shaun mccran

Thanks for your help, I ended out picking up the string value of the element in 
the listener:

 

var str:String = event.target.valueOf();

 

Then finding if it was the element I did not want the listener to work on.

 

if ( str.search(displayPeople) = 1)

 

 

Might not be the most elegant solution, but it works a treat.

Thanks

 

Shaun McCran
 


 



To: flexcoders@yahoogroups.com
From: huss.stu...@gmail.com
Date: Thu, 2 Apr 2009 11:03:55 +
Subject: [flexcoders] Re: Creating exceptions to an eventlistener





You are using event.currenttarget but this always points to the current object 
(the clue is in the name).

Try using event.target and that might help. I hope so.

Best of luck with it.

--- In flexcoders@yahoogroups.com, shaun mccran s_mcc...@... wrote:

 
 Hi,
 
 
 
 I'm using 
 
 
 
 outerCanvas.addEventListener( MouseEvent.MOUSE_DOWN, moveWindow );
 
 
 
 where outerCanvas is the canvas that holds another canvas, that hold the 
 datagrid (whew!)
 
 
 
 So trace(event.currentTarget) always returns phoneBook0.outerCanvas, 
 (phoneBook is the app name) 
 
 
 
 So I'm unable to trap where the event has been fired from?
 
 
 
 
 Thanks
 
 Shaun
 
 
 
 
 
 
 To: flexcoders@yahoogroups.com
 From: timh...@...
 Date: Wed, 1 Apr 2009 18:31:50 +
 Subject: [flexcoders] Re: Creating exceptions to an eventlistener
 
 
 
 
 
 
 Hi,
 
 First, make sure, in the Canvas tag, that mouseChildren=true. You can
 also check in the drag event handler function if the currentTarget is a
 canvas or not:
 
 if ( !event.currentTarget is Canvas )
 {
 event.stopImmediatePropagation;
 }
 
 There are probably better ways to do this, but this is a quick fix.
 
 -TH
 
 --- In flexcoders@yahoogroups.com, smccran s_mccran@ wrote:
 
  Hi all,
 
  I've got a canvas with an event listener, that allows the user to drag
 the canvas around.
 
  The only problem is that I have a datagrid inside this canvas, and the
 event listener is interfering with it.
 
  IE I cannot drag the slider in the datagrid, or resize the column etc,
 as the event listener kicks in and moves the whole canvas instead.
 
  How can I create an exception for the datagrid?
 
  Thanks
  Shaun
 
 
 
 
 
 
 
 
 
 
 __
 View your Twitter and Flickr updates from one place – Learn more!
 http://clk.atdmt.com/UKM/go/137984870/direct/01/










_
Share your photos with Windows Live Photos – Free.
http://clk.atdmt.com/UKM/go/134665338/direct/01/

RE: [flexcoders] Re: Connecting an AIR application to FCF through Webservices.

2009-03-30 Thread shaun mccran

So its an access problem? You can connect AIR apps to a server side object?

 

Isn't this all you need in your crossdomain.xml

 

?xml version=1.0?
!DOCTYPE cross-domain-policy SYSTEM 
http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd;
cross-domain-policy
allow-access-from domain=* /
/cross-domain-policy

 

 

Thanks

Shaun


 




To: flexcoders@yahoogroups.com
From: valdhorli...@embarqmail.com
Date: Mon, 30 Mar 2009 16:11:05 +
Subject: [flexcoders] Re: Connecting an AIR application to FCF through 
Webservices.





Your crossdomain.xml file looks outdated for the newer versions of Flash.

--- In flexcoders@yahoogroups.com, smccran s_mcc...@... wrote:

 Hi all,
 I am trying to connect an AIR app to a coldfusion back end webservice (CFC), 
 but am getting an error message:
 
 Code:
 
 mx:WebService id=popData 
 wsdl=http://www.mccran.co.uk/wld/services/phoneBook.cfc?wsdl; 
 showBusyCursor=true useProxy=true
 
 mx:operation name=getData resultFormat=object 
 fault=faultHandler(event) result=resultsHandler(event) /
 
 /mx:WebService
 
 Error:
 
 [RPC Fault faultString=Send failed faultCode=Client.Error.MessageSend 
 faultDetail=Unable to load WSDL. If currently online, please verify the URI 
 and/or format of the WSDL 
 (http://www.mccran.co.uk/wld/services/phoneBook.cfc?wsdl)]
 at 
 mx.rpc.wsdl::WSDLLoader/faultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:98]
 at flash.events::EventDispatcher/dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at 
 mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170]
 at 
 mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:222]
 at 
 mx.rpc::Responder/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]
 at 
 mx.rpc::AsyncRequest/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
 at 
 mx.messaging::ChannelSet/faultPendingSends()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1482]
 at 
 mx.messaging::ChannelSet/channelFaultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:975]
 at flash.events::EventDispatcher/dispatchEventFunction()
 
 Does anyone have any ideas why I cannot connect to a remote server?
 
 Thanks
 Shaun










_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/

Re: [flexcoders] SpringGraph and ArrayCollection

2008-12-10 Thread shaun
timgerr wrote:
 Has anyone used an arraycollection with a springgraph?
 

I played around with this just last week for an experiment..

   private function init():void {
var p:Plan = _plan;

_graph = new Graph();
 var item:Item = new Item(p.id.toString());
 item.data = p;
 _graph.add(item);
 add(item, _graph);

 roamer.currentItem = item;
 roamer.repulsionFactor = 0.4;
roamer.showHistory = true;
roamer.itemLimit=1000;
 }

 private function add(rootItem:Item, g:Graph):void{
 var p:Plan = rootItem.data as Plan; 

 for(var i:int=0; i p.children.length; i++){
 var c:Plan = p.children.getItemAt(i) as Plan;
 var item:Item = new Item(c.id.toString());
 item.data = c;
 g.add(item);
 g.link(rootItem, item);
 add(item, g);
 }
 }


adobe:Roamer id=roamer top=0 bottom=0 left=0 right=0 
width=100% height=100%
itemRenderer=XMLItemView
dataProvider={_graph}
repulsionFactor={.75}
autoLayout={true}
doubleClickEnabled={true}
autoFit={true}
 maxDistanceFromCurrent=10
 /


HTH.

  - shaun


Re: [flexcoders] Advanced datagrid dataprovider changing error

2008-11-15 Thread shaun

Hi,

Try calling validateNow on the DG after setting the DP source.
Or you might have to actually change the DP to a new HierarchicalData.

cheers,

hworke wrote:
   Hi I am trying to change the dataprovider of a
   advanced datagrid where I am using HierarchicalData
   as data provider. My ADG code is this:
 
 mx:AdvancedDataGrid width=20% height=50%
 mx:dataProvider
 mx:HierarchicalData id=HD source={dpHierarchy}/
 /mx:dataProvider
 mx:columns
 mx:AdvancedDataGridColumn dataField=Region/
 /mx:columns
 /mx:AdvancedDataGrid
 
I tried to switch the dataprovider as HD.source = anotherArray;
But it did not work. Here I am attaching the code if that 
helps to find the mistake.
 
 
***
***
***
 
 ?xml version=1.0?
 !-- dpcontrols/adg/SimpleHierarchicalADG.mxml --
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 
   mx:Script
 ![CDATA[
   import mx.collections.ArrayCollection;
 
   //include SimpleHierarchicalData.as;
   [Bindable]
   private var dpHierarchy:ArrayCollection = new 
 ArrayCollection([
 {Region:Southwest, children: [
{Region:Arizona, children: [ 
   {Region:Barbara Jennings, Actual:38865, 
 Estimate:4}, 
   {Region:Dana Binn, Actual:29885, 
 Estimate:3}]},  
{Region:Central California, children: [ 
   {Region:Joe Smith, Actual:29134, 
 Estimate:3}]},  
{Region:Nevada, children: [ 
   {Region:Bethany Pittman, Actual:52888, 
 Estimate:45000}]},  
{Region:Northern California, children: [ 
   {Region:Lauren Ipsum, Actual:38805, 
 Estimate:4}, 
   {Region:T.R. Smith, Actual:55498, 
 Estimate:4}]},  
{Region:Southern California, children: [ 
   {Region:Alice Treu, Actual:44985, 
 Estimate:45000}, 
   {Region:Jane Grove, Actual:44913, 
 Estimate:45000}]}
 ]}
   ]);
 
   [Bindable]
   private var dpHierarchy1:ArrayCollection = new 
 ArrayCollection([
 {Region:Southwest1, children: [
{Region:Arizona, children: [ 
   {Region:Barbara Jennings, Actual:38865, 
 Estimate:4}, 
   {Region:Dana Binn, Actual:29885, 
 Estimate:3}]},  
{Region:Central California, children: [ 
   {Region:Joe Smith, Actual:29134, 
 Estimate:3}]},  
{Region:Nevada, children: [ 
   {Region:Bethany Pittman, Actual:52888, 
 Estimate:45000}]},  
{Region:Northern California, children: [ 
   {Region:Lauren Ipsum, Actual:38805, 
 Estimate:4}, 
   {Region:T.R. Smith, Actual:55498, 
 Estimate:4}]},  
{Region:Southern California, children: [ 
   {Region:Alice Treu, Actual:44985, 
 Estimate:45000}, 
   {Region:Jane Grove, Actual:44913, 
 Estimate:45000}]}
 ]}
   ]);
   ]]
 /mx:Script
 
 mx:AdvancedDataGrid width=20% height=50%
 mx:dataProvider
 mx:HierarchicalData id=HD source={dpHierarchy}/
 /mx:dataProvider
 mx:columns
 mx:AdvancedDataGridColumn dataField=Region/
 /mx:columns
 /mx:AdvancedDataGrid
 mx:Button label=Button click=HD.source = dpHierarchy/
 mx:Button label=Button click=HD.source = dpHierarchy/
 /mx:Application
 
 
 



Re: [flexcoders] about MVC

2008-10-26 Thread shaun
Hi Richard,

Richard Rodseth wrote:
 I always feel compelled to point out that you don't *have* to use Cairngorm
 or PureMVC.
 
 Here's a recent article (which I haven't read):
 http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetailsproductId=2postId=11246
 
 See also the writings of Joe Berkovitz and James Echmalian (and if you're a
 musician, check out Joe's wonderful Noteflight application):
 http://www.joeberkovitz.com/blog/2007/10/18/max-2007-in-barcelona-talk-materials-online/
 
 I made a sample many moons ago. It's here:
 
 http://flexygen.wordpress.com/2008/02/07/simple-mvc-sample/

Very nice, clean example.  Thankyou.
Also worth pointing out is you do not need a framework to use dependency 
injection.
An excellent resource well worth a mention is Misko Hevery's blog. 
http://misko.hevery.com/
Which is about architecture for testability and dependency injection. 
Specifically his posts
about the Singleton design pattern and how to think about the new 
operator, are IMO, a must read.

cheers,
  - shaun


Re: [flexcoders] Do you use a Mac?

2008-10-25 Thread shaun
Hi,

For me, Windows is not even remotely comparable to OS X for a software 
development machine.
These are some very useful tools for software development that come with 
OS X. Straight out of the box.

crab:~ shaun$ which python
/usr/bin/python
crab:~ shaun$ which ruby
/usr/bin/ruby
crab:~ shaun$ which perl
/usr/bin/perl
crab:~ shaun$ which apachectl
/usr/sbin/apachectl
crab:~ shaun$ which at
/usr/bin/at
crab:~ shaun$ which emacs
/usr/bin/emacs
crab:~ shaun$ which vi
/usr/bin/vi
crab:~ shaun$ which java
/usr/bin/java
crab:bin shaun$ which diff
/usr/bin/diff
crab:share shaun$ which patch
/usr/bin/patch
crab:bin shaun$ which svn
/usr/bin/svn
crab:bin shaun$ which head
/usr/bin/head
crab:bin shaun$ which tail
/usr/bin/tail
crab:bin shaun$ which grep
/usr/bin/grep
crab:bin shaun$ which find
/usr/bin/find
crab:bin shaun$ which awk
/usr/bin/awk
crab:bin shaun$ which sed
/usr/bin/sed
crab:bin shaun$ which bash
/bin/bash
crab:bin shaun$ which zip
/usr/bin/zip
crab:bin shaun$ which tar
/usr/bin/tar
crab:bin shaun$ which ssh
/usr/bin/ssh
crab:bin shaun$ which scp
/usr/bin/scp
crab:share shaun$ which curl
/usr/bin/curl
crab:share shaun$ which ftp
/usr/bin/ftp

Then there's the free(as in beer) Apple Developer Tools, which you need 
to install, but include: XCode and all the other good stuff it brings, 
including WebObjects, IPhone SDK, general Cocoa SDK tools, various 
profilers etc etc. the list just goes on an on..
In my experience IDEs like Eclipse, Flex Builder, Netbeans etc etc work 
fine on OS X.

Basically, OS X is a /great/ developer platform.

cheers,
  - shaun



Re: [flexcoders] [flex-coders] RemoteObject synchronism problem

2008-10-21 Thread shaun
Hi Eduardo,

Eduardo Souza wrote:

[snip]

 What can I do?

The asynchronous calls are something you'll have to get used to, but 
don't worry there is plenty of information about how it all works.
I suggest reading the developer guide to begin with.

Basically.

mx:RemoteObject id=RO_User
endpoint=http://tiago:8080/ScrumBlazeDS/messagebroker/amf;
destination=UserService
showBusyCursor=true

fault=Alert.show(event.toString())

result=resultHandler   -- here.

/mx:RemoteObject
/mx:Canvas


function resultHandler(o:Object){
   //handle the result.
}

HTH.

regards,
  - shaun


Re: [flexcoders] Re: Reusing HTTPService

2008-10-17 Thread shaun

How about something like this:

(note: I've not tried it, just slapped it straight into the email)

public class MyClassThatInvokesHTTPServices {

//inner helper class.
class MyIResponder implements IResponder{
   public var f:Function;
   public var r:Function;

   public MyIResponder(r:Function, f:Function){
 this.r = r;
 this.f = f;
   }

   public function fault(info:Object):void {
   f.call(info);
   }

   public function result(result:Object):void {
   r.call(result);
   }
}

//Your handlers for service calls.
protected function resultA(result:Object){ ... }
protected function faultA(info:Object){...}
protected function resultB(result:Object){ ... }
protected function faultB(info:Object){...}

var service:HTTPService ...//assume exists, reused for various calls.

  //send for service A.
  funciton sendA(args:Object){
service.url = ../A.html;
service.send(args).addResponder(new MyIResponder(resultA, faultA));
  }

  //send for service B.
  function sendB(){
service.url = ../B.html;
service.send().addResponder(new MyIResponder(resultB, faultB));
  }


}

[snip]

 --- In flexcoders@yahoogroups.com, lagos_tout lagos.tout@ 
 wrote:
 Hi,

 I'm re-using an instance of HTTPService, changing the request 
 arguments to get different responses from the server.  But I 
 found 
 that if, for instance, I made 3 calls this way with the 
 HTTPService, 
 each of the 3 result handlers registered for each call is 
 executed 
 every time a result returned.  

 I solved this by storing a reference to the unique AsyncToken 
 returned 
 by each service call and matching it to the AsyncToken 
 contained 
 in 
 each ResultEvent's token property in order to determine 
 which 
 result 
 handler to execute. 

 I'm not terribly happy with this setup.  It seems messy.  I'd 
 appreciate any suggestions on how I can reuse an HTTPService 
 instance 
 without ending up with long switch statements with countless 
 if 
 thisAsyncToken then do thisHandler, else if thatAsyncToken 
 then 
 do 
 thatHandler... and so on.

 Thanks much.

 LT

 
 
 
 



Re: [flexcoders] custom event not working in popup

2008-10-17 Thread shaun
Mark Hosny wrote:
 Hey guys,
 
 I now know that my custom event is not working properly in my popup 
 window when listening for the event in the main app. When I do this, it 
 works:

[snip]

 
 public static const ON_TEST_CASE:String = formSubmitted;
 public function CustomEvent($type:String, $params:Object, 
 $bubbles:Boolean = true, $cancelable:Boolean = true)
 {
 super($type, true, $cancelable);
 
 this.params = $params;
 }

[snip]


You are dispatching an even with a type String value of
formSubmitted and listening/registering for formUpdate.
Change the event constant to formUpdate and it will work again..

mx:Metadata
[Event(name=formUpdate,type=com.event.CustomEvent)]
/mx:Metadata

MAIN APP
application.systemManager.addEventListener(formUpdate,handleUpdateFormSubmitted);


// event constants
public static const ON_TEST_CASE:String = formSubmitted;

new CustomEvent(CustomEvent.ON_TEST_CASE,
 {
 memberID:memberID_txt.text
 }
 );
  this.dispatchEvent(evt);


By the way, whats with the $ signs in the arg names?

HTH.

cheers,
  - shaun


Re: [flexcoders] custom event not working in popup

2008-10-17 Thread shaun
Hey,

hoz wrote:
 Hey Shaun,
 
 Thanks for the reply, and YES, it finally worked. It's always those little
 typos that gotcha's!! The $'s were just taken from code relating to PHP
 format; obviously, not needed.
 

Right, i see.  :)

 I did find it interesting that I could also do this and skip the metadata
 tag in the popup:

Yep. You use that metadata tag when you want to expose the event to a 
container component via mxml
(Eg.)
mx:Button click=handleClick(event) /
If you look at the source of mx:Button you'll see the metadata for the 
click event.

I wasn't sure if you knew that so i didn't comment on it.

So you would use the metadata tag if you wanted to do the following.

Canvas

script
  private function handleFormSubmitted(e:CustomEvent):void {...}
/script

MyComponent
   id=mc
   formSubmitted=handleFormSubmitted(event)
/

/Canvas

MyComponent would have the metadata tag declaring the name and the type 
of the event it dispatches and then it appears in FlexBuilder as a hint.

This is pretty much the same as writing the following:
mc.addEventListener(formSubmitted, handleForSubmitted);

HTH.

cheers,
  - shaun


Re: [flexcoders] Custom event - Create, dispatch, and listen to.

2008-10-16 Thread shaun
Hi,

Class names should begin with an Uppercase letter. RemoteClick not 
remoteClick.
The type String can be lowercase if you want..

Something like the following..

package modulecode
   {
import flash.events.Event;

public static const remoteClick:String=remoteClick;

public class RemoteClick extends Event
{
public function RemoteClick(type:String=remoteClick,
 bubbles:Boolean=false,
 
cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
}   
}
  }


//Some component that dispatches and handles RemoteClick events
MyCanvas

script
public function handleButtonClick():void{
  var eventObj:RemoteClick = new RemoteClick(); //no bubble
  dispatchEvent(eventObj);
}

public function handleRemoteClickEvent(e:RemoteClick):void{
trace(handleRemoteClick: +e);
}

public function init():void{
  addEventListener(remoteClick, handleRemoteClickEvent);
}
/script

  mx:FormItem label= textAlign=right
  mx:Button label=Run click=handleButtonClick()   id=run/
  /mx:FormItem

/MyCanvas


Or


//Some component that dispatches RemoteClick events. NOTE : the name of 
the event and the type.
MyCanvas2

mx:Metadata
 [Event(name=remoteClick, type=modulecode.RemoteClick)]
/mx:Metadata

script
public function handleButtonClick():void{
  var eventObj:RemoteClick = new RemoteClick(); //no bubble
  dispatchEvent(eventObj);
}
/script

  mx:FormItem label= textAlign=right
  mx:Button label=Run click=handleButtonClick()   id=run/
  /mx:FormItem

/MyCanvas2


Use MyCanvas2 in another component..

ACanvas
   script
 function handleRemoteClick(e:RemoteClick):void{ ... }
   /script

   MyCanvas2 remoteClick=handleRemoteClick(event) ... /
/ACanvas


HTH.
  - shaun


Re: [flexcoders] Re: ComboBox in Component won't open to Saved Value

2008-10-08 Thread shaun
Dan Pride wrote:
 My problem is there seems to be no way to kick the event to change
 the value. Here is the code, all of it. It can be seen in action at

[snip]

Change:
public var currentPerson:Object = new Object();

To:
private  var _currentPerson:Object = new Object();
[Bindable] public funciton set currentPerson(p:Object) void{
_currentPerson = p;

openRolePop(null);
}

public funtion get currentPerson():Object{
return _currentPerson;
}

- shaun


Re: [flexcoders] Re: [ANN] Announcing Smartypants IOC, a dependency-injection library for Flex.

2008-10-04 Thread shaun
hi Josh,

Josh McDonald wrote:
 I think it's working. Tried installing VirtualBox to test it, but it doesn't
 work. UI is unusable too :(

Perhaps allocate more memory to the OS instance. It should work fine for 
testing a web site.

cheers,
  - shaun


Re: [flexcoders] The Tree component sux but .... I need help :)

2008-10-01 Thread shaun
flashalisious wrote:
 I have a Tree Component that I have bound an ArrayCollection of data too.
 
 The tree will have two branches. each branch will have several
 children. Basically a list of files. So the user will upload a new
 file by clicking an browsing for a new file.
 
 I then as AMFPHP to give the list of files again and update the
 ArrayCollection with new data. Before I ask for the new
 ArrayCollection of data I store the try components open items like this
 
 tempOpenItems = mytree.openItems;
 
 after the new data is set I then would like to say 
 
 mytree.openItems = tempOpenItems;
 
 this does not work.

The Objects in tempOpenItems do not exist in the updated data. As you 
said yourself, after the new data is set ie) they are a set of 
different objects! Use some sort of unique id to identify the objects.

cheers,
  - shaun


Re: [flexcoders] AS3 - single-fire event listener

2008-09-27 Thread shaun
Matt Bennett wrote:
 Hi all,
 
 In certain javascript libraries I've used previously, there is the
 ability to create a single-fire event listener -- one that
 automatically removes itself as a listener immidiately after it has
 executed.
 
 I'd really like a generic solution that just involved an overridden
 'addEventListener' function and an optional 'single-fire' argument.
 Hopefully someone out there has solved this problem already.
 
 In the mean time however, I tried a more simplistic approach - calling
 removeEventListener inside my listener function, so it runs once and
 then removes itself. I can't get this approach to work for anonymous
 functions though, because I don't know how the anonymous function can
 refer to itself. There doesn't appear to be anything useful in the
 Event object passed to the listener, the 'this' keyword refers to
 something else, and I don't know how to alter the scope with which the
 listener function is called.
 
 Does anyone have a simple way to acheive this?
 
 Many thanks,
 Matt.

http://blog.iconara.net/2007/11/05/a-generic-way-to-remove-an-event-listener/

cheers,
  - shaun


Re: [flexcoders] Overriding Combobox and ListBase

2008-09-26 Thread shaun
Hi John,

John Luke Mills wrote:
 I am trying to modify Combobox so one can type multiple characters into a
 non-editable drop-down.  Combobox.as uses ListBase.as.  In ListBase there is
 the following:
 
  
 //--
 //
 //  Methods: Keyboard lookup
 //
  
 //--
 
 /**
  *  Tries to find the next item in the data provider that
  *  starts with the character in the codeeventCode/code parameter.
  *  You can override this to do fancier typeahead lookups.  The search
  *  starts at the codeselectedIndex/code location; if it reaches
  *  the end of the data provider it starts over from the beginning.
  *
  *  @param eventCode The key that was pressed on the keyboard
  *  @return codetrue/code if a match was found
  */
 protected function findKey(eventCode:int):Boolean
 {
 var tmpCode:int = eventCode;
 var junk:int = 4;
 junk += 4;
 
 
 return tmpCode = 33 
tmpCode = 126 
findString(String.fromCharCode(tmpCode));
 }
 
 What do I have to do to have my own version of this?  Various attempts to
 make my own copy or extend and override this function  haven't worked.
 
 Thanks,  John Luke Mills
 
 

List extends ListBase. Extend List, override the findKey function as 
you need. Then modify the code for ScrollableComboBox(below) to use your 
List subclass.

http://javatoflex.blogspot.com/2008/09/scrollablecombobox.html


Change the line:

   public var clazz:Class = mx.controls.List;

to reference your own subclass of List.

   public var clazz:Class = com.foo.controls.MyList;

HTH.
   - shaun



Re: [flexcoders] FlexBuilder debugging kills ITunes

2008-09-21 Thread shaun
Brendan Meutzner wrote:
 Hi All,
 I'm sorry to post this not so technical question, but I figured it'd be
 the best place to see if other folks have this same frustration that I do.
 
 My dev machine is a Macbook Pro running Leopard, and I'm working with
 FlexBuilder 3.0.1.  I've found that whenever I go to debug an app and it
 hits a breakpoint, my ITunes audio output begins skipping/hopping/jumping
 etc... It's terribly annoying!
 
 I've never had this issue on my Mac Pro running the same environment...
 EXCEPT... I haven't pushed up to 3.0.1 hotfix for FlexBuilder there yet...
 just running 3.0.
 
 Has anyone else had this happen to them?  I'd love to just switch to
 another audio player, but having a lot of ITunes content, it would be really
 annoying to convert.
 
 
 Brendan

man renice

Might help.

cheers,
  - shaun


Re: [flexcoders] Delete Object - Why does this not work?

2008-09-18 Thread shaun
Mark Easton wrote:
 var myobj:Object = new Object();
 delete myobj;
 
 This returns the error: Attempt to delete the fixed property myobj.  Only
 dynamically defined properties can be deleted.
 
  
 
 Why is that? So how do I delete myobj when I want to create a new myobj
 instance?
 

var o:Object = new Object(); //o is a fixed property of the current
  // class

o.cheesecake = true; //cheesecake is a dynamically defined property

delete o.cheesecake; //can delete a dynamic property.

o = null;//can set the fixed to null, garbage collector will
  //clean up.

o = new Object();// or can just create a new object and the old will 

  //be cleanued up by gc.


HTH.

cheers,
  - shaun


Re: [flexcoders] Convert String to Date?

2008-09-15 Thread shaun
Mark Easton wrote:
 Gosh, I cant believe I am asking this question. But, other than parsing the
 string I cannot see anyway to obviously convert my string to a date format.
 My string is returned from a SQL query and passed to my app via XML.
  
 So my string is in the format:  YYY-MM-DD HH:M:SS. This is a standard SQL
 format. So why can I not easily convert that in to a date format in flex?
  
 I have looked at the Date and DateField classes but no help there.
 DateField.stringToDate for instance only accepts date formats (no time).
 Date for instance wants a date in the format (as follows) ... 
  
 var date:Date = new Date(Mon May 1 2006 11:30:00 AM);
  
 Hmmm - what a pain! Any one have a solution?
  

Have you looked at:  mx/formatters/DateFormatter.html

cheers,
  - shaun


Re: [flexcoders] Printf style formatting of numbers to have leading and trailing 0's?

2008-09-10 Thread shaun
Jo Morano wrote:
 Hi!
 
 I have a Number that I need to print out along with other strings. I don't
 get the leading or trailing 0's and that continues to affect the label whose
 text they represent. Is there a C style formatting mechanism which would
 make
 
 string =  + number
 
 give me 12.34 when number is 12.34 and 00.00 for number = 0?
 
 Today I get 12.34 and 0 respectively.
 

There is an sprintf implementation in AlivePDF package org.alivepdf.tools.

/*  sprintf(3) implementation in ActionScript 3.0.
  *
  *  http://www.die.net/doc/linux/man/man3/sprintf.3.html
  *
  *  The following flags are supported: '#', '0', '-', '+'
  *
  *  Field widths are fully supported.  '*' is not supported.
  *
  *  Precision is supported except one difference from the standard: for an
  *  explicit precision of 0 and a result string of 0, the output is 0
  *  instead of an empty string.
  *
  *  Length modifiers are not supported.
  *
  *  The following conversion specifiers are supported: 'd', 'i', 'o', 
'u', 'x',
  *  'X', 'f', 'F', 'c', 's', '%'
  */

cheers,
  - shaun


Re: [flexcoders] Re: Bindable Classes

2008-09-03 Thread shaun
reflexactions wrote:
 But then you have to write all the event creation and dispatch, plus 
 all the getter/setter. 
 
 That might be fair enough if you have a handful of props but if this 
 is a couple of data classes with says 100 props each thats quite a 
 bit of typing when all you want is a couple of props not to fire 
 events when they change... unless there is a tool to generate the 
 code from a list of variables.

There is; it's called Perl. Learn it, live it, love it. :)
Using Perl it's trivial to generate classes from a 'template' file. For 
a little more effort you can generate all the boiler-plate code for 
frameworks such as Cairngorm or Parsley or whatever you use. Java DTO 
classes etc etc.
I do this for every project and it makes changing the Model 
(adding/removing properties) trivial. Its also great for generating test 
data. SQL inserts, xml files etc. etc.
Perl offers a great return for the effort required to learn it. Do 
yourself a favour and give Perl a whirl.

cheers,
  - shaun


Re: [flexcoders] Bi-directional binding

2008-08-18 Thread shaun
Durres76 wrote:
 hi, is this possible. var arr : ArrayCollection;
 
 textfield text='{arr.someProperty}'
 
 I know the textfield text will change everytime the ArrayCollection
 updates, but can the ArrayCollection update when a user types in the
 textfield. essentially binding the array propety to the textfield
 value

You can do something like:
textinput id=ti text={a.b} change=a.b=ti.text /

cheers,
  - shaun


Re: [flexcoders] external css file problem

2008-08-11 Thread shaun
Luke Vanderfluit wrote:
 Hi.
 
 I want to include an external css file in my flex application.
 
 Very simple:
 mx:Script source=assets/wemmStyle.css/
 

mx:Script != mx:Style

cheers,
  - shaun


Re: [flexcoders] How to get selected row in AdvancedDataGrid with Hierarchical Data?

2008-08-09 Thread shaun

Djamshed wrote:
 When you open children in AdvancedDataGrid which uses Hierarchical
 data, rowIndex in selectedCells does not refer to the ADG's
 dataprovider index.
 
 Here is the example: http://djamshed.googlepages.com/grid.html
 Source is here: http://djamshed.googlepages.com/Grid.mxml.html
 
 Open a child node and DOUBLE CLICK on any cell of a child, rowIndex
 seems correct (in terms of reflecting the row number), but this
 rowIndex definitely does NOT REFER to the index in dataprovider. Is
 there any way to get the selected data?
 
 PS: ADG's variable named firstCellSelectionData seems like keeping
 the correct value, but it is private. Looked at the source of ADG, it
 says that everything it keeps is found in selectedCells, so the story
 begins from scratch.
 

There is a lot of good information in the help/API docs section of Flex 
Builder.
If you have a quick glance through the API docs you'll see the following 
two properties, selectedItem and selectedItems which might be 
appropriate for your situation.


--
selectedItemproperty
selectedItem:Object  [read-write]
A reference to the selected item in the data provider.

The default value is null.

This property can be used as the source for data binding.


Implementation
 public function get selectedItem():Object
 public function set selectedItem(value:Object):void

--

selectedItems   property
selectedItems:Array  [read-write]
An Array of references to the selected items in the data provider. The 
items are in the reverse order that the user selected the items.

The default value is [ ].

This property can be used as the source for data binding.


Implementation
 public function get selectedItems():Array
 public function set selectedItems(value:Array):void


--

HTH.
  - shaun


Re: [flexcoders] Re: Figuring out what was clicked in AdvancedDataGrid

2008-07-26 Thread shaun
Use selectedItem.


whatabrain wrote:
 I'm not quite sure I understand. My dataPrivider is an 
 mx:HierarchicalData object, with an ArrayCollection as its source. 
 The ArrayCollection is an array of arrays. Something like this:
 
 [
   {name=group1, children=[
 {name=item1},
 {name=item2}
 ]
   },
   {name=group2, children=[
 {name=item3},
 {name=item4}
 ]
   }
 ]
 
 If I click on item1 in the grid, I get an rowIndex of 1. What I 
 want to find out is that the click refers to item1, and, if possible, 
 that item1 is contained in group1.
 
 
 --- In flexcoders@yahoogroups.com, Carlos Rovira 
 [EMAIL PROTECTED] wrote:
 I use this code with an ArrayCollection dataProvider.
 I'm using multiple cell selection as well, but you can customize as 
 you
 need:

 var ac:ArrayCollection = dataProvider as ArrayCollection;

  for(var i:Number = 0; i  selectedCells.length; i++) {
 var cell:Object = selectedCells[i];
 var data:Object = ac.getItemAt(cell.rowIndex);
 var dataField:String = columns
 [cell.columnIndex].dataField;
 data[dataField] = ;
 ac.itemUpdated(data, dataField);
 }

 aside, selectedIndex and selectedColumnIndex should give you the 
 indices you
 need to retrieve a itemRenderer or a datapovider's object



 2008/7/25 whatabrain [EMAIL PROTECTED]:

   How can you tell which item in the dataProvider was clicked in 
 an
 AdvancedDataGrid, when using HierarchicalData as the dataProvider?

 I tried using the typical DataGrid method, of saving off the item 
 index
 in itemRollOver, and using it to determine the index of the 
 clicked
 item. However, with AdvancedDataGrid, the row index isn't 
 particularly
 relevant. Or is there some way to convert the row index to the 
 actual
 clicked item in the dataProvider?

  

 
 
 



Re: [flexcoders] Screen Refresh function??

2008-07-19 Thread shaun
Hi,

Dan Pride wrote:
 Odd, actually I have to call it in both places in its entirety, then it works 
 fine. If I call the display from the double click, then fill from the 
 complete, it misses the selected.
 
 But if I call it from both it works fine.
 
 So if I do this am I always running it twice or just on the first go round 
 then its Complete ??
 


The creation complete will handle the case of the first time you edit. 
That is, it fixes the original problem.
Creation complete will only run once. I'm guessing the 
applicationScreens component is actually a ViewStack.
If so, this is what i think might be happening:

. The first time you edit your data the edit component has not been 
created yet(it's lazily created by this line: 
applicationScreens.selectedChild = locaScreen), so setting the data 
doesn't work as expected(original problem of first edit not getting 
data) due to the fact that the input fields don't exist yet.

. Then the edit component's creation complete event handler runs and 
sets the data(so editing works the first time now).

. Next time you edit the data the creation complete does not run again 
as the component now exists. So you still need to set the data in the 
function that actually sets up the edit component(your original code).

Now you have the same code in two places; which is not what you want 
obviously.
You should be able to check whats going on by using the debugger; 
setting a breakpoint in the creation complete function and in your
displayLoca function.

There is another solution that might be suitable, but is probably not a 
good idea.  The viewstack has a creationPolicy setting that allows the
viewstack to create all of its children when it's created. Rather than 
using the default lazy creation. This is often /not/ a good idea for 
performance reasons, but it would mean that the original problem would 
not occur and you could remove the code from the creation complete event 
handler and go back to your original code.

So, your left with at least 3 choices:

a) Duplicate code and setting data externally on a component(current 
solution).

b) Modifying the viewstack creation policy to create all children when 
its created(easy but a performance hit).

c) The solution I outlined previously.


 private function displayLoca():void{
 applicationScreens.selectedChild = locaScreen;
 locaScreen.selectedItem = locaGrid.selectedItem;
 }


 And something like the following in your edit
 component:

 private var _selectedItem:Object;

 public function set selectedItem(o:Object):void{
_selectedItem = o;

if (_selectedItem) callLater(updateInputs);
 }

 public function get selectedItem():Object{
   return _selectedItem;
 }

 private function updateInputs():void{
   locaName.text = _selectedItem.NameCol;
   locaField.text = _selectedItem.FieldCol;
   locaSquare.text = _selectedItem.SquareCol;
 }


HTH.
  - shaun



Re: [flexcoders] Set attributes and methods of dynamically added controls

2008-07-19 Thread shaun
daddyo_buckeye wrote:
 I'm trying to add a number of colorpickers and textareas to my app 
 dynamically. Each item needs a separate id, and the colorpickers need 
 to call an open() and change() method and pass the textarea id as a 
 parameter along with the event. 
 
 I'm a little baffled on how to set the methods, but my ids are 
 setting successfully. Here's my code:
 
 public function addPicker():void {
 var i:int; 
   for (i = 0; i  5; i++){
   var ssPicker:ColorPicker = new ColorPicker();
   var ssTextArea:TextArea = new TextArea();
   var ssVBox:VBox = new VBox(); 
   ssPicker.id = cp+i;
   //note: following two lines don't work.
   ssPicker.open = openEvt(event,descriptBox+i);
   ssPicker.change = changeColor(event,descriptBox+i);
   
   ssTextArea.id = descriptBox+i;
   ssTextArea.width = 125;
   ssTextArea.height = 22;
   ssTextArea.text = Select Color;
   myVBox.addChild(ssVBox);   
ssVBox.addChild(ssPicker);
ssVBox.addChild(ssTextArea);
   }
 }
 
 Any thoughts on how I can accomplish this?

As a guess..

ssPicker.open = openEvt;
ssPicker.change = changeColor;

lookup[ssPicker.id] = ssTextArea; //associate picker and text

function openEvt(event:Event){
   var colorPicker:ColorPicker = ColorPicker(event.target);
   var t:TextArea = lookup[colorPicker.id];

   t.text = colorPicker.id;
   ...
}

HTH.
  - shaun



Re: [flexcoders] Set attributes and methods of dynamically added controls

2008-07-19 Thread shaun
shaun wrote:
 daddyo_buckeye wrote:

[snip]

 Any thoughts on how I can accomplish this?
 
 As a guess..
 
 ssPicker.open = openEvt;
 ssPicker.change = changeColor;

Whoops. Scrap that.
As Amy said, it should be using addEventListener..
Getting languages mixed up... :-/

 
 lookup[ssPicker.id] = ssTextArea; //associate picker and text
 
 function openEvt(event:Event){
var colorPicker:ColorPicker = ColorPicker(event.target);

And probably currentTarget rather than target.

- shaun


Re: [flexcoders] Tortoise and Flex 4

2008-07-19 Thread shaun
Sherif Abdou wrote:
 I am using Tortoise to get Flex 4 from the trunk, I was wondering do
 i need to recompile everytime Tortoise does an update and downloads
 new files or update old ones? 

Yes.

Is running ant -q main in cygwin a one
 time thing?

No.

Depending on the files that have changed you might be able to build 
using a different target. eg) ant -q frameworks Which would be quicker.
But for now you might want to rebuild everything just to be sure.

cheers,
  - shaun


Re: [flexcoders] Screen Refresh function??

2008-07-18 Thread shaun
Dan Pride wrote:
 I have a screen with datagrid lists which list the basics.
 Users double click list items to display and enter further data.
 The screen does not display the values on the first change of the selected 
 child canvas. After the first attempt it always does, but the first 
 impression bites. Is there a way to get this to display first and every 
 time???
 
 Basic function I am using on the doubleclick on the datagrid is:
 
 private function displayLoca():void{
   applicationScreens.selectedChild = locaScreen;
   locaName.text = locaGrid.selectedItem.NameCol;
   locaField.text = locaGrid.selectedItem.FieldCol;
   locaSquare.text = locaGrid.selectedItem.SquareCol;
 }
 

Maybe your TextInput objects have not been created at the time your 
setting your data.

Try this instead:

private function displayLoca():void{
applicationScreens.selectedChild = locaScreen;
locaScreen.selectedItem = locaGrid.selectedItem;
}


And something like the following in your edit component:

private var _selectedItem:Object;

public function set selectedItem(o:Object):void{
   _selectedItem = o;

   if (_selectedItem) callLater(updateInputs);
}

public function get selectedItem():Object{
  return _selectedItem;
}

private function updateInputs():void{
  locaName.text = _selectedItem.NameCol;
  locaField.text = _selectedItem.FieldCol;
  locaSquare.text = _selectedItem.SquareCol;
}


HTH.
  - shaun


Re: [flexcoders] Ant tasks and spaces in paths?

2008-07-13 Thread shaun
Josh McDonald wrote:
 Hey guys.
 
 There *must* be something I'm doing wrong here.
 
 In my ant build:
 
 compc output='${bin.dir}/${targetLibrary}'
 source-path path-element=${src.dir}/
 /compc
 
 Now src.dir is:
 
 /Users/josh/Desktop/Work/Builder workspace/PathwaysVersions/src
 
 And I'm getting the following error from Ant:
 
 command line: Error: unknown configuration variable 'compiler.source-path
 /Users/josh/Desktop/Work/Builder,workspace/PathwaysVersions/src'
 
 Which is clearly just blowing the space out into two different instances of
 the sp param. How do I embed quotes or something so this doesn't happen?
 I've tried using ' as well as quot; but with no luck. Any ideas?

Escape the space.

/Users/josh/Desktop/Work/Builder\ workspace/PathwaysVersions/src

If that doesnt work. Create a symlink. :)

cheers,
  shaun


Re: [flexcoders] Cairngorm concepts

2008-07-10 Thread shaun
Douglas Knudsen wrote:
 have a go at this
 http://www.cairngormdocs.org/tools/CairngormDiagramExplorer.swf
 

Very nice indeed.

  - shaun


RE: [flexcoders] Re: Anyone familiar with CF-Flex remoting?

2008-07-06 Thread Shaun Mccran
Hi all,

 

The issue we were having was that passing a flex object to a cfc was fine.

 

Flex:

RO.methodName(Object);

 

CFC:

!--- map each flex object argument as a cfc argument --- 

cfargument name=flexObjectArgument1 type=string required=false

cfargument name=flexObjectArgument2 type=string required=false

..etc

 

(full post here)

http://www.mccran.co.uk/index.cfm/2008/7/1/Flex--Coldfusion-Remoting-passing
-an-Object-usefully

 

So the object is passed into the cfc as a collection of arguments, works a
treat.

 

But it all goes wrong when you try and pass in something, and the object.
IE:

 

Var myName:string = Bob;

RO.methodName(myName ,Object);

 

So in the cfc I'd expect to say:

 

cfargument name=myName type=string required=false

cfargument name=flexObjectArgument1 type=string required=false

cfargument name=flexObjectArgument2 type=string required=false

..etc

 

But this doesn't work!

 

The first arg is present, but the second does not map as it previously did!

 

So:

1.   Pass 1 object, translates as a series of arguments.

2.   Pass 'something', then an object, different behaviour.

 

It seems to me that the behaviour of passing objects is different wether
they are on their own, or passed with other data?

 

Anyone experienced this?

 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nwebb
Sent: 04 July 2008 08:25
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Anyone familiar with CF-Flex remoting?

 

 



Re: [flexcoders] blazeds-turnkey doen't work?

2008-07-04 Thread shaun
markflex2007 wrote:
 Hi,
 
 I have installed blazeds-turnkey and set JAVA_HOME path to D:\Program 
 Files\Java\jdk1.5.0_15\bin. but I can not start tomcat. the error said 
 JDK path error.why.
 
 Please helpme if you know.
 

Possibly because you have a space in the path. ie) Program Files

HTH.

cheers,
  - shaun


Re: [flexcoders] ANYONE? LCDS Bug? Return from overriden ServiceAdapter manage() disregarded

2008-06-23 Thread shaun
Hi,

A pure 100% guess...  Perhaps you need to call super.manage(command).


Steven Toth wrote:
 --- In flexcoders@yahoogroups.com, Steven Toth [EMAIL PROTECTED] wrote:
 
I have a custom adapter I'm using for messaging.  This code works 
 
 in 
 
BlazeDS, but when I try it in LiveCycle DS it does not work. The 
return value (a new AckknowledgeMessage I created) from my 
 
 overriden 
 
manage() method never makes it to the client.  I see the message 
 
 from 
 
the sysout at the end of the method populated correctly, but 
 
 whatever 
 
is happening after this method is called and before the message is 
returned to the client overwrites what I returned.  Any thoughts?

public class MyMessagingAdapter extends ServiceAdapter {
  public boolean handlesSubscriptions() {
  return true;
  }

  public Object manage(CommandMessage command) {
  Object ret = null;
  try {
  if (command.getOperation() == 
CommandMessage.SUBSCRIBE_OPERATION) {
   // Do something custom here... 

  AcknowledgeMessage msg = new 
AcknowledgeMessage();
  ASObject body = (ASObject)msg.getBody
();
  if (body == null) {
  body = new ASObject();
  msg.setBody(body);  
  }
  body.put(someValue,abc);
  body.put(spmeOtherValue, def);
  ret = msg;
  }
  } catch (Throwable t) {
  System.out.println(manage(), exception 
caught:\n + t.getMessage());
  t.printStackTrace();
  }
  System.out.println(manage(), returning msg:\n + 
ret);
  return ret;
  }

 
 
 
 



Re: [flexcoders] Off-topicish - (probably stupid) regex question

2008-06-03 Thread shaun

 Oh yeh, your right..
 
 This should work though i think.
 
 var r:RegExp = new RegExp(text, rexFlags);
 var result:Array;
 result = r.exec(s);
 result[0] = entire line.
 result[1] = first group.



Re: [flexcoders] Off-topicish - (probably stupid) regex question

2008-06-03 Thread shaun
Hi G-funk,

Josh McDonald wrote:
 Sorry for the OT post, just a quick question which must have an answer so
 simple I'm an idiot, but I just can't figure it out. Given an arbitrary
 string, how do I match every character until I reach a specific string?
 
 If I have:
 
 The quick brown fox jumps over the lazy dog
 
 How do I match everything up to say  lazy so that my match is
 
 The quick brown fox jumps over the
 
 I feel like a total idiot for now knowing, and it's driving me crazy.
 
 -J

soemthign like:

^(.*)lazy.*$

ciao,
  - shaun


Re: [flexcoders] Bump: problem with missing dB on Mac for AIR app

2008-05-15 Thread shaun
Andrew Wetmore wrote:
 This is getting urgent. Can anyone point me to where we can start our
 investigations? The installer works fine on Windows, but on Mac it
 looks like the database does not get created. Therefore on Mac the app
 launches, but you can't get past the registration screen.
 
 Help help!
 
 
 a
 
 
 
 --- In flexcoders@yahoogroups.com, Andrew Wetmore [EMAIL PROTECTED] wrote:
 Hi:

 A colleague tried to install the app I am working on on his Mac. App
 installed, but the database is nowhere to be seen. App stalls at the
 first point where it would be expected to call (as opposed to
 initialize) the dB. Where should I start looking to figure out what is
 going on?

 a

What is the path to your db file?
C:\My Documents ain't gunna work..  :)


Re: [flexcoders] Fast updating of image.source

2008-05-05 Thread shaun
Hi Roger,

Roger Howard wrote:
 I've got a sequence of images loaded in Flex - for this example let's 
 say I've populated an array (imageArray) with new Image objects.
 
 I've got an Image control (myImage) whose source is set on 
 applicationComplete.
 
 During the application run, I'd like to be able to set the source of the 
 image control dynamically (in this case, based on mouse position) to the 
 source of one of the objects in the array. For instance:
 
 myImage.source=imageArray[0].source;
 
 The problem is, when I change image source there's a brief flash (no pun 
 intended) when the image control updates - it seems to briefly show the 
 background of the parent control (in this case a canvas with a solid 
 color). This makes for a jarring transition between each image as it's 
 loaded.
 
 I get the same effect even in the simplest of cases - just setting 
 myImage.source explicitly, forgetting about the array.
 
 How can I update the source of an Image control without this strobing 
 effect? Or am I going about it the wrong way?
 
 My Flex experience is limited to a few months of frontend UI development 
 - lots of data binding and layout - and this is a new one on me.
 
 

What about storing an array of Image components in the array rather than 
the urls... put them all on the canvas and the just set visible for the 
one you want to display. I had to do a similar thing once when i wrote a 
flex lake applet.  YMMV.

http://users.on.net/~shaun/FlickrLake/FlickrLake.html
http://users.on.net/~shaun/FlickrLake/FlexLake.as

cheers,


Re: [flexcoders] binding problem

2008-04-30 Thread shaun
Hi Luke,

Luke Vanderfluit wrote:
 Hi.
 
 I have a master detail setup.
 
 When I click the master item and the details are editable in the detail 
 section, 
 I need to bind them (the object's properties) to the relevant textinput 
 fields 
 so that when I save the object, the details I've entered go to the server.
 
 I have a setter that sets the object in the detail when it's selected in the 
 master.
 
 public function set premise(p:Premise):void {
   _premise = p;   
   if (_premise.premiseId != 0) { //not a new premise
   //do stuff
  }
   doBinding();
 }
 
 //bind to text input fields
 
 public function doBinding():void {
   BindingUtils.bindProperty(_premise,name,premiseName,text);
   BindingUtils.bindProperty(_premise,street,premiseStreet,text);
   BindingUtils.bindProperty(_premise,suburb,premiseSuburb,text);
   BindingUtils.bindProperty(_premise,state,premiseState,text);
   BindingUtils.bindProperty(_premise,postcode,premisePostcode,text);
 }
 
 However the binding only works for the first premise, then when I select a 
 premise in the master, this selection and consecutive selections set the 
 premises in the array to all be the same premise.
 
 
 Any suggestions?


I imagine that it's not setting to be all in the array the same premise 
but it still has the old premise object bound to the input field object.

To try and clarify; i think your old premise objects are still bound 
to the input fields, therefore all previously bound premise objects are 
being updated still.

One option might be to use bindSetter instead. I guess the downside is 
you need to write all those accessors.
FWIW I've never used this function so not sure if its right or not. Just 
a guess really.

doBinding(){
   BindingUtils.bindSetter(pName, premiseName, text);
}

//[Bindable]  //?? dunno if need Bindable here or not?
public function get pName():String{
   return _premise.name;
}
public function set pName(s:String):void{
   _premise.name = s;
}

HTH.
cheers,
  - shaun


Re: [flexcoders] number and string validator

2008-04-28 Thread shaun
Hi,

You can also restrict the type of characters entered by the user with 
the restrict property. mx:TextInput restrict=0-9 .../

Luke Vanderfluit wrote:
 Hi Josh.
 
 Josh McDonald wrote:
 
Just use a number validator and check it's  999 and  1?
 
 
 That's great! Thanks.
 minLength=1000 maxLength=

cheers
  - shaun



Re: [flexcoders] Best Practices with Generated Code

2008-04-28 Thread shaun
Nate Pearson wrote:
 I'm using weborb's generated code.  It handles some of my remote
 object calls and puts the info into an array.  I then need to do some
 things to this array when it's done.  I could just add the code inside
 the generated code but it would get wiped out if I ever re-generate it.
 
 What's the best design practice to overcome this issue?

Extend the class.
-
shaun


Re: [flexcoders] change event

2008-04-27 Thread shaun
Hi,

Luke Vanderfluit wrote:
 Hi.
 
 I have a textinput and combobox.
 Both dispatch a change event.
 Is there a way of discerning which type of event so I can take appropriate 
 action based on the type?
 
 TextInput change dispatches flash.events.Event
 ComboBox change dispatches mx.events.ListEvent
 
 Thanks.
 Kr.
 Luke.
 

This should do it..

protected function handle(e:Event) {
   if (e is ListEvent) ...
}

cheers,
  - shaun


Re: [flexcoders] Re: Can't figure out how to parse RSS

2008-04-25 Thread shaun
Hi,

The problem is probably related to the namespaces in the slashdot feed.
There is some information in the blogosphere about using xml with 
namespaces.

cheers,
  - shaun

ben.clinkinbeard wrote:
 http://code.google.com/p/as3syndicationlib/
 
 HTH,
 Ben
 
 
 --- In flexcoders@yahoogroups.com, dfalling [EMAIL PROTECTED] wrote:
 I'm trying  to write a small app that will parse an inputted RSS feed. 
 On some feeds (reddit.com) it works fine, but on others (slashdot.org)
 the xml seems to be cut off...  the description and title for the feed
 are there, but none of the items.  What is causing this?  I've wandered
 tried to adapt code from dozens of different examples and still can't
 understand exactly what I need.  Here's the minimal code that I'm using
 now, without all the hacks and attempts I've tried:


  import mx.collections.XMLListCollection;
  import mx.utils.ArrayUtil;
  import mx.rpc.http.HTTPService;
  import mx.rpc.events.ResultEvent;
  import mx.collections.ArrayCollection;
  import mx.events.FlexEvent;

  [Bindable] private var _dataProvider:XMLListCollection
 = new
 XMLListCollection();
  private var _httpService:HTTPService;

  private function urlSubmitted():void
  {
  var feedUrl:String = urlText.text;
  _httpService = new HTTPService();
  _httpService.url = feedUrl;
  _httpService.resultFormat = e4x;
 

 _httpService.addEventListener(ResultEvent.RESULT,dataReceived,false,0,tr\
 ue);
  _httpService.send();
  }

  private function dataReceived(event:ResultEvent):void
  {
  _dataProvider.source = event.result.channel.item as
 XMLList;
  noDataView.visible = false;
  dataGrid.visible = true;
  }

 
 
 



Re: [flexcoders] MXML, visual/non-visual classes and the id property

2008-04-23 Thread shaun
Hi,

Robin Hilliard wrote:
 Hello all,
 
 Just wondering, does anyone know what magic the MXML compiler uses to 
 decide that visual classes declared in MXML get their id properties 
 recorded in component descriptors and set when instantiated, whilst 
 non-visual classes get an empty string if they have an id property?  I 
 was looking around for some metadata in the core classes that might do 
 the trick with no success.
 

I don't know. However I came across this nice blog post the other day:

http://stopcoding.wordpress.com/2008/04/19/understanding-the-flex-compiler/

Which gives an outlines about the compiler(s). Perhaps the Author can 
help you out.

regards,
  shaun


Re: [flexcoders] Regexp matching string between two nodes

2008-04-23 Thread shaun
Hi Claudia,

Claudia Barnal wrote:
 Hi there,
 
 I have a string that needs to have some portions extracted through
 regexp and add them to an array.
 
 the string is something like this:
 
 fruitsbanana /orange //fruits vehiclessuv /pickup
 /vehicles fruitsapple /banana //fruits
 
 So the regexp should return all that's between all fruits and
 /fruits in this case, it should be something like this:
 banana /orange /apple /banana /
 
 then using
 myArray = myString.split(myRegexp);
 
 I would get an array that looks like this
 [banana /orange /, apple /banana /]
 
 I've tried this regexp: fruits.*?/fruits but it's not really
 working, as it gives me whatever is outside the fruit nodes.
 
 Any pointers?
 

private function init():void{

   var s:String = fruitsbanana /orange //fruits+
 vehiclessuv /pickup/vehicles fruits+
 apple /banana//fruits;

   var r:RegExp = /fruits([\w\s\\\/]*?)\/fruits/gi;   
   var result:Array;

   do { 

 result = r.exec(s);

 if (result!=null)
trace(result[1]);

 }while(result!=null);
  }


HTH.

cheers,
  - shaun



Re: [flexcoders] sending object to component

2008-04-21 Thread shaun
Luke Vanderfluit wrote:
 Hi.
 
 I have a component that displays a form.
 When the form displays I want to display different stuff based on whether a 
 property of an object that I send to the form is null or not.
 
 Im calling the form component from the parent like this:
 OrgForm organisation={organisation}/
 
 Now how do I access the properties of organisation inside the component 
 before 
 it displays?

You could set the visible attribute to false

  OrgForm organisation={organisation} visible=false /

then in your function set it to true once your UI logic has executed.

[Bindable] //getter ommited.
public funciton set organisation(o:Organisation):void{
_organisation = o;

changeForm(); //changes visibility to true.
}

private var saveOrUpdate:String = Update;

private function changeForm():void{
  if (_organisation.organisationId == null) {
saveOrUpdate = Save;
  }

   this.visible = true;
}

cheers,
  - shaun


Re: [flexcoders] Question about Cairngorm / UM extensions

2008-04-21 Thread shaun
Josh McDonald wrote:
 Guys,
 
 I don't actually use Cairngorm yet, but I've been reading a bit about it,
 and listening to the Flex show podcast (which is great btw), and I'm
 wondering how the callbacks work in Cairngorm / UM if your views are simply
 calling this.dispatchEvent() to announce the user's clicked the login
 button or some such, how does the view get the message when the call is
 complete? And if a view has done 3 different things that may fire off
 requests to the server, how does it know which one has completed, when
 dispathEvent returns bool and not any sort of token?
 
 I'm sure this is a stupid question, but it's been on my mind lately and the
 UM docs seem to be even worse than those for Cairngorm :)
 

The model is changed by the result of the event handling and the views 
observe this.

cheers,
  shaun


Re: [flexcoders] Question about Cairngorm / UM extensions

2008-04-21 Thread shaun
Josh McDonald wrote:
 Ah, intriguing. So the Cairngorm events always have a model reference?

No, the commands and delegates are able to access the model though..

 Any recommendation's on the best book I should get in order to get a good
 understanding of modern Cairngorm? Most of the docs I've found online seem
 to be written about a pre-flex2 version, which I assume wouldn't even be
 AS3...

I dont know of any CG books. Maybe the best thing would be to grab the 
framework and have a look around the interweb at examples of how people 
use it and then code something simple, something you have already done 
so you can see how things fit together.

good luck! :)

cheers,
  - shaun


Re: [flexcoders] Question about Cairngorm / UM extensions

2008-04-21 Thread shaun
gabriel montagné wrote:
On Tue, Apr 22, 2008 at 1:17 PM, shaun [EMAIL PROTECTED] wrote:

The model is changed by the result of the event handling and the views
observe this.
 
 
 That is the stock cairngorm way of doing it.  In cairngorm, the
 FrontController is the only listener for all the cairngorm events.  It
 keeps a table of commands to use for each event type.   When the front
 controller listens to an event, it will run that command (which is the
 one that has all the logic packed in it to change the model).   It's
 from the commands that you update the data on the models and all the
 view, which are bound to it, will respond.
 
 The UM Event extension allows you to send an additional callback
 object on that event (a callback being a couple of functions packed in
 an object, one for success, one for faults) so that you can bypass
 keeping data on the model that was going to be used just for letting
 the original view that dispatched the event that whatever process it
 initiated was finished.When the command has finished doing
 whatever it was that it was doing, it will run the callback function
 that will tell the original view I'm done.

I see. So did they use an IResponder for that?

 
 It sounds a bit complicated but actually it isn't.   The classic
 example is a login form.. from the form you pack a UserVO into an
 event and dispatch the event.  Right there, from the view that
 dispatched the event, you disable the login form.  Using stock
 cairngorm you would have to wait for the command to set a flag on the
 model that would let the view know that login process was complete.
 But this would mean that you have to keep that flag there for everyone
 to see when only the original view that dispatched the event needed
 it.

Yes. Not very nice at all.

 Using the UM event, you can send a callback to the command... the
 command does it's thing and when it's done, it runs the success (or
 fault, if it failed) function on the callback, letting the login view
 know that it can re-enable the form or whatever without having to keep
 that data on the model.
 


It sounds like a good improvement. Thanks for the clarification.

cheers,
  - shaun


Re: [flexcoders] Why would this event never fire?

2008-04-20 Thread shaun
dnk wrote:
 Ok, I have a controller class that has an onInit function that is  
 fired form a class constructor. For some reason when I call a function  
 from there, it never fires.
 
 This is a partial code snippet.
   //  THIS NEVER FIRES
   getDirectoryData();
 }

Missing event argument?

   
 public function getDirectoryData(evt:Event):void
 {
   // fire an event(s) to get the initial data
   dispatchEvent (new getDirEvent(getDirEvent.GET_DIRECTORY_EVENT));
 }


cheers,
- shaun


Re: [flexcoders] newbie question

2008-04-16 Thread shaun
Hey Luke,

Luke Vanderfluit wrote:
 
 I have a component that displays a form (currently in 
 selectedIndex 0), from this component I want the click to send me 
 to ViewStack.selectedIndex 1.
 
 Is there something like parent.selectedIndex?
 Access the ViewStack (that contains the component as one of its 
 children) directly from the component doesnt work.
 
 mx:Button label=Button click=myVS.selectedIndex='1';/
 
 How would I do that?

If i understand correctly, off the top of my head you could do something 
like:


//inside parent containing VS.
addEventListener(NextEvent, handleNext);

function handleNext(e:Event):void{
  var c:MyFormComponent = e.currentTarget as MyFormComponent;
  next(c);
}

function next(c:MyFormComponent){
//something.
myVs.selectedIndex  maxIndex ? myVs.selectedIndex++ : null ;
}


//inside child component within vs.
function handleClick(e:Event):void{
   if (e.currentTarget == next)
dispatchEvent(new Event(NextEvent, true));
   else
dispatchEvent(new Event(PreviousEvent, true));

}
mx:Button id=next label=Next click=handleClick(event);/

mx:Button id=back label=Back click=handleClick(event);/


HTH.
cheers,
  - shaun








Re: [flexcoders] General list consensus using 'this' when referencing local vars

2008-04-08 Thread shaun
Mike Anderson wrote:
 Greetings All,
  
 Whenever I study code generated by seasoned programmers (i.e. all the
 Adobe people supporting Flex on this list) as well as countless others
 on this list, I notice that some use this when referencing local
 variables contained within a Class.
  
 The last thing I want to do here, is start a heated discussion regarding
 best practices for programming.  My goal on a daily basis, is to
 better myself as a programmer, and I want to make sure that the code I
 create, conforms to certain standards.
  
 Could some of you please offer your 2 Cents regarding the
 advantages/disadvantages of using this?  Just a quick example:
  
 package
 {
 public class myClass()
 {
 private var testVar:String;
 
 public function myClass( value:String )
 {
 this.testVar = value;
 // versus:
 testVar = value;
 }
 }
 }

Something to consider is the naming of the function parameters used.
eg)
  public class myClass()
  {
  protected var valueOne:String;
  protected var valueTwo:String;

  public function myClass( valueOne:String, valueTwo:String )
  {
  this.valueOne = valueOne; // ok
  valueTwo = valueTwo;  //?? erk
  }
  }
  }

cheers,
  - shaun



Re: [flexcoders] new to flex, tutorial code doesnt work!

2008-03-31 Thread shaun
Hi,

funkbunny08 wrote:
 Hi, I'm brand new to flex using flex builder 3. I'm trying to build
 the simple RIA from the Adobe tutorial and I get a parse error, even
 though the code is identical.
 Here is the code:
 mx:TileList width=100% height=100% /

Change the TileList line above so its not closing the tag.

cheers,
  shaun


Re: [flexcoders] BlazeDS configuration

2008-03-26 Thread shaun
Dominic Pazula wrote:
 I am getting the following error in BlazeDS:
  MessageBrokerServlet failed to initialize due to runtime 
 exception: flex.messaging.license.InvalidLicenseException: Beta expired.
 
 I have a fully licensed profession copy of FB3.  This BlazeDS 
 installation is brand new.  I just downloaded and installed it.
 
 This is really getting old.  How do I make this error go away?  Besides 
 dumping Flex and going to .NET like my colleagues keep telling me I 
 should.
 
 

Perhaps try posting here.
http://opensource.adobe.com/wiki/display/blazeds/Forums

- shaun


Re: [flexcoders] Event fired when Object is created ?

2008-03-26 Thread shaun
Hey,

Vaan S Lanko wrote:
 Does anyone know whether there is an event fired when an object is 
 instantiated ? I have objects that are created from an sqlite SQLEvent 
 result. Presently I'm iterating over the results and calling the 
 populateBar function manually, but it would be nice for the object to 
 detect its been created and dispatch an event automagically.
 
 The Event.ACTIVATE event sorta works but only if u move focus out of the 
 AIR app and then back to it again. This is the code i have been working 
 with sofar
 
 package
 {
 import flash.events.Event;
 import flash.events.EventDispatcher;
 [Bindable]
 public class Foo extends EventDispatcher
 {
 public function Foo()
 {
 super();
 this.addEventListener(Event.ACTIVATE,fooLoadedHandler);
 }
 public function fooLoadedHandler(event:Event):void
 {
 if(this.bar==null) this.populateBar();
 this.removeEventListener(Event.ACTIVATE,fooLoadedHandler);
 }
 public var bar:Bar;
 private function populateBar():void{
//.. this.bar = stuff
 }
 }
 }
 
 any comments would be greatly appreciated, maybe even an alternative 
 strategy..
 

I assume the problem you have is that not all the properties have been 
set on the Object inside the constructor so you can't perform any 
additional related object construction(ie) fetching another related 
object from the DB hence wanting an event (FWIW there is not one).

If that is the case you can prob do somethign like:

private _barForeignKey:Number; //FK to Bar DB object
private var _bar:Bar; //Bar DB Object ref

public function set barForeignKey(id:Number):void{
   if ( _barForeignKey != id) {
 _barForeignKey = id;
 dispatchEvent( new Event(Foo.BarFKSetEvent) );
   }
}


[Bindable event(name=Foo.BarFKSetEvent type=Event)]
public funciton get bar():Bar{
  _bar = fetchBarFromDB(_barForeignKey);
  return _bar;
}

Or you can attach the listener and handler for the event 
Foo.BarFKSetEvent in the constructor like you have in your example.

Perhaps, and this is a total guess, if you had a constructor that 
matched the values for the SQL select it would use that constuctor and 
your properties would be available in the constructor.  However that is 
a wild guess on my part and probably not the case as it would make 
object construction from the SQL event more complex.  Might be worth 
trying though.

I assume it actully just does somethign like:
f = new Foo();
f.setBarForiegnKey(new Number(10)); // or whatever.

HTH.
  shaun


Re: [flexcoders] DataGrid limit on amount of records or data?

2008-02-10 Thread shaun
Hey Luke,

Luke Vanderfluit wrote:
 
 The problem was that the data simply did not render.
 I tested with 2 different datasets, gradually increasing the number of 
 rows in the database table.
 One dataset rendered correctly up to 4128 rows in the database.
 Then increasing the data with one row caused nothing (blank page) to be 
 displayed. This was retried with a server (tomcat) restart and without 
 in both cases the same result. No errors or debug messages.
 The other dataset showed the same behaviour however the cut off point 
 was up around 6030 records.
 After I had reached the upper limit where no data was displayed ( a 
 blank page) I shrunk the data back a few rows in both cases and reloaded 
 the page with data displaying again.


Perhaps your request timed out or something? FWIW I've loaded 50,000+ 
rows(with about 10-15 columns) into a datagrid before(just as an 
experiment) from an xml file, not generated from the DB. I suspect the 
problem is some sort of server side issue given that you received a 
blank page.

HTH.

cheers,
  shaun


Re: [flexcoders] Is it possible to call a command automatically when compiling ends?

2008-02-08 Thread shaun
João wrote:
 Is it possible to configure FB so that after the compiling ends, an
 external command is called? I know that if i use ant tasks this might
 be solved, but I was looking for something simpler. Does this feature
 exists? Is there any simple and straightforward way to achieve this?
 
 Thanks, 
 
 João Saleiro
 
 

You mean to run a shell script or something after a compile? You can do 
that by using the FB external tool builders GUI (or named something 
like that).
There is a GUI setting somewhere in there or you can create a dir called
.externalToolBuilders (if its not there already) and create a launch 
file eg) MyExternalCommand.launch with the follwoing contents:

prawn:~/Documents/myproject flex$ ls -l .externalToolBuilders/
-rw-r--r--1 flex  flex  634 Aug 15 17:40 CopyTo(flex).launch


(note the call to the .sh script in the xml below - change that to your 
script)

prawn:~/Documents/myproject flex$ less 
.externalToolBuilders/CopyTo\(flex\).launch

?xml version=1.0 encoding=UTF-8?
launchConfiguration 
type=org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType
booleanAttribute key=org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND 
value=true/
stringAttribute key=org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS 
value=full,incremental,/

stringAttribute key=org.eclipse.ui.externaltools.ATTR_LOCATION 
value=/Users/flex/bin/copyTo.sh/

booleanAttribute 
key=org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED value=true/
booleanAttribute 
key=org.eclipse.debug.core.appendEnvironmentVariables value=true/
/launchConfiguration


HTH.
shaun


Re: [flexcoders] Application doesn't hear my custom event??

2008-01-31 Thread shaun
Hi,

Its probably a good idea to (re)read the dev guide section about working 
with events as it may help clear this up for you. The general problem is 
that the VO is not part of the parent child hierarchy of the app so it 
cant bubble up the chain.

Your globalVO needs to either (a) dispatch an event on the application 
itself(not a good idea) or (b) your application needs to listen to the 
globalVO. There are other alternatives aswell but these should be a help 
to you right now.

(a) Application.dispatchEvent(globalChange); //or similar (in VO).

(b) globalVO.addEventListener(globalChange, globalVOChangeHandler);

Option (b) will mean your globalVO will need to be an EventDispatcher 
subclass or have an EventDispatcher instance variable and a custom 
method for attaching an event listener to the instance variable event 
dispatcher(know what i mean?).

[snip]

 GlobalVO.as
 package com.test.reports.vo
 {
  import com.test.reports.events.GlobalChangeEvent;
  import flash.events.EventDispatcher;
 
  public class GlobalVO
  {
 private function dispatchChangeEvent():void{
  var eventObj:GlobalChangeEvent = new
 GlobalChangeEvent(this, globalChangeEvent);
  var dispatcher:EventDispatcher = new EventDispatcher();
  dispatcher.dispatchEvent(eventObj);
 }
 
public function set someValue(val:String):void{
  dispatchChangeEvent();
}

FYI. There is a property_change event(or some similar name) that makes 
this pretty easy. eg)

class Foo{

   var x:Number=0;

   funciton Foo(){
 addEventListener(PropertyChangeEvent.propertyChange,
 handlePropertyChange);
   }

   function handlePropertyChange(e:PropertyChangeEvent):void{
 if (e.property == x || e.property == y){
//do something.
 }
   }

}

HTH.
  -- shaun


Re: [flexcoders] Re: Application doesn't hear my custom event??

2008-01-31 Thread shaun
Hi,

This is the approach i was trying to explain in the previous email.
It was just so your VO doest have to extend EventDispatcher.
Not sure why your getting an id error though.. Perhaps stepping through 
the code with the debugger will help.


phipzkillah wrote:
 Ok.
 
 I partly have this working. Is this the right (or a valid) approach?
 

I imagine that will depend on whom you ask?  :)


 Main.mxml
 
 //init
 globalVO.addEventListener(globalChangeEvent,
 globalChangeEventHandler);
 
 private function globalChangeEventHandler(event:GlobalChangeEvent):void{
  Alert.show(I heard a global change :));
 }
 
 GlobalVO.as
 //instance var
 private var _evtDispatcher:EventDispatcher;
 
 //custom add event listener
 public function addEventListener(evt:String, callBack:Function):void{
  this._evtDispatcher.addEventListener(evt, callBack);
 }
 
 //dispatches event
 private function dispatchChangeEvent():void{
  var eventObj:GlobalChangeEvent = new GlobalChangeEvent(this,
 globalChangeEvent);
  this._customEvtDispatcher.dispatchEvent(eventObj);
 }


I notice that one is called _evtDispatcher and the other 
_customEvtDispatcher, not sure if thats the real code or not though or 
just example code.

 
 
 This will give me the following error BUT the event is dispatched and my
 main.mxml hears it.
 
 ReferenceError: Error #1069: Property id not found on
 flash.events.EventDispatcher and there is no default value.
  at main/::globalChangeEventHandler()
  at
 flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven\
 tFunction()
  at flash.events::EventDispatcher/dispatchEvent()
  at com.minowireless.reports.vo::GlobalVO/::dispatchChangeEvent()
  at com.minowireless.reports.vo::GlobalVO/set startDate()
  at main/::dispatchDate()
  at main/__startDate1_change()
  at
 flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven\
 tFunction()
  at flash.events::EventDispatcher/dispatchEvent()
  at mx.core::UIComponent/dispatchEvent()
  at mx.controls::DateField/::dropdown_changeHandler()
  at
 flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven\
 tFunction()
  at flash.events::EventDispatcher/dispatchEvent()
  at mx.core::UIComponent/dispatchEvent()
  at mx.controls::DateChooser/::dateGrid_changeHandler()
  at
 flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven\
 tFunction()
  at flash.events::EventDispatcher/dispatchEvent()
  at mx.core::UIComponent/dispatchEvent()
  at mx.controls::CalendarLayout/::dispatchChangeEvent()
  at mx.controls::CalendarLayout/::mouseUpHandler()
 
 
 

regards,
  -- shaun


Re: [flexcoders] Gauge, Dial, or Speedometer component

2008-01-29 Thread shaun
Cailie Crane wrote:
 Hello all,
 
 Trying to find a visual component that looks like a gauge, dial, or
 speedometer. Can anyone point me towards such a component (commercial
 or non-commercial) that can be used in a commercial web application?
 
 I did find a (Flex 1.5) gauge component from Peter Ent, at
 http://weblogs.macromedia.com/pent/. I just want to see what other
 choices exist.
 
 Thank you!
 -C
 

http://www.betterthanflex.com/?p=4


Re: [flexcoders] Re: May I click a button to ScrollDown in TileList

2008-01-20 Thread shaun
Hi,

Change the x value for the canvas or whatever component your tile list 
is added to.

flexawesome wrote:
 Any suggestions?
 
 Cheers
 
 --- In flexcoders@yahoogroups.com, flexawesome [EMAIL PROTECTED] 
 wrote:
 
Hi there,

I am using TileList to build my simple application, is there a way to 
click a button to scroll down in TileList component?

I would like to set vercitalScrollPolicy=off and then add a new 
button on the stage, user can click the button to scroll down in 
TileList.

Thanks

 
 
 
 


Re: [flexcoders] Access TWAIN scanners from Air

2008-01-20 Thread shaun
Javier de la Torre wrote:
 Hi all,
 
 I would like to access the TWAIN API from an AIR application. I have
 been looking around and the only way I have found it is by using
 Artemis. Although accessing from Java would be great, there are great
 APIs out there, the Artemis connection looks very preliminar and with
 a deploying process that can be too hard.
 
 I have understood also that there is no way to run command line
 processes from AIR in thi version.
 
 Another idea I have heard is to create an external program that will
 provide me access to TWAIN through sockets connections. But then I
 would have to distribute the two things together, set up services in
 windows, uff... it sounds is gonna be complicate to distribute such a
 software.
 
 Any other idea?
 

Don't use air. Its pretty much useless for this type of app as far as i 
can tell. It's a bit of a bad joke really. Pity.

cheers,
- shaun



Re: [flexcoders] Access TWAIN scanners from Air

2008-01-20 Thread shaun
Jeff Tapper wrote:
 a colleague of mine has written an app to do this with AIR and Artemis 
 and a handful of java classes.  its pretty sweet.
 

Good for them.

 If used properly, AIR is anything but a joke.

Properly being the import part of that statement.
What you describe above is a hack to workaround AIR limitations.

Clearly AIR is not suited to the type of app that needs to access the OS 
runtime or execute programs locally otherwise it would have an api to do 
so. That is what i was referring to as a bad joke. AIR is fine for what 
it _can_ do without resorting to things like Artemis.

I think the artemis(http://artemis.effectiveui.com/) project was dropped 
development wise, at least i think thats what i read when i was 
subscribed to the project.

Yes people can and will workaround AIRs limitations.. People also write 
system shells in PHP, that doesnt mean its a good idea.


 At 08:43 PM 1/20/2008, you wrote:
 
 Javier de la Torre wrote:
  Hi all,
 
  I would like to access the TWAIN API from an AIR application. I have
  been looking around and the only way I have found it is by using
  Artemis. Although accessing from Java would be great, there are great
  APIs out there, the Artemis connection looks very preliminar and with
  a deploying process that can be too hard.
 
  I have understood also that there is no way to run command line
  processes from AIR in thi version.
 
  Another idea I have heard is to create an external program that will
  provide me access to TWAIN through sockets connections. But then I
  would have to distribute the two things together, set up services in
  windows, uff... it sounds is gonna be complicate to distribute such a
  software.
 
  Any other idea?
 

 Don't use air. Its pretty much useless for this type of app as far as i
 can tell. It's a bit of a bad joke really. Pity.

 cheers,
 - shaun


 
 Jeff Tapper
 Senior Technologist
 Digital Primates IT Consulting Group
 [EMAIL PROTECTED]
 http://www.digitalprimates.net
 


Re: [flexcoders] Problem with Keyboard events in Firefox (OSX)

2007-12-13 Thread shaun
Hi,

I think you need to attach the listeners to the stage.

HTH

aconfrey wrote:
 I'm going crazy with a bug/feature trying to receive keyboard events.
 I've created a very basic app to demonstrate. I have a VBox with a
 Canvas containing a TextArea. I want the TextArea to be invisible
 unless a certain key is pressed. With the code as listed below on
 Firefox I only receive KEY_DOWN events for the 'apple' key and the
 shift key! If I click in the application area then everything works
 fine and all events are received, but I don't want my user to have to
 click. On Safari and the standalone Flex player all keyboard events
 are received without clicking.
 
 I've played around with all combinations of which container to
 register for key press events on and which container to set focus to.
 Apart from making the behavior even more bizarre nothing seems to work. 
 
 What am I missing?
 
 Thanks
 
 Tony
 --
 KeyPressTest.mxml
 --
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute width=100% height=100%
   mx:Script![CDATA[  
   public var theClass:Typer;
 public function startUp(c:Canvas, txt:TextArea):void {
   theClass = new Typer(c, txt); 
 }
 ]]/mx:Script 
   mx:VBox horizontalCenter=14 verticalCenter=18 height=100%
 width=100% horizontalAlign=center verticalAlign=middle
   mx:Canvas id=cnvs height=100% width=100% borderStyle=solid
 creationComplete=startUp(this.cnvs, this.txt) 
   mx:TextArea width=100% height=100 
 verticalScrollPolicy=auto
 id=txt visible=false text=Can you see Me?/
   /mx:Canvas
   /mx:VBox
 /mx:Application
 
 Typer.as
 
 package
 {
   import mx.containers.*;
   import mx.controls.*;
   import flash.events.KeyboardEvent;
   
   public class Typer
   {
   private var ta:TextArea;
   private var cv:Canvas;
   public function Typer(c:Canvas, txtArea:TextArea) {
   ta=txtArea;
   cv=c;
   cv.addEventListener(KeyboardEvent.KEY_DOWN,typing);
   cv.setFocus();
   }
   
   public function typing(e:KeyboardEvent):void{
   trace(now we're typing - keydown, e);
   ta.visible=!ta.visible;
   cv.setFocus();
   }
   }
 }
 
 


Re: [flexcoders] ValueObject Factories?

2007-12-06 Thread shaun
Hi Christophe,

Christophe Herreman wrote:
 Hi all,
 
 I was wondering how you guys deal with model objects and their corresponding
 value objects. We have a pretty big domain model with complex nested classes
 and we need to create value objects from them before sending them to the
 server. Right now we create a factory for each model, that can create a vo
 from a model and a model from a vo. This works, but it is obviously a lot of
 work and error prone, so it requires more work to write testcases for them.
 
 Does anyone have this problem too? Are you only sending VO's to the server
 or do you only do that for complex types and otherwise send the object
 itself?
 
 Input, comments and ideas are welcome.

FWIW, this is how i've been doing it:

http://tinyurl.com/3absje

cheers,
  - shaun














Re: [flexcoders] Can't debug FB 3 pieces

2007-11-27 Thread shaun
Howdy,

Amy wrote:
 When I try to debug my Flex Builder 3 pieces, I get a message that it 
 can't find the debug player.  I have been all over the adobe site 
 looking for the current debug player, and everything I find tells me it 
 is not the most recent version of the player and sends me to the most 
 recent _regular_ player.  I.e. I can't even get the debug player 
 installers to even _run_, not even the one that is in my FB 3 beta 
 folder.  Where can I get a debug player installer that will run?

Dunno if this will help you or not..
If your using OS X, install the player that comes with FB2 as an admin 
user. Not sure about FB3 but probably worth a try.

cheers,
  shaun


Re: [flexcoders] Cannot change button style

2007-11-27 Thread shaun
Amy wrote:
 I have a TileList that has XML as its dataProvider and is using my 
 custom itemrenderer to display the data.  The itemrenderer has 5 
 buttons, labeled A, B, C, D, and E.  These buttons are intended to 
 look like the old ScanTron sheets, or like an SAT or ACT answer sheet.
 
 So I need to be able to change one of the buttons at runtime to 
 appear black if the student has selected the answer before, or set it 
 black when the student clicks it.  I have a style set up, 
 selectedBtn, which simply sets fillColors to #00, #00.  If I 
 set the styleName in a button's XML tag to selectedBtn, the button 
 will appear dark (though not black--that is a problem for another 
 day).
 
 However, if I use a.stylename = selectedBtn, I get
 
 TypeError: Error #1009: Cannot access a property or method of a null 
 object reference.
   at 
 Does anyone have any idea what I could be doing wrong?
 

'A' is not the same as 'a'. Maybe thats the problem.
It might be better to give your components more meaningfull ids aswell.
answerButtonA for example.
As far as the color goes you might need to set the backgroundAlpha of 
the button or something like that, to make it a solid color.

HTH,

cheers,
  shaun


Re: [flexcoders] Re: Cannot change button style

2007-11-27 Thread shaun
Amy wrote:
 A is the label, whereas a is the ID.  The code hinting works, so I 
 have no reason to suspect I've gotten that bit wrong.

Ahh.. sorry my mistake. :)

Well, from the original error message you provided it looked like your 
button was null.. I imagine the easiest way would be to use the debugger 
to inspect whats going on.

cheers,
  shaun


RE: [flexcoders] Scrollbar weirdness

2007-11-18 Thread Shaun Mccran
Its just the slider, your right in that if i’ve got a very long column the
scrollbar shrinks right down as thats the only one you can see. Was
wondering if there is a setheight property or something?

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: 16 November 2007 19:26
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Scrollbar weirdness

 

Don’ t have time to set this up right now.  Is the scrollbar changing height
or just the thumb?  The thumb should change height since it represents the
percentage of total rows that you can see.

 

   _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Shaun Mccran
Sent: Friday, November 16, 2007 10:15 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Scrollbar weirdness

 

No thoughts on this?

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of smccran
Sent: 15 November 2007 15:10
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Scrollbar weirdness

 

Hi all,
I have a datagrid that has longer data in some rows than others. The 
problem is that my scrollbar is changing size! Does anyone know how 
to stop the scrollbar changing height?

A sample code is below.

Thanks
Shaun

Code:

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

mx:XMLList id=employees
employee
nameChristina Coenraets/name
phone555-219-2270/phone
emailHYPERLINK
mailto:ccoenraets%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameJoanne Wall/name
phone555-219-2012/phone
emailHYPERLINK mailto:jwall%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMaurice Smith/name
phone555-219-2012/phone
emailHYPERLINK
mailto:maurice%40fictitious.com[EMAIL PROTECTED]/email
activefalse/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHeadmaster of Hogwarts School of Witchcraft and 
Wizardry 

Order of Merlin and other honors. 

Chocolate Frog card: Considered by many the greatest wizard of 
modern times. Dumbledore is particularly famous for his defeat of the 
dark wizard Grindelwald in 1945, for the discovery of the twelve uses 
of dragon's blood, and his work on alchemy with his partner, Nicolas 
Flamel. Prof. Dumbledore enjoys chamber music and tenpin 
bowling. 

Nitwit! Blubber! Oddment! Tweak! 

Shining silver hair. 

Men have wasted away before [the Mirror of Erised], entranced by 
what they have seen, or been driven mad, not knowing if what it shows 
is real or even possible. 

Rigged mirror to help those who wanted to find the stone but not.

Nitwit! Blubber! Oddment! Tweak! 

Shining silver hair. 

Men have wasted away

RE: [flexcoders] Scrollbar weirdness

2007-11-16 Thread Shaun Mccran
No thoughts on this?

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of smccran
Sent: 15 November 2007 15:10
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Scrollbar weirdness

 

Hi all,
I have a datagrid that has longer data in some rows than others. The 
problem is that my scrollbar is changing size! Does anyone know how 
to stop the scrollbar changing height?

A sample code is below.

Thanks
Shaun

Code:

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

mx:XMLList id=employees
employee
nameChristina Coenraets/name
phone555-219-2270/phone
emailHYPERLINK
mailto:ccoenraets%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameJoanne Wall/name
phone555-219-2012/phone
emailHYPERLINK mailto:jwall%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMaurice Smith/name
phone555-219-2012/phone
emailHYPERLINK
mailto:maurice%40fictitious.com[EMAIL PROTECTED]/email
activefalse/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHeadmaster of Hogwarts School of Witchcraft and 
Wizardry 

Order of Merlin and other honors. 

Chocolate Frog card: Considered by many the greatest wizard of 
modern times. Dumbledore is particularly famous for his defeat of the 
dark wizard Grindelwald in 1945, for the discovery of the twelve uses 
of dragon's blood, and his work on alchemy with his partner, Nicolas 
Flamel. Prof. Dumbledore enjoys chamber music and tenpin 
bowling. 

Nitwit! Blubber! Oddment! Tweak! 

Shining silver hair. 

Men have wasted away before [the Mirror of Erised], entranced by 
what they have seen, or been driven mad, not knowing if what it shows 
is real or even possible. 

Rigged mirror to help those who wanted to find the stone but not.

Nitwit! Blubber! Oddment! Tweak! 

Shining silver hair. 

Men have wasted away before [the Mirror of Erised], entranced by 
what they have seen, or been driven mad, not knowing if what it shows 
is real or even possible. 

Rigged mirror to help those who wanted to find the stone but not use 
it. 

Spiral escalator to office; large and beautiful circular room. 

Auburn hair 50 years ago. 

Suspended as headmaster. 
/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active
/employee
employee
nameMary Jones/name
phone555-219-2000/phone
emailHYPERLINK
mailto:mjones%40fictitious.com[EMAIL PROTECTED]/email
activetrue/active

[flexcoders] Unicode/Foreign Character Entry

2007-11-12 Thread Shaun

Here is a control for allowing users to easily select special characters
for entry in Flex text controls.

Demo with Code http://www.capitalhcoder.com/

The basic idea is that by adding this control to your app and
associating it with a text control, you can then use it to select
unicode/foreign characters and add them to the text of the control.

I asked about this here on flexcoders a while back and didn't get much
response and I couldn't find much at all on the web, so I'm posting it
in the hopes that someone might get a jump start from it in the future.

Shaun



Re: [flexcoders] Re: Deep binding with Cairngorm question

2007-10-31 Thread shaun
Hi,

This is not really directly related to Cairngorm, its about design.

Disclaimer: The following is just an opinion. I'm not claiming to be a
design expert.

dbronk wrote:
 The problem with this solution is that it is assuming that the same
 class that is setting the prodList is also listening to it.  Or at
 least it knows all of the places that it is listening to it.  I may
 have several different classes listening to this list and each binding
 to a different function.  How am object setting the prodList suppose
 to know how many / which classes / which methods are listening to this
 collection so it can remove all the listeners and then re-establish
 them all?

Good point. I think its is a design floor to listen to an array that is 
a property of another object. Rather the owning object should be 
broadcasting events when one of its properties changes.
Thinking of the arraycollection as an entity in its own right(a domain 
object) is probably not such a good idea IMO. Really, its just a 
datastructure that forms part of an entity.

As you pointed out; the arraycollection can be reset and the other 
objects listening have no way of knowing that the arraycollection has 
been reinitialised (meaning the event handlers are no longer registered 
to the correct object). Therefore the bottom line is you can't reliably 
add a listener to that object without resorting to workarounds/hacks.

Perhaps a better way to implement this is to have the the containing 
object expose add/remove/filter methods that manage its internal array 
collection. The containing object would dispatch corresponding events. 
Your listeners would be added to the containing object rather than the 
collection.

If your owner object API contract was such that only a _copy_  or 
non-mutable version of the arraycollection is returned it means that 
adding/removing objects or listening to events directly on the 
collection becomes meaningless.

A subclass of arraycollection that is non-mutable and throws and error 
when an event handler is registered may be helpfull to prevent 
mistakenly attaching handlers or adding to the collection.

cheers,
   - shaun


Re: [flexcoders] Re: Deep binding with Cairngorm question

2007-10-30 Thread shaun
Hi,

dbronk wrote:
Probably the easiest thing to do would be to make the listener
 
 reference 
 
weak. Or, create an accessor function for the arraycollection and
 
 remove 
 
the listener from the old arraycollection and add a listener to the new 
arraycollection if they are not the same object.
 
 
 Will you expand on this please?  I did the following code hoping to
 solve the issue, but I'm very worried this goes much deeper than just
 ArrayCollections and goes to every object that has an event listener
 on it.  If that is the case I can't see how leaks can be stopped.

Use weak references, anywhere that you don't use weak references make 
sure you remove the event listeners when your objects are discarded so 
they can be GC. See the API for EventDispatcher.

I think you could have left your code as it was but used a weak 
reference when adding the event listener. This should allow the 
arraycollection object to be GC.

Basically I was suggesting to prevent a leak you could do somethign 
along the lines of one of the following(untested code).

A)

  public function set prodList(list:ArrayCollection) : void {

_prodList = list;
var isWeak:Boolean = true;

if ( _prodList != null){
  _prodList.addEventListener(change, myfunc, false, 0, isWeak);
}

  }//end


B)

  public function set prodList(list:ArrayCollection) : void {

if (list == null){
   if ( _prodList != null ) {
 _prodList.removeEventListener(change, myfunc);
   }
   _prodList = list;
   return;
}

if (_prodList != null){
  _prodList.removeEventListener(change, myfunc);
}

_prodList = list;

_prodList.addEventListener(change, myfunc);

  }//end


HTH,
  - shaun


Re: [flexcoders] Re: Croping area

2007-10-27 Thread shaun
Hi Jon,

Jon Bradley wrote:

 You draw multiple closed shapes on one target (sprite, movieclip,  
 whatever) BEFORE you end the fill. It's a single graphics drawing  
 session on a single object. The direction that you draw the points  will 
 determine whether or not they subtract or combine. You don't  create 
 multiple 'sprites' or objects.

Ahh.. the same operation, thats the key point, now it makes more sense 
to me.  The actual lineTo code was pretty much what I had expected based 
on your original post regarding using reverse order. But the explanation 
above helps a lot to clarify it for me.

Thanks very much.

cheers,
  - shaun


Re: [flexcoders] Re: Deep binding with Cairngorm question

2007-10-27 Thread shaun
Hi,

ben.clinkinbeard wrote:
 Glad you got it working. Yea, its unfortunate (but unavoidable) that
 reinitializing a var kills the listeners. (Actually, I think
 reassigning like that could cause a memory leak, can someone confirm?)
 If its feasible you may want to replace those lines with
 prodList.removeAll() and then you should be able to get rid of Binding.
 
 Ben

 dbronk dbronk@ wrote:
Second, swapping my mx:Binding with adding a listener on
CollectionEvent.COLLECTION_CHANGE definitely did the trick, but with
one bad consequence.  If somewhere along the way code was written
prodList = new ArrayCollection, it broke.  My solution to that was to
add back the mx:Binding, but when that fires, it simply runs a
function that reestablishes the event listener on
CollectionEvent.COLLECTION_CHANGE.  Now it seems to work no matter how
I set the list.

I would have thought the old array collection would have been garbage 
collected because the arraycollection itself would no longer have any 
references to it. It would reference the handler function and the 
handler fucntion would reference the object it was declared in, but
the array collection itself would be unreachable AFAIK.

However, reading the docs for EventDispatcher it seems as though 
creating a new ArrayCollection could result in a memory leak.

---
/langref/flash/events/EventDispatcher.html#addEventListener()

If you no longer need an event listener, remove it by calling 
removeEventListener(), or memory problems could result. Objects with 
registered event listeners are not automatically removed from memory 
because the garbage collector does not remove objects that still have 
references.
---

Probably the easiest thing to do would be to make the listener reference 
weak. Or, create an accessor function for the arraycollection and remove 
the listener from the old arraycollection and add a listener to the new 
arraycollection if they are not the same object.

cheers,
   - shaun




[flexcoders] Foreign Language Characters

2007-10-26 Thread Shaun
I'm still trying to find the best way to allow my users to enter
foreign language characters - like á, ñ, etc. - into my flex text
controls.

Has anyone had experience with this, or found a solution that makes it
somewhat easy on the end user?  I've noticed that holding alt and
typing the codes for the keys does not work, which makes me think I'm
going to run into problems.

Thoughts?

Shaun



[flexcoders] Foreign Language Characters

2007-10-25 Thread Shaun
I am looking for recommendations on how to most easily enable my users
to enter foreign language characters into my Flex TextInput, TextArea,
and and RichText controls. (easiest on the users that is)

Many Thanks,
Shaun



Re: [flexcoders] Re: Croping area

2007-10-24 Thread shaun
Hi,

Ian Thomas wrote:
 You're quite right, Jon - I'd completely forgotten that reverse order could
 cut out from a shape.

Could you explain this idea of reverse order a bit more or provide a 
url with some information about how to do this. I dont think I really 
understand how to implement it.

 
 Ian
 
 On 10/24/07, Jon Bradley [EMAIL PROTECTED] wrote:
 
  Creating multiple versions of an image is a bit much on the overhead.
Plus, you don't have the capability of doing a white wash, or dark wash, or
custom color overlay for the crop.

In my applications I've written a an 'overlay' class. It's is a filled
rectangle drawn in clockwise fashion, with an inner rectangle drawn in
reverse order (matching the crop box transformation).

This is pretty easy to do.  Just write a new function that will draw a
rectangle in reverse order (counter-clockwise) and do something like the
following:

overlay.beginFill()
overlay.drawRect( image rectangle, false); // where false means draw
normal, or clockwise
overlay.drawRect( crop rectangle, true) // draw it reverse making a hole
overlay.endFill()

So, in short, don't use another image because you'll overcomplicate
things, imho.

Use reverse fills as holes since it's faster and gives you more
flexibility on the look.

Anz --- any possibility we can take a look at your version of the
picnic-style crop tool?

 

cheers,
  - shaun


Re: [flexcoders] Cairngorm vs PureMVC

2007-10-23 Thread shaun
Tom Chiverton wrote:
 On Tuesday 23 Oct 2007, [EMAIL PROTECTED] wrote:
 
I'll quote the Java BluePrints:
 
 
 Why ?

As referece to the description of the domain model and its part in MVC.
And because i was playing on Bjorn's quoting of Jesse. No biggy. :)

 So it's not hard-n-fast MVC. 
 Their called 'patterns' for a reason - we can break them if we want.
 

Sure. They are called Patterns because thats what they are. Patterns.
http://dictionary.reference.com/search?q=Pattern   ;)

I wasnt suggesting we couldn't break them, in fact if you read the other 
emails you will see that I also break the rules when I use CG.


cheers,
  - shaun



--
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

* 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:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

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


Re: [flexcoders] Cairngorm vs PureMVC

2007-10-22 Thread shaun
Hey Bjorn,

Bjorn Schultheiss wrote:
 Hey All,
 
 I don't know if there has been a previous thread on this. I'm  
 assuming there is but i thought i'd start one again in light of some  
 recent blog posts about a Silvafug meeting by the assertTrue guys on  
 frameworks.
 
 http://www.asserttrue.com/articles/2007/10/17/silvafug-application- 
 frameworks-presentation
 http://probertson.com/articles/2007/10/18/flex-application-frameworks- 
 presentations/
 http://www.sephiroth.it/weblog/archives/2007/10/flex_frameworks.php
 
 I haven't used PureMVC yet but I have used Cairngorm for a while  
 (since the flash 7 days).
 
 I will say I've got a few beefs with Cairngorm and from just looking  
 at the PureMVC diagram i already see a few solutions.
 
 I guess my main beefs with cairngorm has been the use of commands.
 Specifically in creating Re-usable commands.
 the 1 to 1 event-command-delegate methodology has never sat well with  
 me.
 
 Dumb Models (vo collections) is another.

I am wondering what makes you think that the CG models need to be dumb?

Why can't your CG model be a domain model? Then a ModelLocator simply 
holds a reference to an object which forms part of a complex object 
graph. The Objects are not just simple VOs(DTOs) but have state, 
behaviour, event listeners and handlers.

cheers,
  - shaun


Re: [flexcoders] Cairngorm vs PureMVC

2007-10-22 Thread shaun
Hey Bjorn,

Bjorn Schultheiss wrote:

 It took me a while to grapple with but thats how it's been explained  to 
 me.
 
 VO's. Thats it.
 All logic is in the commands.
 
 Now excuse me if I'm wrong and I'll be happy to be proven so.

Interesting, but that doesnt really meet the definition of MVC does it.

I'll quote the Java BluePrints:
http://java.sun.com/blueprints/patterns/MVC-detailed.html

. Model - The model represents enterprise data and the business rules 
that govern access to and updates of this data. Often the model serves 
as a software approximation to a real-world process, so simple 
real-world modeling techniques apply when defining the model.

As you can see that is quite different from the DTO/VO pattern(which 
should be used for coarse grained data transfer).

I'll quote the Java BluePrints again:
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html

. Clients usually require more than one value from an enterprise bean. 
To reduce the number of remote calls and to avoid the associated 
overhead, it is best to use Transfer Objects to transport the data from 
the enterprise bean to its client.


 In terms of event handling well, if a VO is Bindable is that the same?
 Do you mean listening to the view or commands?
 

I do make by domain objects Bindable and non Dynamic.  But I'll try and 
give a simple example of what I meant.

My Model classes handle the propertyChange event so when a proprerty of 
the object changes I can set a dirty flag to indicate that the object 
has been changed and is unsaved.

I also use event listeners on a collection object within a model object.

Object A has many B objects(stored in an arraycollection in object A). 
When a B object is added to the collection, A should be flagged as unsaved.

The A object needs to know when a B object has been added or removed so 
it can set its own dirty flag.

Object A adds a  changeevent listener to its arraycollection of B 
objects, A handles the collection change events dispatched by the 
collection of B objects by setting its own dirty flag.

Right or wrong, this is an approach I have used in the past.


 I'll quote Jesse again.
 
 http://jessewarden.com/2007/08/10-tips-for-working-with-cairngorm.html
 3. Only Commands set data on the Model; you can break this, just  don’t 
 if you can help it.
 In Model View Controller, only the Controller sets data on the Model.  
 In this case, the Commands are the Controller (usually), and as such,  
 setting ModelLocator data is their job, and their job alone. If data  is 
 getting f’d up, you immediately know it’s in the Command. You  never 
 have to question “who’s setting my data, where, and when?”.

I think this type of rule might be more beneficial if you have a VO 
only model, as it makes sure your logic is in one spot, the command 
class rather than the view.
So it seems like all the Event/Command classes have to be created to 
make up for the deficit of logic in the actual Model - where it should 
be IMO.
It seems like the Command, which is meant to be a Controller? according 
to the quote above (although we have a Front Controller aswell! Whats up 
with that picture?) is playing the role that the model should be.

Seems bogus to me.. :)

cheers,
  - shaun






--
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

* 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:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

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


Re: [flexcoders] Cairngorm vs PureMVC

2007-10-22 Thread shaun
Bjorn Schultheiss wrote:
 Hey Shaun,
 
 
 I'm not trying to play the Cairngorm Don here, but thats how i  
 understood it.

No, I didn't think that. I'm not either. I was just trying to get the 
converstion going, as I have had doubts about some of the things I have 
done with it todate. I'm not sure there is any real right or wrong 
though. I find it interesting the different ways people use it and the 
various benefits and drawbacks of each approach.

Perhaps CG was designed to used the way you describe. I dont know.

I guess the important thing is we are not sticking bussiness logic and 
RPC calls in subclasses of Canvas! :)

 I agree with placing logic around the model, especially for work with  
 Data-Services.
 
 As i understand 'currently' the only logic in the Model is getters  
 and initialization of the defined structure via the Singleton.
 

cheers,
  - shaun


--
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

* 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:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

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


[flexcoders] Flex3 Beta 1 vs Beta 2 SWF file sizes - Debug code not removed?

2007-10-13 Thread Shaun

I've been doing some experimentation with RSLs for reducing file sizes
and I ran into something interesting.

When I build my code with FB3 Beta 1, Hotfix 2.0.1, my output file size
is 897kb.  When I build the EXACT same code with FB3 Beta 2, Hotfix
2.0.2, my output file size is 1319kb.

This happens to be the same size as the -debug.swf I get from Beta 1,
which makes me think that FB3 Beta 2 does not remove the debug code
from the swf it exports.

Has anyone else seen this issue?  Is there some new setting I need to
be using?  A workaround?

Thanks,
Shaun

_
capitalHcoder http://www.capitalhcoder.com/




RE: [flexcoders] Referencing elements in a component

2007-10-05 Thread Shaun McCran
Any thoughts on this?



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of smccran
Sent: 05 October 2007 08:25
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Referencing elements in a component



Hi,

I have TileList (Shopping basket), with a component in it. 

The tilelist has a numeric stepper displayed in the component. There 
is a change event on the stepper, that calls a function that 
increases or decreases the number of that item in the basket. 

I have two problems, the first is that there is also a button 
to 'remove item from basket' in the function for this I cannot get it 
to reference the numeric stepper (ns.value = ns.value -1) how do you 
reference items inside a component from external (component to 
external is 'outerDocument'). I've seen the 'target.xxx', is that 
anything to do with it.

The second is that I have many items in the TileList, sometimes if I 
active the second numeric stepper it affects the first item. How do 
you reference a specific index, or row of the tilelist?

Thanks
Shaun



 


The contents and any attachments of this electronic mail message are 
confidential and intended only for the named addressee. It may contain 
information covered by legal, professional or other privilege.  You are 
notified that any disclosure, copying and distribution is prohibited.  If you 
received this email in error, please accept our apologies, and we would 
appreciate that you return it to us. Europa Group Limited is authorised and 
regulated by the Financial Services Authority.Registered Office: 29 High 
Street, Thornbury, BS35 2FD. Registered in Wales Reg No 3279177



Re: [flexcoders] Re: Very strange runtime behavior - if logic doesn't work?????

2007-09-28 Thread shaun
Paul deCoursey wrote:
 You don't have another class or var with the name includeBase that might 
 be conflicting?  That's the kind of thing that has tripped me up in the 
 past.  In the debugger can you verify the value of includeBase?
 
 Paul
 

Good point. Or perhaps that var name is used in a flex superclass?

cheers,
  - shaun


Re: [flexcoders] e4x question

2007-09-26 Thread shaun
Hi Peter,

Peter Hall wrote:
 You don't need to give the namespace variable the same as the prefix that
 ActionScript gives it when you toString() it. Internally, it doesn't use a
 name and just generates one when you convert the XML to a string.
 
 You can give it something more descriptive like:
 
 namespace w3xml = http://www.w3.org/XML/1998/namespace;;
 trace(+xml.status.presence.(@w3xml::lang=='en')); // Away
 

Thanks for the information. That makes sense and was what I had 
originally thought would work.
I originally tried calling the namespace variable xml to match the 
prefix in the XML document, however I received an error. If I had read 
the stacktrace message more carefully I'd have seen it was caused by me 
calling the namespace variable xml AND the XML variable xml. Whoops! :)

cheers,
  - shaun


Re: [flexcoders] Re: Very strange runtime behavior - if logic doesn't work?????

2007-09-26 Thread shaun
Hi,

How are you constructing your Boolean object?
Are you doing something like:

   var b:Boolean(false);  //true.

when you want:

   var b:Boolean(false); //false.

Have a read of the docs for the Boolean constructor if this is how your 
creating your Booleans, that might clear things up.

[snip]

 My actual code is:
 
 function filter(includeBase:Boolean) : void
 {
 if ( includeBase )
 {
 // Do a whole lot of stuff here.
 // Including updating bound variables, etc.
 }
 // After if do the rest of my merge process.
 }
 
 My problem was that if I passed in true or false, it always went into
 the true block of the if statement. So that is when I created my test
 function of crazy. So let's forget about that test function
 (although, there were not dup names. One var is s, the other is ss).
 
 So, my function has several things it will be doing inside of the true
 portion of the if statement, and then whether or not it was true or
 false, continue with other processes. After creating my crazy test
 function I then came back and modified my function to:
 function filter(includeBase:Boolean) : void
 {
 if ( includeBase )
 {
 // Do a whole lot of stuff here.
 // Including updating bound variables, etc.
 }
 else
 {
 // HACK FOR AN APPARENT BUG!
 // Not sure why, but this if statement will always resolve to
 true unless there is an else.
 var whoKnowsWhy : String;
 }
 // After if do the rest of my merge process.
 }
 
 Once I did this, my code works great. includeBase of true and it will
 go into the true block. includeBase of false and it will go into the
 false block.

I find this very very hard to beleive. I'm betting you changed the way 
your exercising the code (ie) by passing in an explicit false or true to 
the function.

[snip]

HTH.
  - shaun


Re: [flexcoders] Where to start learning Flex

2007-09-25 Thread shaun
neugi wrote:
 Hi,
 
 where to start learning flex2? are there good books, or tutorials online?
 
 thx
 

Download flexbuilder, read the developer guide and do the tutorials.

cheers,
- shaun


Re: [flexcoders] e4x question

2007-09-25 Thread shaun
Howdy,

Seth Caldwell wrote:
 Oh my god Toby, I just spent an hour because I was determined to learn about 
 namespaces, and found a solution for you. =)

[snip]

 if(event.result.RDF.*::Status.*::presence.(@*::lang==”en”)==”Offline”) status 
 = “Online”;
  

Nice one Seth.

Here is another solution that uses the namespaces. Note: the xml:lang is 
changed to the aaa namespace(so i used that in the e4x) but I'm not sure 
  why that happens(i noticed it when i traced the xml).

//Create the default namespace.
var ns:Namespace = new
Namespace(http://www.skype.com/go/skypeweb;);  

//Create the aaa namespace that is used instead of xml:lang.
var aaa:Namespace = new Namespace(http://www.w3.org/XML/1998/namespace;);


function creationComplete():void{
  var xml:XML = //assume it exists..
  doIt(xml);
}

private function doIt(xml:XML):void{
  //Set the namespace!
  default xml namespace = ns;
  trace(+xml.status.presence.(@aaa::lang=='en')); // Away
}   


cheers,
  - shaun












Re: [flexcoders] Where to start learning Flex

2007-09-25 Thread shaun
[EMAIL PROTECTED] wrote:
 What do you mean by the tutorials ?
 

Oh sorry, I should have been clearer.
I mean the lessons that are part of flexbuilder.  :)

 shaun wrote:
 
neugi wrote:

Hi,

where to start learning flex2? are there good books, or tutorials 

online?

thx


Download flexbuilder, read the developer guide and do the tutorials.


cheers,
   - shaun


Re: [flexcoders] Internet Explorer and Flex issues

2007-09-20 Thread shaun
its_llpj wrote:
 Hello,
 
 I read some issues with IE and Flex w/ SSL, but I am having a problem
 displaying anything in IE with just regular http. In my code I am
 using the HTTPService tag and it is being called on creationComplete.
 The page in IE comes up empty- I dont even get the wrapper page
 bgcolor to show... just a white page. It works fine in both Firefox
 and Safari. 
 
 I'm using Rails as the backend to generate the XML for the views.
 
 Any help or suggestions are greatly appreciated!

Search the message archive. Someone recently posted the anwser to your 
problem, from memory it was a cache header in the response that needs to 
be set or unset, I dont remember the exact details.

cheers,
  - shaun


Re: [flexcoders] Re: Code behind - class extend mxml vs. mxml extend class

2007-09-20 Thread shaun
Tom Chiverton wrote:
 So ?
 It really doesn't take that long, and no one is suggesting all existing code 
 is rewritten to code behind.
 Besides a 'code generator' is only an Eclipse plugin away.

Or a nice perl script!  :)

 
Second and more important, you can't use data binding that way which
is one of the most powerful features of Flex.
 
 
 Eh ?
 We use data binding with code behind all the time. It's fine.

Which code behind approach do you use Tom? The extends approach or the 
source include?

cheers,
- shaun


--
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

* 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:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

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


RE: [flexcoders] does flex2 has coldfusion cold hint?

2007-09-13 Thread Shaun McCran
I always edit my cfc's in DW. I normally also write a cfc_test.cfm.
 
this file is a good test for the cfc itself, its suprising how many
errors you think are flex related, and they aren't they are cfc
problems.
 
Always test your cfc's!
 

Thanks
Shaun


Shaun Mccran
Solutions Architect
T: 01454 423230
E: [EMAIL PROTECTED]
http://www.europa-group.co.uk/ 

 



This e-mail transmission may contain Europa Group Ltd./ Motorcycle
Direct
confidential information, which is legally privileged. This information
is intended for the use of the named individual. You are notified that
any disclosure, copying and distribution is prohibited. If you have
received this email in error, please notify us immediately. The views
expressed in this e-mail are not that of the company unless specified
within the message.
Europa Group Limited is authorised and regulated by the Financial
Services Authority

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of lyan_wang2003
Sent: 13 September 2007 05:45
To: flexcoders@yahoogroups.com
Subject: [flexcoders] does flex2 has coldfusion cold hint?



when I edit a cfc file in flex,there isn't any code hint,seems quite 
awkward.How can I fix it or I should open dreamweaver when comes to a 
cfc file??



 


The contents and any attachments of this electronic mail message are 
confidential and intended only for the named addressee. It may contain 
information covered by legal, professional or other privilege.  You are 
notified that any disclosure, copying and distribution is prohibited.  If you 
received this email in error, please accept our apologies, and we would 
appreciate that you return it to us. Europa Group Limited is authorised and 
regulated by the Financial Services Authority.Registered Office: 29 High 
Street, Thornbury, BS35 2FD. Registered in Wales Reg No 3279177

image002.gif

Re: [flexcoders] Re: A common question with no answer yet - Flex Debugger

2007-09-13 Thread shaun
Hi Mike,

Mike Morearty wrote:

   [snip]

 (b) If don't want Flex Builder to launch the browser at all, but just
 connect to a browser you already launched manually: This is a hack,
 but it works: Go to the same launch configuration dialog mentioned
 above, and just set the URL to any old thing (e.g about:blank, or if
 that doesn't work, http://www.google.com).  When you click Debug, Flex
 Builder will launch a browser at the bogus page; and now, for the next
 two minutes, Flex Builder is listening on a socket, waiting for the
 Flash player to connect to it.  Just ignore the bogus browser, and go
 over to the browser you wanted, and load your swf.  When the Flash
 Player starts, it will connect to the socket that Flex Builder is
 listening on.
 
 - Mike Morearty
   Adobe Flex Builder team


Thankyou very much for the information. Its a huge help to be able to 
run the debugger like this. Especially after an app has been integrated 
into an existing system (requiring a session id and other parameters 
being passed into the flex app).

I started using this yesterday and was overjoyed. :)

Thank again.
   - shaun


Re: [flexcoders] Re: Is it possible to query a Flash SWF for its images / symbol list ?

2007-09-13 Thread shaun
I just saw this on the MXNA flex feed, not sure if it helps in your 
situation or not.

http://wildwinter.blogspot.com/2007/09/how-to-load-external-assets-from-as3.html

helihobby wrote:
 Anyone ???
 
 :(
 
 
 --- In flexcoders@yahoogroups.com, helihobby [EMAIL PROTECTED] wrote:
 
Hello all,

I have a SWF that has some Symbols / images !!! ( Created using Flash 
Editor CS3 )

How can I retrieve the Symbols list it holds using ActionScript from 
the loaded Flash swf ? ( I Used SWFLoader to load it ... )

Regards,

Sean.

Click below to view my ALON Design Pattern:

http://www.helihobby.com/html/alon_desingpattern.html

 
 
 
 


Re: [flexcoders] Re: Is it possible to query a Flash SWF for its images / symbol list ?

2007-09-13 Thread shaun
helihobby wrote:
 Thanks for that ...
 
 That I can do ...
 
 But I was hoping someone can shed light on how to get a list of all 
 available Symbols from a loaded SWF.
 
 I know it is possible since that's what all these SWF Decompilers do.
 But how do you do it in actionscript ?

Take a look at the source code for the ObjectUtil.toString method.
And checkout the Flex2 developer guide: Performing Introspection.


I just saw this on the MXNA flex feed, not sure if it helps in your 
situation or not.

http://wildwinter.blogspot.com/2007/09/how-to-load-external-assets-
 
 from-as3.html

cheers,
   - shaun


  1   2   >