RE: [flexcoders] Re: storing login data from a cfquery for use throught flex app

2009-03-10 Thread Tracy Spratt
Have your login cfc return the user data if the user is verified, and assign
the properties of UserInfo in the result handler.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stinasius
Sent: Wednesday, March 11, 2009 1:14 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: storing login data from a cfquery for use throught
flex app

 

hi i created a storage class that i was using and it works perfectly but i
dont know how to use it to get data from a cfc through remote object call.
here is my code it works with username and password but when it comes to
geting the email address associated with the username and password from the
db i dont know how to do that and thats my biggest problem.

mainApp.mxml

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml layout=absolute xmlns:view=components.*
mx:states
mx:State name=Log Out
mx:SetProperty target={label1} name=text value=Log Out/
/mx:State
/mx:states
mx:Script
![CDATA[
import components.*;
//Flash Classes
import flash.events.Event;
import flash.events.MouseEvent;

//Flex Classes
import mx.containers.TitleWindow;
import mx.controls.Alert;
import mx.events.CloseEvent; 
import mx.managers.PopUpManager;
import mx.core.IFlexDisplayObject;
import mx.utils.ObjectUtil;

//static class
import classes.UserInfo;

public var loggedin:Boolean = false;
public var pop:Login; 

private function showLogin():void
{
pop = Login(PopUpManager.createPopUp(Application.application as
DisplayObject,Login,true));
pop.showCloseButton =true;
PopUpManager.centerPopUp(pop); 
pop.addEventListener(close,removeMe);
pop[cancelButton].addEventListener(click, removeMe);
pop.addEventListener( loginSuccessful, handleLoginSucess);
//UserInfo.Email = pop.authManager.email; 
}

private function removeMe(event:Event):void {
PopUpManager.removePopUp(pop);
}

private function handleLoginSucess(event:Event):void{
viewstack1.selectedChild = admin;
lbl_intro.text = Welcome  +pop.username_txt.text;
removeMe(event); 
currentState = 'Log Out';
UserInfo.UserName = pop.username_txt.text;
UserInfo.Email = pop.authManager.email;
//mx.controls.Alert.show(mx.utils.ObjectUtil.toString(pop.authManager));
//trace (UserInfo.Email);
} 


]]
/mx:Script

mx:Label x=0 y=0 text=Sign In id=label1 buttonMode=true
useHandCursor=true mouseChildren=false click=showLogin()/
mx:ViewStack x=0 y=26 id=viewstack1 width=100% height=100%
view:Home id=home/
view:Admin id=admin/
/mx:ViewStack 
mx:Label x=700 y=0 id=lbl_intro/
/mx:Application

login.mxml

?xml version=1.0 encoding=utf-8?
mx:TitleWindow xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml layout=absolute title=Login Form
mx:Metadata
[Event(name=loginSuccessful, type=flash.events.Event)] 
/mx:Metadata

mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.utils.ObjectUtil;
import mx.controls.Alert;
import mx.events.ValidationResultEvent;

import mx.core.Application;
import classes.UserInfo;

private function isValid():Boolean
{
var emailValidResult:ValidationResultEvent =
this.emailValidate.validate(this.username_txt.text);
var pswdValidResult:ValidationResultEvent =
this.pswdValidate.validate(this.password_txt.text);

if (emailValidResult.type==ValidationResultEvent.VALID 
 pswdValidResult.type==ValidationResultEvent.VALID) 
{
return true; 
}
else
{
return false; 
}

}

private function authenticateUser():void
{
if( isValid() )
{
authManager.loginUser( this.username_txt.text, this.password_txt.text/* ,
userCredentials */); 
UserInfo.isLogged = true; 
}
} 

private function errorMessage(msg:String):void
{
//Alert.show( ObjectUtil.toString(event.message) );
this.errorMsg.text = msg;
this.errorMsg.height = 15;
this.errorMsg.visible = true;
} 

private function serverFault(event:FaultEvent):void
{
errorMessage(event.message['message']);
} 


//[Bindable]
//private var profileAr:ArrayCollection = new ArrayCollection;

private function login_result(event:ResultEvent):void
{
// login successful, remember the user.
if( event.result == true || event.result == TRUE || event.result == 1
|| event.result == 1 )
{ 
//profileAr = new ArrayCollection((event.result as ArrayCollection).source);
/* Application.application.authenticateUser(userCredentials); */
this.dispatchEvent( new Event('loginSuccessful') );
}
else
{
// login didn't work. show message
errorMessage(Login unsuccessful); 
}
}
]]
/mx:Script

mx:RemoteObject 
id=authManager 
destination=ColdFusion 
source=login_example.cfc.login 
showBusyCursor=true
mx:method name=loginUser result=login_result(event)
fault=serverFault(event) /
/mx:RemoteObject 

mx:StringValidator 
id=emailValidate 
source={this.username_txt} 
property=text 
required=true /
mx:StringValidator 
id=pswdValidate 
source={this.password_txt} 
property=text 
required=true

RE: [flexcoders] Re: how to call dynamic servlet

2009-03-09 Thread Tracy Spratt
Why are you converting the e4x XML into the legacy XMLDocument?  And if you
really are satisfied working with dynamic Object instead of XML, then use
resultFormat=object and skip all that decdoing stuff.  Flex will do that
for you.  But that is the worst of both worlds; you lose the power of e4x
and suffer the diminished access performance of a dynamic object.

 

I suggest you use XML and XMLListCollection instead.

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of anitha2324
Sent: Sunday, March 08, 2009 3:20 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: how to call dynamic servlet

 

Hi Thanks alot for your reply,

I have removed the binding variables, replaced xml by e4x , and setted the
url before the service.send but am still unable to get the successful result


here is my modified code

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml layout=absolute creationComplete=init()
mx:Script
![CDATA[
import flash.net.sendToURL;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.xml.SimpleXMLDecoder;
import mx.controls.Button;
import mx.controls.Label;
import mx.collections.ArrayCollection;

[Bindable]
public var expenses:ArrayCollection;

public var userId:int;

public var servletURL:String;

private function init():void{
userId = 12;
servletURL=http://localhost:
http://localhost:8080/Application/topSenderServlet?TYPE=4amp;USER_ID=
8080/Application/topSenderServlet?TYPE=4amp;USER_ID=+userId;
Alert.show(servletURL);
topSenders.url=servletURL;
topSenders.send();
}
private function serv_result(evt:ResultEvent):void {
/* Convert XMLNode to XMLDocument. */
var xmlStr:String = evt.result.toString();
var xmlDoc:XMLDocument = new XMLDocument(xmlStr);
var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(true);
var resultObj:Object = decoder.decodeXML(xmlDoc);
/* Assign the values... */

expenses = new ArrayCollection();
for(var i:int=0;iresultObj.top.sender.length;i++){
Alert.show(resultObj.top.sender[i].phone);

}
}

]]
/mx:Script

!--mx:HTTPService id=topSenders useProxy=false resultFormat=xml
method=POST url=http://localhost:
http://localhost:8080/Application/topSenderServlet?TYPE=4amp;USER_ID=12
8080/Application/topSenderServlet?TYPE=4amp;USER_ID=12
result=serv_result(event);/--

mx:HTTPService id=topSenders useProxy=false resultFormat=e4x
method=POST 
result=serv_result(event);/

/mx:Application

thanking you in Advance





RE: [flexcoders] Re: Hie

2009-03-09 Thread Tracy Spratt
Also, you may see binding warnings, like Unable to bind to. XML is not an
IEventDispatcher.'  This is kind of a bogus warning, the description anyway.
Fix it like this:

text={XML(upcomingRepeater.currentItem).empResults}

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of ppongtong
Sent: Friday, February 27, 2009 10:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Hie

 

Please try the following.

mx:Repeater id=upcomingRepeater dataProvider={this.myXML.stat} 
mx:Text id=upcomingText
text={upcomingRepeater.currentItem.empResults}
color={(upcomingRepeater.currentItem.empStatus == 'VALID') ?
0xFF:0x00}/
/mx:Repeater

Panhathai

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Vik vik@... wrote:

 Hie
 My xml is like this:
 
 stat
 empResultsguan completing 9 years in 6 months and 5 days./empResults
 empStatusINVALID/empStatus
 /stat
 stat
 empResultskumar completing 4 years in 11 months and 18
days./empResults
 empStatusVALID/empStatus
 /stat
 stat
 empResultskies completing 4 years in 11 months and 26
days./empResults
 empStatusINVALID/empStatus
 /stat
 stat
 empResultsroy completing 4 years in 11 months and 26
days./empResults
 empStatusVALID/empStatus
 /stat
 
 I want to show it in my vbox as text boxes like
 
 guan completing 9 years in 6 months and 5 days.
 kumar completing 4 years in 11 months and 18 days.
 kies completing 4 years in 11 months and 26 days.
 roy completing 4 years in 11 months and 26 days.
 
 Please note color is red for those whose empStatus in INVALID.
 
 currently my code is like:
 mx:Repeater id=upcomingRepeater dataProvider={myXML}
 mx:Text id=upcomingText text={upcomingRepeater.currentItem}/
 /mx:Repeater
 
 This above code shows me all in black as I have not applied this
empStatus
 to format. So how to do that?
 
 
 
 
 Thankx and Regards
 
 Vik
 Founder
 www.sakshum.com
 www.sakshum.blogspot.com






RE: [flexcoders] Flex 3 Tree - Moving Nodes

2009-03-09 Thread Tracy Spratt
This has been a problem with Tree for as long as I can remember, that is,
especially with empty nodes, how do you select it to drop into?  Alex said,
Open but empty folders have a middle drop zone for dropping into.  I
wonder how to recognize that zone when you are over it?

 

The drag indicators are all lines, of different lengths, to show in a node
or between nodes.  Tree needs a block or bar highlight on the parent node
itself, to indicate drop into here.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim Hayes
Sent: Monday, March 09, 2009 7:17 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Flex 3 Tree - Moving Nodes

 

I had thought that I'd used the code there to allow users to drag/drop
reorder and move tree nodes, but it was quite a long while ago so I may well
be wrong.

It wasn't perfect, but not bad at all.

Also I may have misunderstood what you are looking for.

Still, glad it wasn't entirely wasted!

 

-Original Message-
From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Alan Rother
Sent: 09 March 2009 23:01
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex 3 Tree - Moving Nodes

 

Thanks Jim,

 

Thats not exactly what I was looking for, but it's a great example of how to
use some of the Tree components, which I've been struggling with...

 

=]
-- 
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Developer
Manager, Phoenix Cold Fusion User Group, AZCFUG.org


__
This communication is from Primal Pictures Ltd., a company registered in
England and Wales with registration No. 02622298 and registered office: 4th
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK.
VAT registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied
and used only by the intended recipient. If you have received it in error,
please contact the sender immediately by return e-mail or by telephoning
+44(0)20 7637 1010. Please then delete the e-mail and do not disclose its
contents to any person.
This email has been scanned for Primal Pictures by the MessageLabs Email
Security System.
__







RE: [flexcoders] Re: Convert ArrayCollection to XML

2009-03-09 Thread Tracy Spratt
I'd suggest using XML all the way through, instead of converting XML to
ArrayCollection first, then trying to convert it back.  What RPC protocol
are you using for server communication?  What is your resultFormat?

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of tiend...@ezweb.ne.jp
Sent: Monday, March 09, 2009 8:58 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Convert ArrayCollection to XML

 

Thanks,

I was read it, but can not apply in my app.
I think , can not convert ArrayCollection to XML. You must convert XML in
PHP code.

Anyway thank you.

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
oneworld95 oneworl...@... wrote:

 http://nsdevaraj.
http://nsdevaraj.wordpress.com/2008/08/20/arraycollection-xml/
wordpress.com/2008/08/20/arraycollection-xml/
 
 - Alex C
 
 --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
tiendans@ tiendanvn@ wrote:
 
  Hi all guru,
  
  I have a question about ArrayCollection.
  
  [Backend: MySQL,PHP]
  MySQL return result in Array.
  
  [Frontend: Flex]
  dp = new ArrayCollection( ArrayUtil.toArray(event.result));
  
  I want to convert ArrayCollection (dp) to XML, and show XML result in
TextArea.
  
  
  Help me please !
 






RE: [flexcoders] DropDown selectedIndex problem

2009-03-09 Thread Tracy Spratt
Often when you programmatically  assign a dataProvider to a control, you
need to wait for the control to render before operating on its visual
elements.  So save the desired index from the loop, then use callLater() to
actually set the selectedIndex.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of moevydot...@ymail.com
Sent: Sunday, March 08, 2009 6:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DropDown selectedIndex problem

 

Hello @ all,
I want to select a specific part with selectedIndex. But it dont works :( It
selects all the time the first one in the list.

Can someone give me a help? There its the code... 

Thanks Michael

Code:
mx:Script
![CDATA[
import mx.controls.Alert;
import mx.collections.ArrayCollection;

[Bindable]
public var initSubjectableList:ArrayCollection = new ArrayCollection();
public var licenceID:String;

private function getSubjectDataList(evt:ResultEvent):void {
var count:Number = 0;
var _data:Array;
var _data2:Array;

for( count = 0; count  evt.result.id.length; count++)
{
//create array for drop down
_data = [{ID: evt.result.id[count], label: evt.result.name[count]}];
_data2 = _data.concat(_data2);
initSubjectableList = new ArrayCollection(_data2);

if(evt.result.id[count] == licenceID) {
editLicence.selectedIndex = count;

mx.controls.Alert.show(ID);
mx.controls.Alert.show(evt.result.id[count]); 
}
}
}

]]
/mx:Script





RE: [flexcoders] Debugging Event Bubbling

2009-03-08 Thread Tracy Spratt
Bubbling works generally.  Simplify until it does, then re-add your
complexity til it breaks.

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of valkyrie77
Sent: Sunday, March 08, 2009 1:52 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Debugging Event Bubbling

 

Hi Folks,

I'm currently working on a twitter AIR client using the twitterscript AS3
library and having some issues with bubbling custom events that are created
by nested classses back to the main application.

I've architected so that the main application (A) spawns a new timeline
window (B) for every twitter account a user may have. I have a Comm class
(C) i use as a DAO layer to decouple the twitterscript custom events from my
framework (in case i switch to a different as3 API library)

My custom event class looks like this 

package com.kubeworks.events
{
import flash.events.Event;

public class TweetCommEvent extends Event
{
public static const TIMELINE_BACK:String = timelineBack;
public static const STATUS_BACK:String = statusBack;
public static const USER_INFO_BACK:String = userInfoBack;
public static const RATE_LIMIT_STATUS:String = rateLimitBack;
public var data : Object = new Object ();

public function TweetCommEvent(type:String, bubbles:Boolean=true,
cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
}

override public function clone():Event {
return new PreferencePaneEvent(type, bubbles, cancelable);
}

}
}

My Comm Class goes something like
package com.kubeworks.data
{
// Twitter API calls
import com.kubeworks.events.TweetCommEvent;

import flash.events.Event;
import flash.events.EventDispatcher;
import flash.utils.*;

import mx.utils.ObjectUtil;

import twitter.api.Twitter;
import twitter.api.events.TwitterEvent;

public class TweetComm extends EventDispatcher
{

private var username:String;
private var password:String;

private var _twitterClient:Twitter;

// Constructor
public function TweetComm(usern:String, pass:String)
{
// Initialize Twitter Event Listeners
_twitterClient = new Twitter();
_twitterClient.addEventListener(Event.ACTIVATE,
twitterClientActivateHandler);
_twitterClient.addEventListener(Event.DEACTIVATE, twitterClientDeactivate);
_twitterClient.addEventListener(TwitterEvent.ON_FRIENDS_TIMELINE_RESULT,
twitterTimelineBack);
_twitterClient.addEventListener(TwitterEvent.ON_SET_STATUS,
twitterStatusBack);
_twitterClient.addEventListener(TwitterEvent.ON_SHOW_INFO, twitterUserBack);
_twitterClient.addEventListener(TwitterEvent.ON_RATE_LIMIT_STATUS,
twitterRateLimitBackHandler);


// Do stuff
setLogin(usern, pass);
setAuth();
}

and within that class i'm re-dispatching like:

private function twitterRateLimitBackHandler(event:TwitterEvent):void {
var eventObj:TweetCommEvent = new
TweetCommEvent(TweetCommEvent.RATE_LIMIT_STATUS, true);
eventObj.data = event.data;
dispatchEvent(eventObj);
trace(twitterRateLimitBackHandler);
trace(ObjectUtil.toString(event));
trace(twitterRateLimitBackHandler);
trace(ObjectUtil.toString(eventObj));
}

I've set the bubbling to true. However in my main application this
EventListener never fires

systemManager.addEventListener(TweetCommEvent.RATE_LIMIT_STATUS,
onRateLimitHandler);

Any help would be greatly appreciated as i am out ideas and have exausted
google and my flex friends.

Thanks,
Sean





RE: [flexcoders] importing and dynamically creating objects

2009-03-08 Thread Tracy Spratt
Do I understand that you have a different class for every question?  That
sounds like a bad idea.  I am sure import is a compile time only action, and
you can't do it at run-time, so you need to find a different approach.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Wally Kolcz
Sent: Sunday, March 08, 2009 1:08 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] importing and dynamically creating objects

 

I am trying to create a quizzer when the questions are in components. I want
to import the component and add it to the stage based on the question that
next and the quiz they are taking. If they load test 1 i need it to:

import com.ipexpert.test.1.question1;
var currentQuestion:question1 = new question1;
questionArea.addChild(currentQuestion);

I have the varible for the test loaded: testID
and the current question: questionNum

I am trying to build it on the fly with something like:

import com.ipexpert.tests. + testID + . + question + questionNum;
var currentQuestion:question + questionNum = new question + questionNum;
questionArea.addChild(currentQuestion);

Needless to say it is wrong and I am getting an errors:

1084: Syntax error: expecting identifier before plus. for the first line
(imprt com.ipexperts...)
and
1086: Syntax error: expecting semicolon before plus. for the second line
(var currentQuestion...)



Any better ideas or how can I write this right?





RE: [flexcoders] how to call dynamic servlet

2009-03-07 Thread Tracy Spratt
That should work, I use dynamic urls with HTTPService regularly.  One
suggestion, don't use binding. Instead, in the function where you invoke
service.send(), set the url there.

 

Additionally, unless you have a very special use case, you do not want
resultFormat=xml, you want resultFormat=e4x.  xml is the old AS
object, and lacks most of the functionality available in e4x.

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of anitha2324
Sent: Saturday, March 07, 2009 2:35 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] how to call dynamic servlet

 

Hi All,

i have made a servelt which returns details in xml format ,
this is servlet is working fine if am calling it from flex in static way
like this

mx:HTTPService id=topSenders useProxy=false resultFormat=xml
method=POST url=http://localhost:
http://localhost:8080/Application/topSenderServlet?TYPE=4amp;USER_ID=12
8080/Application/topSenderServlet?TYPE=4amp;USER_ID=12 
result=serv_result(event);/

but if i tried to call the servlet like this

mx:HTTPService id=topSenders useProxy=false resultFormat=xml
method=POST url={servletURL} 
result=serv_result(event);/

then it is not working , am not getting any error

here is the full code for my mxml file

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml layout=absolute creationComplete=init()
mx:Script
![CDATA[
import flash.net.sendToURL;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.xml.SimpleXMLDecoder;
import mx.controls.Button;
import mx.controls.Label;
import mx.collections.ArrayCollection;

[Bindable]
public var expenses:ArrayCollection;

[Bindable]
public var userId:int;
[Bindable]
public var servletURL:String;





private function init():void{
userId = 12;
servletURL=http://localhost:
http://localhost:8080/Application/topSenderServlet?TYPE=4amp;USER_ID=
8080/Application/topSenderServlet?TYPE=4amp;USER_ID=+userId;
Alert.show(servletURL);
topSenders.send();
}
private function serv_result(evt:ResultEvent):void {
/* Convert XMLNode to XMLDocument. */
var xmlStr:String = evt.result.toString();
var xmlDoc:XMLDocument = new XMLDocument(xmlStr);
var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(true);
var resultObj:Object = decoder.decodeXML(xmlDoc);
/* Assign the values... */

expenses = new ArrayCollection();
for(var i:int=0;iresultObj.top.sender.length;i++){
Alert.show(resultObj.top.sender[i].phone);

}
}


]]
/mx:Script


!--mx:HTTPService id=topSenders useProxy=false resultFormat=xml
method=POST url=http://localhost:
http://localhost:8080/Application/topSenderServlet?TYPE=4amp;USER_ID=12
8080/Application/topSenderServlet?TYPE=4amp;USER_ID=12 
result=serv_result(event);/--

mx:HTTPService id=topSenders useProxy=false resultFormat=xml
method=POST url={servletURL} 
result=serv_result(event);/

/mx:Application

thanking you in advance





RE: [flexcoders] dragdrop inside itemEditor in dataGrid...a tricky question

2009-03-07 Thread Tracy Spratt
For a renderer of that complexity, I would not use the DGs native editable
process, but would handle the dataProvider item updates within the renderer
itself.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Gal Afik
Sent: Saturday, March 07, 2009 10:42 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] dragdrop inside itemEditor in dataGrid...a tricky
question

 

Hello all

I'd really appreciate your help on this.
I have a itemEditor in my datagrid (see attached code).. this is a dragdrop
text input... I drag words inside and it concatenates them to a comma
separated string...
I've embedded it in the grid like that:
mx:DataGridColumn headerText=Prevent ctx dataField=@prevent_ctxs
rendererIsEditor=true width=200
itemRenderer=CtxTI editable=true/

The problem is that the grid does not sense the itemBegin/itemEnd events
when I drag things inside..
and therefore does not activate the editor/automatically pull the data of
the itemEditor and puts it into the grid..

Can anyone figure a way to correct/around this?

Thanks in advance
Afik Gal 

== CtxTI.mxml ===
?xml version=1.0 encoding=utf-8?
mx:TextInput xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml
dragDrop=dragDrop(event) dragEnter=dragAccept(event)
mx:Script
![CDATA[

import mx.events.DragEvent;
import mx.managers.DragManager;
import mx.controls.listClasses.ListData;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.listClasses.BaseListData;

override public function set data(value:Object):void
{
super.data=value;
var attrib:String=
DataGridListData(listData).dataField.substr(1,-1+DataGridListData(listData).
dataField.length);
var input:String;
if (value) input=XML(value).attribute(attrib)[0].toString(); 
if (input!=) this.text=input;
}


private function dragAccept(event:DragEvent):void
{
var dropTarget:TextInput = event.currentTarget as TextInput;
DragManager.acceptDragDrop(dropTarget);
} 
private function dragDrop(event:DragEvent):void
{ 
if (!event.dragSource.hasFormat(treeItems)) return;
var arr:Array = event.dragSource.dataForFormat(treeItems) as Array;
var str:String = XML(arr[0])@label.tostring();
if ((this.text.substr(-1)!=,)  (this.text.length0)) this.text+=,;
this.text+=str+,;
}
]]
/mx:Script
/mx:TextInput





RE: [flexcoders] dataGrid not receiving user input (intermitently) in bottom right

2009-03-07 Thread Tracy Spratt
If you are pretty sure there is not something invisible covering that area,
try cleaning the project.  

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of tom s
Sent: Saturday, March 07, 2009 6:31 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] dataGrid not receiving user input (intermitently) in
bottom right

 

I have a datagrid that works ~50% of the time. 

The other 50% of the time the dataGrid wont accept user interaction in the
bottom right area (the bottom 3 (of 6) rows, right 2 (of 4) columns).

i.e. that part of the grid does not react to mouse over events, not mouse
click events.

Sometimes is reacts to click events as if they are occurring in the row in
which a mouse_over interaction was last observed. 

 

Looking at the redraw regions, I see that a redraw region occasionally
appears in the bottom right of the grid - exactly where he grid is not
receiving user input.

So that is probably related. 

But I don't know what it is a redraw region for. I've checked my other
component and they aren't near.

 

I have the following custom item renderers:

column 2: extends Canvas

column 3: extends Label

column 4: extends Label.

 

Anyone know what might be causing this?

Or how to fix it / diagnose it further?

 

thanks

 

tom

 

 

 

 





RE: [flexcoders] Re: dragdrop inside itemEditor in dataGrid...a tricky question

2009-03-07 Thread Tracy Spratt
Yes, leave off renderIseditor=true.

 

Your renderer will know which item it is currently associated with, since
that reference gets passed into the renderer any time the underlying data
changes in the set data() function.  Further, if the renderer implements the
IDropInListItemrrenderer interface, you will als have access to the listData
and thus dataProvider, should you need to get the itemIndex using
getItemIndex.

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Gal Afik
Sent: Saturday, March 07, 2009 12:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: dragdrop inside itemEditor in dataGrid...a tricky
question

 

Hmm...

Thanks for the response...nice idea... but how do I access the right row in
the dataprovider XMLListCollection? (rowIndex?)
and if I choose this approach I simply turn the editor to renderer?

Thanks
Afik

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Tracy Spratt tspr...@... wrote:

 For a renderer of that complexity, I would not use the DGs native editable
 process, but would handle the dataProvider item updates within the
renderer
 itself.
 
 
 
 Tracy
 
 
 
 _ 
 
 From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com]
On
 Behalf Of Gal Afik
 Sent: Saturday, March 07, 2009 10:42 AM
 To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
 Subject: [flexcoders] dragdrop inside itemEditor in dataGrid...a tricky
 question
 
 
 
 Hello all
 
 I'd really appreciate your help on this.
 I have a itemEditor in my datagrid (see attached code).. this is a
dragdrop
 text input... I drag words inside and it concatenates them to a comma
 separated string...
 I've embedded it in the grid like that:
 mx:DataGridColumn headerText=Prevent ctx dataField=@prevent_ctxs
 rendererIsEditor=true width=200
 itemRenderer=CtxTI editable=true/
 
 The problem is that the grid does not sense the itemBegin/itemEnd events
 when I drag things inside..
 and therefore does not activate the editor/automatically pull the data
of
 the itemEditor and puts it into the grid..
 
 Can anyone figure a way to correct/around this?
 
 Thanks in advance
 Afik Gal 
 
 == CtxTI.mxml ===
 ?xml version=1.0 encoding=utf-8?
 mx:TextInput xmlns:mx=http://www.adobe. http://www.adobe.
http://www.adobe.com/2006/mxml com/2006/mxml
 com/2006/mxml
 dragDrop=dragDrop(event) dragEnter=dragAccept(event)
 mx:Script
 ![CDATA[
 
 import mx.events.DragEvent;
 import mx.managers.DragManager;
 import mx.controls.listClasses.ListData;
 import mx.controls.dataGridClasses.DataGridListData;
 import mx.controls.listClasses.BaseListData;
 
 override public function set data(value:Object):void
 {
 super.data=value;
 var attrib:String=

DataGridListData(listData).dataField.substr(1,-1+DataGridListData(listData).
 dataField.length);
 var input:String;
 if (value) input=XML(value).attribute(attrib)[0].toString(); 
 if (input!=) this.text=input;
 }
 
 
 private function dragAccept(event:DragEvent):void
 {
 var dropTarget:TextInput = event.currentTarget as TextInput;
 DragManager.acceptDragDrop(dropTarget);
 } 
 private function dragDrop(event:DragEvent):void
 { 
 if (!event.dragSource.hasFormat(treeItems)) return;
 var arr:Array = event.dragSource.dataForFormat(treeItems) as Array;
 var str:String = XML(arr[0])@label.tostring();
 if ((this.text.substr(-1)!=,)  (this.text.length0)) this.text+=,;
 this.text+=str+,;
 }
 ]]
 /mx:Script
 /mx:TextInput






RE: [flexcoders] Re: Timers and local CPU

2009-03-06 Thread Tracy Spratt
That was going to be my suggestion.

 

The main thing that makes an itemRendrer heavy or expensive is basing it on
a container, like VBox, instead of on UIComponent..  Yours looks good.

 

And I think maybe I would store the start time and calculate the elapsed
time, rather than incrementing the elapsed time on each timer tick.  It
might be a little more accurate, and would let you adjust the timer
interval.  You might find that 2 or 3 seconds is a short enough interval,
and would lower the cpu load quite a bit.

 

Tracy

 

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markgoldin_2000
Sent: Friday, March 06, 2009 10:40 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Timers and local CPU

 

About 30-40.
What about an idea to have one single timer and update all underlying data
every second without having a timer for each row?

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Tom Chiverton tom.chiver...@... wrote:

 On Friday 06 Mar 2009, markgoldin_2000 wrote:
  Every second.
 
 Doesn't seem so bad - are there many rows ?
 
  Not sure, how do I know that?
 
 Is it fast if you use mx:Text :-)
 
 -- 
 Tom Chiverton
 Helping to efficiently initiate internet open-source architectures
 as part of the IT team of the year, '09 and '08
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in England
and Wales under registered number OC307980 whose registered office address
is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.
A list of members is available for inspection at the registered office
together with a list of those non members who are referred to as partners.
We use the word ?partner? to refer to a member of the LLP, or an employee or
consultant with equivalent standing and qualifications. Regulated by the
Solicitors Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above and
may be confidential or legally privileged. If you are not the addressee you
must not read it and must not use any information contained in nor copy it
nor inform any person other than Halliwells LLP or the addressee of its
existence or contents. If you have received this email in error please
delete it and notify Halliwells LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.






RE: [flexcoders] Refresh DateField

2009-03-06 Thread Tracy Spratt
For a date, the timer interval could be long,, like a minute or more.  That
wouldn't be much overhead.

 

If you have any other timers running, you could piggyback that functionality
on one of those, instead of starting another.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markgoldin_2000
Sent: Friday, March 06, 2009 11:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Refresh DateField

 

If I have a DateField defined like this:
mx:DateField selectedDate={new Date()} id=closedate/

How would I refresh it to show the current date if a program is running
constantly for more than 24 hours? I can probably use a timer but trying to
stay away from local CPU overload.

Thanks for help.





RE: [flexcoders] non-editable datagrid cells

2009-03-06 Thread Tracy Spratt
Use the itemEditBeginning event.

http://www.cflex.net/showFileDetails.cfm?ObjectID=723

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Dennis Falling
Sent: Friday, March 06, 2009 12:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] non-editable datagrid cells

 

Is there a way to prevent a specific cell from triggering its renderer?  I
need other cells in that column to be editable, but not it. 





RE: [flexcoders] Re: hiding an applicationcontrolbar button

2009-03-06 Thread Tracy Spratt
Yes, the content of the toggleButtonBar will be determined entirely by its
dataProvider.  If you want to change the content of the button
Bar, you must change its dataprovider.

 

One way to do this is to add/remove the viewstack children.

 

But this process has always seemed unnecessarily difficult, just to change
the visibility/availability or a button, so I never use a viewStack as a
dataProvider for anything that needs to be dynamically controlled.

 

Instead, I use a separate dataProvider, for the control bar, which contains
the index into the viewStack, and manipulate that dataProvider to control
the available buttons.  A click on a button uses the index in the
dataProvider to set the selectedIndex of the ViewStack.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Tim Hoff
Sent: Friday, March 06, 2009 2:57 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: hiding an applicationcontrolbar button

 


Hi Greg,

Have you tried removeChild()?

-TH

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Greg Morphis gmorp...@... wrote:

 I tried that in the creationComplete function and the show function.
 Neither hid the tab/button

 On Fri, Mar 6, 2009 at 9:16 AM, Adrian Williams
 adri...@... wrote:
  Hi Greg,
 
  does this not work for you?
 
  if (MyModel.getInstance().currentUser.useraccess == 99)
  {
  aHeadlines.visible = true;
  }
  else
  {
  aHeadlines.visible = false;
  }
 
 
 
  Greg Morphis wrote:
 
  I'm trying to hide or destroy a button that's showing in an
  ApplicationControlBar.
  Basically when the user logs into the tool their information is
  checked and one button or another will show.
 
  The code currently looks like
 
  mx:VBox... 
  mx:ApplicationControlBar ... 
  mx:ToggleButtonBar id=adminMenu  dataProvider={adminVS}
  /mx:ApplicationControlBar
 
  mx:ViewStack ... id=adminVS ... 
  AdminVW:AdminUser id=aUser ... /
  AdminVW:AdminSecurity id=securityBox ... /
  AdminVW:AdminMenu id=aMenu ... /
  AdminVW:AdminNews id=aNews ... /
  AdminVW:AdminTopAgentsid=aUser ... /
  AdminVW:AdminHeadlines id=aHeadlines ... /
  ...
 
  What if I only wanted to show the AdminHeadlines button if when they
  log in thier access is 99.
  The access is stored in MyModel.getInstance().currentUser.useraccess
 
  I've tried using a function and setting the visiable and
  includeInLayout to the return value, I.E.:
  private function showHeadlines ():Boolean {
  return (MyModel.getInstance().currentUser.useraccess == 99)
  }
 
  But that's not working.. Ideas?
 
  Thanks!
 
 
 






RE: [flexcoders] Web service, parameters, errors... Help please

2009-03-05 Thread Tracy Spratt
The value you want to pass needs to be in the text node, not in an
attribute.  Something like:

Find__CompIntfc__DL_TREE_IB_CIX/Find__CompIntfc__DL_TREE_IB_CI



 

Also, this declarative syntax is hard to debug.  I suggest invoking your
call in an as function:

var sValue:String = X:

var oRequest:Object ={ Find__CompIntfc__DL_TREE_IB_CI : sValue };

myService.send(oRequest);

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim
Sent: Thursday, March 05, 2009 8:57 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Web service, parameters, errors... Help please

 

I'm new to Flex and web services. I've created a web service in PeopleSoft
and successfully imported the WSDL into Flex so that it has contacted the PS
server and returned data (using mx:WebService and mx:Operation code I found
examples of). However, I have been unable to pass a parameter to the service
from Flex using that code. I then discovered and followed the sample code in
the Flex-generated package, but no matter what I do I cannot successfully
supply the myValue in the sample shown below. Here is Flex's own text in
my GetInfo.as file built by Flex:

* MXML sample code:
* First you need to map the package where the files were generated to a
namespace, usually on the mx:Application tag, like this:
xmlns:ws=com.draper.*
* Define the service and within its tags set the request wrapper for the
desired operation
* ws:GetInfo id=myService
* ws:FindID_request_varws:FindID_request
Find__CompIntfc__DL_TREE_IB_CI=myValue/
* /ws:FindID_request_var
* /ws:GetInfo
* Then call the operation for which you have set the request wrapper value
above, like this:
* mx:Button id=myButton label=Call operation
click=myService.FindID_send() /

My code is:
ws:GetInfo id=userRequest
ws:findID_request_varws:FindID_request
Find__CompIntfc__DL_TREE_IB_CI=X/
/ws:findID_request_var
/ws:GetInfo

When I try to run it, Flex is unhappy with the value I am assigning (X
above) no matter what I put there. If I omit the double quotes and try to
assign a text input field value (which is my goal here), it complains that
it expects a double quote. If I put almost anything else there, it complains
either:

Initializer for 'Find__CompIntfc__DL_TREE_IB_CI'; values of type
com.draper.Find__CompIntfc__DL_TREE_IB_CITypeShape cannot be represented as
text.

or, if I try this line, where I attempt to pass a text input field:

ws:FindID_request Find__CompIntfc__DL_TREE_IB_CI={compID.text}/

then I get:

1067: Implicit coercion of a value of type String to an unrelated type
com.draper:Find__CompIntfc__DL_TREE_IB_CITypeShape

Can anyone help with this please?

Thanks

Jim 





RE: [flexcoders] Problem in sorting XMLList collection as a dataProvider for the list

2009-03-05 Thread Tracy Spratt
I would use a sort function, so I could debug any problems.

 

I'd also suggest an e4x expression instead of the loop.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of anuj181
Sent: Wednesday, March 04, 2009 6:51 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Problem in sorting XMLList collection as a
dataProvider for the list

 

Hi Guys
I am trying to sort the xmllist collection which is the dataprovider for the
list. As the implementation of name-value pairs, i am displaying the entries
in form of string in List and would like to sort all the data displayed in
the List alphabetically, I am making a call through amfphp call to grab data
from backend and populate XMLListCollection but now I need to sort the data
in the list. Below is the code,Can anyone please help me where I am messing
things up. Also please let me know if there is any question regarding the
code and if there is better way of doing it.

Thanks

/**CODE/

mx:RemoteObject id=amfSetup source=Setup destination=amfphp 
mx:method name=getList result=getListHandler(event);
fault=getListFault(event);/ 
/mx:RemoteObject

[Bindable] private var entriesXmlListFull:XMLList;
[Bindable] private var entriesXmlCollection:XMLListCollection;


public function getListHandler(event:ResultEvent):void
{ 

entriesXmlListFull = XML(event.result).device;
populateEntries();
}
private function getListFault(event:FaultEvent):void
{
Alert.Show(Error retreiving Data);
}

//Displaying names need to be displayed in the List box
private function entriesLabelFunc(item:Object):String
{
var xmlItem:XML = item as XML;

return xmlItem..attribute.(@name==friendlyname);
}

//Populating List with XML Objects
private function populateEntries():void
{
entriesXmlCollection = new XMLListCollection(); 

for each(var item:XML in entriesXmlListFull)
{

var friendlyName:String = item..attribute.(@name==friendlyname);
//Only add camera type
if ( !recordValue  hasFriendlyName  (itemType.toUpperCase() == CAMERA)
)
{
entriesXmlCollection.addItem(item);
}
}

//Calling Sort on XMLList collection 
entriesXmlCollection.sort = sortList;
entriesXmlCollection.refresh(); 


}


mx:Sort id=sortList
mx:fields
mx:SortField name=* caseInsensitive=true /
/mx:fields
/mx:Sort

mx:List id=listData dataProvider={entriesXmlCollection}
labelFunction=entriesLabelFunc/





RE: [flexcoders] Re: Web service, parameters, errors... Help please

2009-03-05 Thread Tracy Spratt
First and foremost, we must know: what is the name of the operation/method
of the web service, and what are the parameters names and datatypes.  I am
not good enough at reading wsdls to offer to analyze yours, but you can
probably figure it out, or find some documentation.

 

For instance, where did you come up with the string,
'Find__CompIntfc__DL_TREE_IB_CI?

 

Next, decide whether you want to do the whole thing in AS or not.  I often
declare the web service in mxml, then manipulate it in AS.  

 

No, new GetInfo()  would not be correct.  Declaring the WebService in
mxml, or calling loadWSDL automatically makes the operations/methods
available to the web service instance, no need to new.

 

Here is a simple example that might help:

http://www.cflex.net/showfiledetails.cfm?ObjectID=223

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim
Sent: Thursday, March 05, 2009 11:39 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Web service, parameters, errors... Help please

 

Tracy,

 The value you want to pass needs to be in the text node, not in an
 attribute. Something like:
 
 Find__CompIntfc__DL_TREE_IB_CIX/Find__CompIntfc__DL_TREE_IB_CI

The above line won't work; it gets the error message about 
Initializer for 'Find__CompIntfc__DL_TREE_IB_CI'; values of type
com.draper.Find__CompIntfc__DL_TREE_IB_CITypeShape cannot be represented as
text. with or without quotes.

I wonder if you would be willing to help me flesh out the function path (As
I said, I'm pretty new to this, both Flex and ActionScript).

private function betterway (): void
{
var myService:GetInfo = new GetInfo();(is that right for myService?) 
var sValue:String = something;
var oRequest:Object ={ Find__CompIntfc__DL_TREE_IB_CI : sValue };

myService.send();

If I try this, I get an error that there is no send() method for GetInfo. If
I switch it to 
myService.findID(oRequest)
I get an error that type Object is being coerced to possibly unrelated type
com.draper:Find__CompIntfc__DL_TREE_IB_CITypeShape.

Thanks for any light you can shed.

 
 
 
 
 
 Also, this declarative syntax is hard to debug. I suggest invoking your
 call in an as function:
 
 var sValue:String = X:
 
 var oRequest:Object ={ Find__CompIntfc__DL_TREE_IB_CI : sValue };
 
 myService.send(oRequest);
 
 
 
 Tracy
 
 
 
 _ 
 
 From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com]
On
 Behalf Of Jim
 Sent: Thursday, March 05, 2009 8:57 AM
 To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
 Subject: [flexcoders] Web service, parameters, errors... Help please
 
 
 
 I'm new to Flex and web services. I've created a web service in PeopleSoft
 and successfully imported the WSDL into Flex so that it has contacted the
PS
 server and returned data (using mx:WebService and mx:Operation code I
found
 examples of). However, I have been unable to pass a parameter to the
service
 from Flex using that code. I then discovered and followed the sample code
in
 the Flex-generated package, but no matter what I do I cannot successfully
 supply the myValue in the sample shown below. Here is Flex's own text in
 my GetInfo.as file built by Flex:
 
 * MXML sample code:
 * First you need to map the package where the files were generated to a
 namespace, usually on the mx:Application tag, like this:
 xmlns:ws=com.draper.*
 * Define the service and within its tags set the request wrapper for the
 desired operation
 * ws:GetInfo id=myService
 * ws:FindID_request_varws:FindID_request
 Find__CompIntfc__DL_TREE_IB_CI=myValue/
 * /ws:FindID_request_var
 * /ws:GetInfo
 * Then call the operation for which you have set the request wrapper value
 above, like this:
 * mx:Button id=myButton label=Call operation
 click=myService.FindID_send() /
 
 My code is:
 ws:GetInfo id=userRequest
 ws:findID_request_varws:FindID_request
 Find__CompIntfc__DL_TREE_IB_CI=X/
 /ws:findID_request_var
 /ws:GetInfo
 
 When I try to run it, Flex is unhappy with the value I am assigning (X
 above) no matter what I put there. If I omit the double quotes and try to
 assign a text input field value (which is my goal here), it complains that
 it expects a double quote. If I put almost anything else there, it
complains
 either:
 
 Initializer for 'Find__CompIntfc__DL_TREE_IB_CI'; values of type
 com.draper.Find__CompIntfc__DL_TREE_IB_CITypeShape cannot be represented
as
 text.
 
 or, if I try this line, where I attempt to pass a text input field:
 
 ws:FindID_request Find__CompIntfc__DL_TREE_IB_CI={compID.text}/
 
 then I get:
 
 1067: Implicit coercion of a value of type String to an unrelated type
 com.draper:Find__CompIntfc__DL_TREE_IB_CITypeShape
 
 Can anyone help with this please?
 
 Thanks
 
 Jim






RE: [flexcoders] Re: Passing params (flashvars) to sub-applications

2009-03-04 Thread Tracy Spratt
You said, I was also able to pass a parameter in the url, and access it in
the loaded  app's creationComplete.  That *is* using flashvars.  Flashvars
are passed into a swf via url parameters.

 

The example you are quoting, which passes values from one fully instantiated
application to another is not using flashvars.  Maybe the title of that post
is misleading, but it does say flashvar-*style*-parameters., meaning a
dynamic Object.

 

Note also that apps loaded by swfloader do behave differently than ordinary
components, in this regard.  Ordinary components evaluate the passed
property values before creationComplete, so that those values can be used in
the component setup.

 

With a swf loaded APP, you must wait until it is complete before setting
properties.  Flashvars are ready by creationComplete.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Richard Rodseth
Sent: Wednesday, March 04, 2009 1:05 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Passing params (flashvars) to sub-applications

 

Well, this is research and I'm trying all possibilities, but I suppose you
could say the goal is to allow team A to embed team B's application in a tab
with the minimum of disruption to either team. Team B's application is
normally embedded in HTML and reads flashvars at startup (i.e. in a creation
complete handler).

I sort of expected SWFLoader to have a way to specify application
parameters.
In my googling, I found the link I referred to (in particular answer 2):

http://stackoverflo
http://stackoverflow.com/questions/407858/passing-flashvars-style-parameter
s-to-a-loaded-swf
w.com/questions/407858/passing-flashvars-style-parameters-to-a-loaded-swf

But  the sample code presented at the above link listens for an application
completed event from the loaded app before setting any parameters, and it
doesn't show how/when the embedded application reads the parameters.

So, while I have a more type-safe technique as presented by Amy, I'm left
wondering if there is a way to make a host application present the same
context to the embedded app that SWFObject does when the host application is
HTML. 

If you have successfully used flashvars *and* read them in a
creationComplete handler I'd love to know how you did it. Presumably you set
the flashvars earlier than the example I linked to above did.

On Tue, Mar 3, 2009 at 6:28 PM, Tracy Spratt tspr...@lariatinc.
mailto:tspr...@lariatinc.com com wrote:

I am confused now, which method are you using?  Are you attempting to pass
values between the fully instantiated components, or are you trying to use
flashvars?

 

I have successfully use both approaches, but the last few posts have been
dealing with using component lifecycle events to trigger directly setting a
property on the loaded component.

 

Using flashvars is the simplest, because the lifecycle events do not come
into play, but is limited because you have to use strings.

 

Exactly what is your goal?

 

Tracy

 

  _  

From: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com] On
Behalf Of Richard Rodseth
Sent: Tuesday, March 03, 2009 8:09 PM


To: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
Subject: Re: [flexcoders] Re: Passing params (flashvars) to sub-applications

 

Yes, that's what Amy's example does, and since I do control both apps, it
seems that's probably the way to go.

Nevertheless, I am curious, because 
a) there must be many apps one would like to embed that do something at
startup that depends on a flashVar
b) the literature on sub apps vs modules says that modules are used when
there is shared code (though a single interface is not much shared code)
c) Tracy said the StackOverflow technique worked for him

So let me pose a question. If one does have such an application and it can't
be modified, is it possible to write a host application that will allow it
to load?

On Tue, Mar 3, 2009 at 4:50 PM, Bjorn Schultheiss bjorn.mailinglists@
mailto:bjorn.mailingli...@gmail.com gmail.com wrote:

The question begs.
Why would you want to use the untyped params object to pass values between
swf applications.

why not just create a setter on the sub application and when its loaded the
set the value on it via the parent application.
use a common interface to get the setter method signature.

Bjorn



--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Tracy Spratt tspr...@... wrote:

 Those traces tell me it should be working, that the embedded app is ready
 when the host app attempts to communicate with it.
 
 
 
 Tracy
 
 
 
 _ 
 
 From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com]
On
 Behalf Of Richard Rodseth
 Sent: Tuesday, March 03, 2009 6:42 PM
 To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com

RE: [flexcoders] Re: Passing params (flashvars) to sub-applications

2009-03-04 Thread Tracy Spratt
Application.application always points at the top-level application, not the
local application.  parentApplication I would expect to work.  How are you
determining it is null?  You might try parentDocument.

 

Tracy

 

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Richard Rodseth
Sent: Wednesday, March 04, 2009 4:11 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Passing params (flashvars) to sub-applications

 

Thanks for the clarification - most helpful. When I use SWFObject in HTML, I
don't append the parameters to the URL, but I guess that's happing under the
hood.

Next experiment: Values of Application.application and parentApplication in
a multi-application application :)

In my latest experiment, I have discarded the quoted code, and just have a
url parameter.
I am setting the SWFLoader source in a creationComplete handler rather than
when the SWFLoader is instantiated.

What I am seeing is that I can access the url parameter within the loaded
app's completion handler using this.parameters[config_id] 
but not
Application.application.parameters[config_id] 

Within the loaded application (which does derive from UIComponent),
parentApplication is null.

So flashvars may be ready by creationComplete, but Application.application
and this.parentApplication are not.

Thanks again for the explanations.

On Wed, Mar 4, 2009 at 12:16 PM, Tracy Spratt tspr...@lariatinc.
mailto:tspr...@lariatinc.com com wrote:

You said, I was also able to pass a parameter in the url, and access it in
the loaded  app's creationComplete.  That *is* using flashvars.  Flashvars
are passed into a swf via url parameters.

 

The example you are quoting, which passes values from one fully instantiated
application to another is not using flashvars.  Maybe the title of that post
is misleading, but it does say flashvar-*style*-parameters., meaning a
dynamic Object.

 

Note also that apps loaded by swfloader do behave differently than ordinary
components, in this regard.  Ordinary components evaluate the passed
property values before creationComplete, so that those values can be used in
the component setup.

 

With a swf loaded APP, you must wait until it is complete before setting
properties.  Flashvars are ready by creationComplete.

 

Tracy

 

  _  

From: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com] On
Behalf Of Richard Rodseth
Sent: Wednesday, March 04, 2009 1:05 AM


To: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
Subject: Re: [flexcoders] Re: Passing params (flashvars) to sub-applications

 

Well, this is research and I'm trying all possibilities, but I suppose you
could say the goal is to allow team A to embed team B's application in a tab
with the minimum of disruption to either team. Team B's application is
normally embedded in HTML and reads flashvars at startup (i.e. in a creation
complete handler).

I sort of expected SWFLoader to have a way to specify application
parameters.
In my googling, I found the link I referred to (in particular answer 2):

http://stackoverflo
http://stackoverflow.com/questions/407858/passing-flashvars-style-parameter
s-to-a-loaded-swf
w.com/questions/407858/passing-flashvars-style-parameters-to-a-loaded-swf

But  the sample code presented at the above link listens for an application
completed event from the loaded app before setting any parameters, and it
doesn't show how/when the embedded application reads the parameters.

So, while I have a more type-safe technique as presented by Amy, I'm left
wondering if there is a way to make a host application present the same
context to the embedded app that SWFObject does when the host application is
HTML. 

If you have successfully used flashvars *and* read them in a
creationComplete handler I'd love to know how you did it. Presumably you set
the flashvars earlier than the example I linked to above did.

On Tue, Mar 3, 2009 at 6:28 PM, Tracy Spratt tspr...@lariatinc.
mailto:tspr...@lariatinc.com com wrote:

I am confused now, which method are you using?  Are you attempting to pass
values between the fully instantiated components, or are you trying to use
flashvars?

 

I have successfully use both approaches, but the last few posts have been
dealing with using component lifecycle events to trigger directly setting a
property on the loaded component.

 

Using flashvars is the simplest, because the lifecycle events do not come
into play, but is limited because you have to use strings.

 

Exactly what is your goal?

 

Tracy

 

  _  

From: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com] On
Behalf Of Richard Rodseth
Sent: Tuesday, March 03, 2009 8:09 PM


To: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
Subject: Re: [flexcoders] Re: Passing params (flashvars) to sub

RE: [flexcoders] Modeless editing

2009-03-04 Thread Tracy Spratt
I do this by having all of my change or click or whatever events call a
single function that updates the model, and also sets a modified flag.  The
flag variable, which is bindable controls the enabled property of my Save
button.  I also can check it if my navigation permits the possibility of
navigating away from a modified component.

 

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Richard Rodseth
Sent: Wednesday, March 04, 2009 4:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Modeless editing

 

Does anyone have any suggestions for (or examples of) forms or other editing
environments where navigation away from the editor is prevented when there
are unsaved changes?











RE: [flexcoders] Re: Modules Communication

2009-03-03 Thread Tracy Spratt
If you don't want to set up a full blown communication manager, you could do
this:

1)   dispatch a *bubbling* event from your source module

2)   Set up a listener at the main application on this
(this.addEventListener.)

3)   Have the handler for that listener re-dispatch the event

4)   In your target module, set a listener on
Application.application.addEventListener

 

However, setting up a singleton data model would be almost as simple.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of thelordsince1984
Sent: Tuesday, March 03, 2009 10:53 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Modules Communication

 

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Simon Bailey si...@... wrote:

 On the tip for communicating between modules using a framework, 
 PureMVC has a utility called Pipes which helps you accomplish this:
 
 http://trac. http://trac.puremvc.org/Utility_AS3_MultiCore_Pipes
puremvc.org/Utility_AS3_MultiCore_Pipes
 
 ;S
 
 On 3 Mar 2009, at 10:10, claudiu ursica wrote:
 
 
  You should probably have ca comunication manager something like a 
  central event dispatcher (I believe the Mate framework already does 
  this but i might be mistaking) and register panels within that 
  scope. so when a panel fires an event the other listening panels 
  check if the event is adressed to them and actually consume catch 
  that event...
 
  there was some guy doing a prof of concept for this google for ALON 
  desing pattern ...
 
  HTH,
  Claudiu
 
  From: thelordsince1984 lore...@...
  To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
  Sent: Tuesday, March 3, 2009 10:53:49 AM
  Subject: [flexcoders] Re: Modules Communication
 
  --- In flexcod...@yahoogro ups.com, Guy Morton guy@ wrote:
  
   Have you read the section Using interfaces for module 
  communication
   in the docs? That's been working for me.
  
 
  thanks for the reply..
 
  For Guy Morton...
 
  i've read it but modules are created at runtime so i would have a
  maneger that controls communication over modules.is it true?
 
  For Alex Harui
 
  how can i achieve the commuication between modules..for example a
  module dispatch an event...the event is catch by a manager and then
  fires to the rigth destination. ..rember that i have an
  application. ..it contains panels and each panel could contain a 
  module...
 
  thanks again
 
  Regards Lorenzo
 
 
 
 
 

thanks all,

but is there a simple manner to achieve module to module communication?

suppose this scenario:

i've a module within a panel. it contains a textinput...it fires a
custom event when the user clicks a button..the event contains an id
number..an other modules is listen for this event, catchs it at then
update itself depending on passed id...

thanks again 
Regards Lorenzo





RE: [flexcoders] adg as adg renderer - sizing the child renderers.

2009-03-03 Thread Tracy Spratt
Set the rowCount = to the number of items in the dataProvider?

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Johannes Nel
Sent: Tuesday, March 03, 2009 9:43 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] adg as adg renderer - sizing the child renderers.

 

Hi All

When using an adg as the renderer for another adg, has anyone got any tipes
on how to size the child renderers so i don't have empty rows.

thanks
-- 
j:pn 
\\no comment





RE: [flexcoders] Re: Modules Communication

2009-03-03 Thread Tracy Spratt
I'm not sure, maybe since modules are independent swf's, but that is way
more complicated than necessary.

 

Look into the singleton data model.  In such a case, you would do:

1.  in the source module, MyModel.getInstance().id = myTextInput.text;
2.  In the target module, text={ MyModel.getInstance().id }
3.  Or use a changeWatcher if you need to take programmatic action when
id changes

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of thelordsince1984
Sent: Tuesday, March 03, 2009 12:30 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Modules Communication

 

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
thelordsince1984 lore...@... wrote:

 --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Simon Bailey simon@ wrote:
 
  On the tip for communicating between modules using a framework, 
  PureMVC has a utility called Pipes which helps you accomplish this:
  
  http://trac. http://trac.puremvc.org/Utility_AS3_MultiCore_Pipes
puremvc.org/Utility_AS3_MultiCore_Pipes
  
  ;S
  
  On 3 Mar 2009, at 10:10, claudiu ursica wrote:
  
  
   You should probably have ca comunication manager something like a 
   central event dispatcher (I believe the Mate framework already
does 
   this but i might be mistaking) and register panels within that 
   scope. so when a panel fires an event the other listening panels 
   check if the event is adressed to them and actually consume catch 
   that event...
  
   there was some guy doing a prof of concept for this google for
ALON 
   desing pattern ...
  
   HTH,
   Claudiu
  
   From: thelordsince1984 loreboa@
   To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
   Sent: Tuesday, March 3, 2009 10:53:49 AM
   Subject: [flexcoders] Re: Modules Communication
  
   --- In flexcod...@yahoogro ups.com, Guy Morton guy@ wrote:
   
Have you read the section Using interfaces for module 
   communication
in the docs? That's been working for me.
   
  
   thanks for the reply..
  
   For Guy Morton...
  
   i've read it but modules are created at runtime so i would have a
   maneger that controls communication over modules.is it true?
  
   For Alex Harui
  
   how can i achieve the commuication between modules..for example a
   module dispatch an event...the event is catch by a manager and then
   fires to the rigth destination. ..rember that i have an
   application. ..it contains panels and each panel could contain a 
   module...
  
   thanks again
  
   Regards Lorenzo
  
  
  
  
  
 
 thanks all,
 
 but is there a simple manner to achieve module to module communication?
 
 suppose this scenario:
 
 i've a module within a panel. it contains a textinput...it fires a
 custom event when the user clicks a button..the event contains an id
 number..an other modules is listen for this event, catchs it at then
 update itself depending on passed id...
 
 thanks again 
 Regards Lorenzo

is it possible to use localconnection among modules or is a bad way to
achieve module to module communication? 





RE: [flexcoders] list control multiple lines?

2009-03-03 Thread Tracy Spratt
Set variableRowHeight=true

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Greg Morphis
Sent: Tuesday, March 03, 2009 1:06 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] list control multiple lines?

 

I'm working on an enhancement for an existing app and currently
there's a list control being populated.
The problem is that if there's too much text entered in the admin
section then it's just running off to the side and being hidden.
I looked at the List properties (this is Flex 2 btw) and nothing stands out.
Will this require a custom item renderer and does anyone have examples if
so?
Also gmail is blocked from the my work laptop and accessing it via
home PC so this is the best I can do for code:

basically it looks like this currently...
mx:VBox width=100% height=100% id=Headlines
mx:Label...
mx:List width=100% id=lstHeadlines
dataProvider={MyModel.getInstance().myHeadlines}
labelfield=headline/
..
/mx:VBox

Any help is appreciated,

Thanks





RE: [flexcoders] adg as adg renderer - sizing the child renderers.

2009-03-03 Thread Tracy Spratt
That (and any item dependent behavior) would have to happen in the
itemRenderer, probably commitProperties.

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Johannes Nel
Sent: Tuesday, March 03, 2009 3:25 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] adg as adg renderer - sizing the child renderers.

 

i cannot determine this at the point where my factory gets created, also the
rows get reused.

On Tue, Mar 3, 2009 at 7:33 PM, Tracy Spratt tspr...@lariatinc.
mailto:tspr...@lariatinc.com com wrote:

Set the rowCount = to the number of items in the dataProvider?

 

  _  

From: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com] On
Behalf Of Johannes Nel
Sent: Tuesday, March 03, 2009 9:43 AM
To: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
Subject: [flexcoders] adg as adg renderer - sizing the child renderers.

 

Hi All

When using an adg as the renderer for another adg, has anyone got any tipes
on how to size the child renderers so i don't have empty rows.

thanks
-- 
j:pn 
\\no comment




-- 
j:pn 
\\no comment





RE: [flexcoders] Re: Error #1034: Type Coercion failed: cannot convert JSON Data

2009-03-03 Thread Tracy Spratt
Is your data in event.result?

Tracy

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of keishalexie
Sent: Tuesday, March 03, 2009 5:29 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Error #1034: Type Coercion failed: cannot convert
JSON Data

 

Here's where it is trying to decode from the project I have

private function getPHPData(event:ResultEvent):void
{
var rawArray:Array;
var rawData:String = String(event.result);
rawArray = JSON.decode(rawData) as Array;
dataArray = new ArrayCollection(rawArray);
}

It's like it is just blocked and the information that is in the tables
from mysql cannot get processed into my flex data tables properly.

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Anggie Bratadinata
anggie.bratadin...@... wrote:

 Have you decoded the JSON data ?
 
 Here's a snippet from a project I'm working on:
 
 public function resultHandler(e:ResultEvent):void{
 var rawString:String = String(e.result);
 var json:* = JSON.decode(rawString);
 var players:Array = json as Array;
 _model.leaders = new ArrayCollection(players);
 }
 
 I use the AC as a dataProvider for some list component.
 
 hth,
 -- 
 Anggie Bratadinata | www.masputih.com | Indonesia
 
 On Tue, Mar 3, 2009 at 7:58 PM, keishalexie keishale...@... wrote:
 
  Hi Everyone,
 
  I am fairly new to Flex and am doing a project using Flex 3, the
  as3corelib, and a PHP file that is sending json data. The json data
  is not being displayed in my data table and what is coming through is
  valid (I checked in the JSON Validator). I really am not sure where
  the problem is: the mxml, php, as3corelib, or what? Any suggestions
  and I will post code if need be.
 
 






RE: [flexcoders] Re: Passing params (flashvars) to sub-applications

2009-03-03 Thread Tracy Spratt
Those traces tell me it should be working, that the embedded app is ready
when the host app attempts to communicate with it.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Richard Rodseth
Sent: Tuesday, March 03, 2009 6:42 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Passing params (flashvars) to sub-applications

 

I just did a quick trace test, and the messages were written to the console
in the following order:

1) SWFLoader load complete (registers listener for app complete)
2) embedded application creation complete handler
3) embedded application app complete handler
4) host app handler for embedded app app complete

So presumably if one is setting parameters in 4) they can't be read in 3)...

Tracy, are you following the recipe here (2nd answer)?

http://stackoverflo
http://stackoverflow.com/questions/407858/passing-flashvars-style-
w.com/questions/407858/passing-flashvars-style-parameters-to-a-loaded-swf

Seems to me this could only work if the loaded app is not accessing the
parameters until some subsequent user gesture.



On Tue, Mar 3, 2009 at 11:53 AM, Richard Rodseth rrods...@gmail.
mailto:rrods...@gmail.com com wrote:

It was on creation complete. 

 

On Tue, Mar 3, 2009 at 11:17 AM, Alex Harui aha...@adobe.
mailto:aha...@adobe.com com wrote:

Not sure when  you tried the code that didn't work, but application is not
available right away

 

Alex Harui

Flex SDK Developer

Adobe Systems Inc. http://www.adobe.com/ 

Blog: http://blogs. http://blogs.adobe.com/aharui adobe.com/aharui

 

From: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com] On
Behalf Of Richard Rodseth
Sent: Tuesday, March 03, 2009 10:47 AM
To: flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com
Subject: Re: [flexcoders] Re: Passing params (flashvars) to sub-applications

 

Thanks for the example, Amy. I was able to do this (on application complete
in the host):

loadedApp = event.target.application as
Application;
loadedApp[configid] = Default;

and see the value in the loaded application. 

public function set configid(id:String):void {
this.config_id = id;
 }


I was also able to pass a parameter in the url, and access it in the loaded
app's creationComplete via

this.parameters[config_id] (not
Application.application.parameters[config_id]

But I have not been able to get this to work:

loadedApp = event.target.application as
Application;
if(!loadedApp) throw new Error();
loadedApp.parameters[config_id] =
Default;

Loaded app's onCreationComplete()

 this.config_id =
Application.application.parameters[config_id];





On Tue, Mar 3, 2009 at 6:35 AM, Amy amyblankenship@
mailto:amyblankens...@bellsouth.net bellsouth.net wrote:

--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Richard Rodseth rrods...@... wrote:

 I'm experimenting with loading sub applications using SWFLoader. I've 
read
 numerous posts about this, but for the life of me can't figure out 
how to
 pass flashvars to the sub application. In particular, the technique
 described here (the second one) doesn't work for me
 
 http://stackoverflo
http://stackoverflow.com/questions/407858/passing-flashvars-style-
w.com/questions/407858/passing-flashvars-style-
parameters-to-a-loaded-swf
 
 Surely there's a definitive way to do this?

Have you thought about just setting up getters and setters on your base 
class and calling those? This doesn't use getters and setters, but a 
getter or setter is just a function, so you can see how it would work:

http://flexdiary.
http://flexdiary.blogspot.com/2009/01/example-of-casting-contets-of-
blogspot.com/2009/01/example-of-casting-contets-of-
swfloader.html

 

 

 





RE: [flexcoders] Re: Passing params (flashvars) to sub-applications

2009-03-03 Thread Tracy Spratt
I am confused now, which method are you using?  Are you attempting to pass
values between the fully instantiated components, or are you trying to use
flashvars?

 

I have successfully use both approaches, but the last few posts have been
dealing with using component lifecycle events to trigger directly setting a
property on the loaded component.

 

Using flashvars is the simplest, because the lifecycle events do not come
into play, but is limited because you have to use strings.

 

Exactly what is your goal?

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Richard Rodseth
Sent: Tuesday, March 03, 2009 8:09 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Passing params (flashvars) to sub-applications

 

Yes, that's what Amy's example does, and since I do control both apps, it
seems that's probably the way to go.

Nevertheless, I am curious, because 
a) there must be many apps one would like to embed that do something at
startup that depends on a flashVar
b) the literature on sub apps vs modules says that modules are used when
there is shared code (though a single interface is not much shared code)
c) Tracy said the StackOverflow technique worked for him

So let me pose a question. If one does have such an application and it can't
be modified, is it possible to write a host application that will allow it
to load?

On Tue, Mar 3, 2009 at 4:50 PM, Bjorn Schultheiss bjorn.mailinglists@
mailto:bjorn.mailingli...@gmail.com gmail.com wrote:

The question begs.
Why would you want to use the untyped params object to pass values between
swf applications.

why not just create a setter on the sub application and when its loaded the
set the value on it via the parent application.
use a common interface to get the setter method signature.

Bjorn



--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Tracy Spratt tspr...@... wrote:

 Those traces tell me it should be working, that the embedded app is ready
 when the host app attempts to communicate with it.
 
 
 
 Tracy
 
 
 
 _ 
 
 From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com]
On
 Behalf Of Richard Rodseth
 Sent: Tuesday, March 03, 2009 6:42 PM
 To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
 Subject: Re: [flexcoders] Re: Passing params (flashvars) to
sub-applications
 
 
 
 I just did a quick trace test, and the messages were written to the
console
 in the following order:
 
 1) SWFLoader load complete (registers listener for app complete)
 2) embedded application creation complete handler
 3) embedded application app complete handler
 4) host app handler for embedded app app complete
 
 So presumably if one is setting parameters in 4) they can't be read in
3)...
 
 Tracy, are you following the recipe here (2nd answer)?
 
 http://stackoverflo
 http://stackoverflo
http://stackoverflow.com/questions/407858/passing-flashvars-style-
w.com/questions/407858/passing-flashvars-style-
 w.com/questions/
http://w.com/questions/407858/passing-flashvars-style-parameters-to-a-loade
d-swf 407858/passing-flashvars-style-parameters-to-a-loaded-swf
 
 Seems to me this could only work if the loaded app is not accessing the
 parameters until some subsequent user gesture.
 
 
 
 On Tue, Mar 3, 2009 at 11:53 AM, Richard Rodseth rrods...@gmail.

 mailto:rrods...@... com wrote:
 
 It was on creation complete. 
 
 
 
 On Tue, Mar 3, 2009 at 11:17 AM, Alex Harui aha...@adobe.

 mailto:aha...@... com wrote:
 
 Not sure when you tried the code that didn't work, but application is not
 available right away
 
 
 
 Alex Harui
 
 Flex SDK Developer
 

 Adobe Systems Inc. http://www.adobe. http://www.adobe.com/ com/ 
 

 Blog: http://blogs. http://blogs. http://blogs.adobe.com/aharui
adobe.com/aharui adobe.com/aharui
 
 
 
 From: flexcod...@yahoogro mailto:flexcod...@yahoogro
mailto:flexcoders%40yahoogroups.com ups.com ups.com
 [mailto:flexcod...@yahoogro mailto:flexcod...@yahoogro
mailto:flexcoders%40yahoogroups.com ups.com ups.com] On


 Behalf Of Richard Rodseth
 Sent: Tuesday, March 03, 2009 10:47 AM

 To: flexcod...@yahoogro mailto:flexcod...@yahoogro
mailto:flexcoders%40yahoogroups.com ups.com ups.com


 Subject: Re: [flexcoders] Re: Passing params (flashvars) to
sub-applications
 
 
 
 Thanks for the example, Amy. I was able to do this (on application
complete
 in the host):
 
 loadedApp = event.target.application as
 Application;
 loadedApp[configid] = Default;
 
 and see the value in the loaded application. 
 
 public function set configid(id:String):void {
 this.config_id = id;
 }
 
 
 I was also able to pass a parameter in the url, and access it in the
loaded
 app's creationComplete via
 
 this.parameters[config_id] (not
 Application.application.parameters[config_id]
 
 But I have not been able to get this to work:
 
 loadedApp = event.target.application as
 Application

RE: [flexcoders] Re: Error #1034: Type Coercion failed: cannot convert JSON Data

2009-03-03 Thread Tracy Spratt
Then if you trace the length of rawArray, what do you get?

 

I do not know JSON, but there are techniques to figure out exactly where a
problem lies.

 

 

Tracy

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Keisha Lexie
Sent: Tuesday, March 03, 2009 11:08 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Error #1034: Type Coercion failed: cannot
convert JSON Data

 

Yes,  I have it like this:

private function updatedPHPDataResult(event:ResultEvent):void
 {
   lblStatus.text = String(event.result);
 }
   
--Keisha

 

  _  

From: Tracy Spratt tspr...@lariatinc.com
To: flexcoders@yahoogroups.com
Sent: Tuesday, March 3, 2009 5:33:05 PM
Subject: RE: [flexcoders] Re: Error #1034: Type Coercion failed: cannot
convert JSON Data

Is your data in event.result?

Tracy

  _  

From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On
Behalf Of keishalexie
Sent: Tuesday, March 03, 2009 5:29 PM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] Re: Error #1034: Type Coercion failed: cannot convert
JSON Data

 

Here's where it is trying to decode from the project I have

private function getPHPData(event: ResultEvent) :void
{
var rawArray:Array;
var rawData:String = String(event. result);
rawArray = JSON.decode( rawData) as Array;
dataArray = new ArrayCollection( rawArray) ;
}

It's like it is just blocked and the information that is in the tables
from mysql cannot get processed into my flex data tables properly.

--- In flexcod...@yahoogro ups.com mailto:flexcoders%40yahoogroups.com ,
Anggie Bratadinata
anggie.bratadinata @... wrote:

 Have you decoded the JSON data ?
 
 Here's a snippet from a project I'm working on:
 
 public function resultHandler( e:ResultEvent) :void{
 var rawString:String = String(e.result) ;
 var json:* = JSON.decode( rawString) ;
 var players:Array = json as Array;
 _model.leaders = new ArrayCollection( players);
 }
 
 I use the AC as a dataProvider for some list component.
 
 hth,
 -- 
 Anggie Bratadinata | www.masputih. com | Indonesia
 
 On Tue, Mar 3, 2009 at 7:58 PM, keishalexie keishalexie@ ... wrote:
 
  Hi Everyone,
 
  I am fairly new to Flex and am doing a project using Flex 3, the
  as3corelib, and a PHP file that is sending json data. The json data
  is not being displayed in my data table and what is coming through is
  valid (I checked in the JSON Validator). I really am not sure where
  the problem is: the mxml, php, as3corelib, or what? Any suggestions
  and I will post code if need be.
 
 


 





RE: [flexcoders] Restricting characters in User input controls

2009-03-03 Thread Tracy Spratt
The problem is the quote is causing the msml compile problems.

 

Try using an entity string like quot;

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of kotha poornima
Sent: Tuesday, March 03, 2009 11:59 PM
To: flexcoders
Subject: Fw: [flexcoders] Restricting characters in User input controls

 

 

Hi All,
Can anyone give me an idea how i can solve this.

Thanks in Advance,
Poornima

- Forwarded Message 
From: kotha poornima poorni_ag...@yahoo.com
To: flexcoders flexcoders@yahoogroups.com
Sent: Tuesday, March 3, 2009 5:20:18 PM
Subject: [flexcoders] Restricting characters in User input controls

Hi,
I want to exclude single quotes and double quotes in the user input
So i coded the statement like this: 
mx:TextArea id=txtInput restrict=^'\ /

But iam getting error like this:(Iam not able to exclude double quotes)
Element type mx:TextArea must be followed by either attribute
specifications,  or /

Can anyone help me out of this.

Thanks in Advance,
Poornima

 

 





RE: [flexcoders] Re: Sending POST requests to php script??Help

2009-03-02 Thread Tracy Spratt
You can, but you have to use Actionscript, not declarative mxml.  Build the
request object in an AS function, something like this:

var oRequest:Object = {first:modelName.name.first, last:modelName.name.last,
email:modelName.name.email}

srv2.send(oRequest);

 

and remove the entire mx:request/ tag.

 

This approach is generally easier to work with because you can debug the
values you are sending to the server.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of fprihoda
Sent: Monday, March 02, 2009 7:27 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Sending POST requests to php script??Help

 

I don't want to bind the object. The {...} was suggested in a
previous post. I don't understand why I can't reference the object's
value in the HTTPService request.

Frank
--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Tracy Spratt tspr...@... wrote:

 But you are using Object, and Object is not bindable and you are
trying to
 bind:
 
 first{modelName.name.first}/first
 
 The braces mean binding.
 
 Tracy
 
 
 
 _ 
 
 From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
[mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com]
On
 Behalf Of fprihoda
 Sent: Sunday, March 01, 2009 7:09 PM
 To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
 Subject: [flexcoders] Re: Sending POST requests to php script??Help
 
 
 
 I CAN access the flex object at run-time. And it need not be bindable.
 For example:
 
 Alert.show(modelName.name.first,title=modelName.name.first Value);
 
 Correctly displays the modelName.name.first value. However, when I
 access the same object in the HTTPService request, I can not access
 the objects value. I don't know what the problem is.
 
 This problem is driving me nuts.
 
 Frank






RE: [flexcoders] Passing params (flashvars) to sub-applications

2009-03-02 Thread Tracy Spratt
This works fine for me, perhaps you are doing something wrong?

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Richard Rodseth
Sent: Monday, March 02, 2009 7:34 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Passing params (flashvars) to sub-applications

 

I'm experimenting with loading sub applications using SWFLoader. I've read
numerous posts about this, but for the life of me can't figure out how to
pass flashvars to the sub application. In particular, the technique
described here (the second one) doesn't work for me

http://stackoverflo
http://stackoverflow.com/questions/407858/passing-flashvars-style-parameter
s-to-a-loaded-swf
w.com/questions/407858/passing-flashvars-style-parameters-to-a-loaded-swf

Surely there's a definitive way to do this?

Thanks.





RE: [flexcoders] How to set VBox width to a %age in actionscript

2009-03-01 Thread Tracy Spratt
percentWidth = 100;

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of elevight
Sent: Sunday, March 01, 2009 12:37 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to set VBox width to a %age in actionscript

 

This is actually my second time to post this question. No one replied 
before, so maybe it got lost in the shuffle.

In MXML, I'd set the VBox width to 100% like this:

mx:VBox width=100%/

But in actionscript:

var vbox:VBox = new VBox();
vbox.width = 100%;

The above won't work because the compiler will flag an error 
on 100%. Does anyone know how I can set a VBox's width as a 
percentage in actionscript?

Thanks.





RE: [flexcoders] redundancy in custom ItemRenderer

2009-03-01 Thread Tracy Spratt
Why do you think the renderer's commitProperties is being called more than
once for a single item?  Your trace statements do not identify the item.
You understand that there is no direct relationship between the number of
items and the number of renderer instances?  The number of instances depends
on the number of visible rows, plus a few for buffering.

 

And are you just curious?  The specific renderer instantiation behavior is
normally not of concern to a developer, but  such concern sometimes
indicates misuse.

 

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexrookie
Sent: Saturday, February 28, 2009 9:35 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] redundancy in custom ItemRenderer

 

another question about ItemRenderers, using my previous stock example.

i have noticed that my custom item renderer seems to be performing
redundant executions. for a single dataProvider item, i see two
renderer instances created. and for each instance, set data and
commitProperties() are called repeatedly. 

here's my code:

StockApp.mxml
===
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml
layout=absolute
applicationComplete=applicationCompleteListener(event)
mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.HorizontalList;
import mx.events.FlexEvent;
import mx.core.ClassFactory;

protected var list:HorizontalList;
protected var provider:ArrayCollection;

protected function applicationCompleteListener (e:FlexEvent):void {
// Provider
provider = new ArrayCollection();
provider.addItem({stockInfo:new StockInfo()});

// UI
list = new HorizontalList();
list.width = 400;
list.height = 100;
list.dataProvider = provider;
list.itemRenderer = new ClassFactory(StockInfoRenderer);

addChild(list);
} 
]]
/mx:Script
/mx:Application
===

StockInfoRenderer.as
===
package {
import mx.containers.Canvas;
import mx.controls.Button;

public class StockInfoRenderer extends Canvas {
protected var button:Button;

public function StockInfoRenderer () {
trace(StockInfoRenderer CONSTRUCTOR CALLED.);
}

override protected function createChildren ():void {
trace(StockInfoRenderer CREATE CHILDREN CALLED.);
super.createChildren();

if (button == null) {
button = new Button();
button.width = 100;
}
addChild(button);
}

override protected function commitProperties ():void {
trace(StockInfoRenderer COMMIT PROPERTIES CALLED.);
super.commitProperties();

button.label = data.stockInfo.getPrice();
}

override public function set data (value:Object):void {
trace(StockInfoRenderer SET DATA CALLED.);
super.data = value;
invalidateProperties()
}
}
}
===

OUTPUT:
===
StockInfoRenderer CONSTRUCTOR CALLED.
StockInfoRenderer CREATE CHILDREN CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.

StockInfoRenderer CONSTRUCTOR CALLED.
StockInfoRenderer SET DATA CALLED.
StockInfoRenderer CREATE CHILDREN CALLED.
StockInfoRenderer COMMIT PROPERTIES CALLED.
===

is the preceding redundancy typical, or am i doing something wrong?

~flashrookie





RE: [flexcoders] Re: Sending POST requests to php script??Help

2009-03-01 Thread Tracy Spratt
Yes, building the request object declaratively and binding in the values is
very hard to debug.

Build the request object in AS, so you can inspect the values you are
sending.  You also will not need to depend on bindable properties.

Tracy

-Original Message-
From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim Hayes
Sent: Sunday, March 01, 2009 1:51 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Sending POST requests to php script??Help

Well, I believe the syntax is correct, at least!
The warnings are telling you something, in a way, which is that unless your
objects properties are bindable flex won't be able to detect changes in them
at runtime.
Hence it won't work if as you might expect you want to specify the request
in mxml like that. 
It's just the way flex works, I found it a little hard to get used to at
first.
You might have better results if you call an actionscript function to set
the request object instead.


-Original Message-
From: flexcoders@yahoogroups.com on behalf of fprihoda
Sent: Sun 01/03/2009 12:51
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Sending POST requests to php script??Help
 
This doe not work, as I am not trying to make the object bindable.  I
am simply trying to reference the object values and pass them as part
of the HTTPService request.

--- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote:

 I'm making a wild guess here, but does this work?
 
 mx:request xmlns=
 first{modelName.name.first}/first
 last{modelName.name.last}/last
 email{modelName.email}/email
 /mx:request
 
 Apologies if not, I've not made any attempt to see if it does so it
could be utter rubbish.
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com on behalf of fprihoda
 Sent: Sat 28/02/2009 19:09
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Sending POST requests to php script??Help
  
 The following code is not working as I would expect it to.
 
 mx:HTTPService id=srv2 url=http://localhost/flex_web/addform.php;
 resultFormat=object showBusyCursor=true
 result=resultHandler(event) method=POST
 mx:request xmlns=
 firstmodelName.name.first/first
 lastmodelName.name.last/last
 emailmodelName.email/email
 /mx:request
 /mx:HTTPService
 
 modelName is an object. I would like to send the POST variables to the
 php script using dot notation as shown above. The problem I am having
 is that it sends the entire string modelName.xxx.xxx instead of the
 actual object field.  I think this is a dereferencing issue, but I do
 not know how to fix it.
 
 Can someone help?
 
 
 
 __
 This communication is from Primal Pictures Ltd., a company
registered in England and Wales with registration No. 02622298 and
registered office: 4th Floor, Tennyson House, 159-165 Great Portland
Street, London, W1W 5PA, UK. VAT registration No. 648874577.
 
 This e-mail is confidential and may be privileged. It may be read,
copied and used only by the intended recipient. If you have received
it in error, please contact the sender immediately by return e-mail or
by telephoning +44(0)20 7637 1010. Please then delete the e-mail and
do not disclose its contents to any person.
 This email has been scanned for Primal Pictures by the MessageLabs
Email Security System.
 __




__
This communication is from Primal Pictures Ltd., a company registered in
England and Wales with registration No. 02622298 and registered office: 4th
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK.
VAT registration No. 648874577.


This e-mail is confidential and may be privileged. It may be read, copied
and used only by the intended recipient. If you have received it in error,
please contact the sender immediately by return e-mail or by telephoning
+44(0)20 7637 1010. Please then delete the e-mail and do not disclose its
contents to any person.
This email has been scanned for Primal Pictures by the MessageLabs Email
Security System.
__



RE: [flexcoders] updating an item renderer

2009-03-01 Thread Tracy Spratt
The core concepts are that item renderers need to update their visual UI
elements when the associated item changes, and need to update that item on
user interaction.

 

You assign a dataProvider(StockInfo) to the List, which results in item
renderers being instantiated.  Note, do not use an Array as a dataProvider,
use ArrayCollection.

 

When the underlying item changes, the framework calls the renderer's set
data method(setter).  When any pending changes are done, the framework calls
commitProperties.

 

You need to use this mechanism because there is no assurance that there will
be an instance of any particular renderer to listen of an event.  Renderers
are recycled. Google that before you go any further.

 

Tracy

 

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexrookie
Sent: Saturday, February 28, 2009 8:59 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] updating an item renderer

 

hi list, first post...

i have an architectural question about datatproviders and
itemrenderers that i'll pose with a canonical example.

suppose i have an array of StockInfo objects that is populated by a
3rd party library. each StockInfo object dispatches UPDATE events when
a stock price changes. i want to render the prices in HorizontalList
with a custom renderer.

here's the general application shell:

=
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml
com/2006/mxml
layout=absolute
applicationComplete=applicationCompleteListener(event)
mx:Script
![CDATA[
import mx.controls.HorizontalList;
import mx.events.FlexEvent;
import mx.core.ClassFactory;

protected var list:HorizontalList;
protected var stocks:Array;

protected function applicationCompleteListener (e:FlexEvent):void {
// Stock data (hardcoded for the example)
stocks = [new StockInfo()];

// UI
list = new HorizontalList();
list.width = 400;
list.height = 100;
list.itemRenderer = new ClassFactory(StockInfoRenderer);
addChild(list);
} 
]]
/mx:Script
/mx:Application
=

i need to wire the stocks array to the list. of course, given that i
already have an array of StockInfo objects, it's tempting to make an
ArrayCollection wrapper that gives direct access to the StockInfo
objects. e.g.,

provider = new ArrayCollection();
provider.addItem({stockInfo:someStockInfoObject});

then the StockInfoRenderer could register for UPDATE events and redraw
when the event occurs. but i'm hesitant about that approach. if i went
that route,

1) within the StockInfoRenderer, where would i register for the UPDATE
event? in commitProperties()?
2) within the StockInfoRenderer, where would i *remove* the UPDATE
listener?
3) given that renderers are reused, are there issues with synching, or
with stranded listeners causing memory build-up?

more generally, what's the right way to wire my list to the stocks
array? it feels like i might be forced to handle UPDATE for each
StockInfo object, and write a 'price' variable into a data provider.
e.g., 

provider.getItemAt(i).price = value;
provider.itemUpdated(provider.getItemAt(i), price);

seems a shame, given that i already have an array of StockInfo
objects. the above two lines presuppose that i'm going to hunt for the
item index every time a stock price changes. : (

another general question, do i even need the itemUpdate() call, or is
that part automated?

thanks for any advice!

flexrookie





RE: [flexcoders] Re: Sending POST requests to php script??Help

2009-03-01 Thread Tracy Spratt
But you are using Object, and Object is not bindable and you are trying to
bind:

first{modelName.name.first}/first

The braces mean binding.

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of fprihoda
Sent: Sunday, March 01, 2009 7:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Sending POST requests to php script??Help

 

I CAN access the flex object at run-time. And it need not be bindable.
For example:

Alert.show(modelName.name.first,title=modelName.name.first Value);

Correctly displays the modelName.name.first value. However, when I
access the same object in the HTTPService request, I can not access
the objects value. I don't know what the problem is.

This problem is driving me nuts.

Frank





RE: [flexcoders] Re: XML Parsing - maintaining a record pointer

2009-02-24 Thread Tracy Spratt
Both XMLList and XMLListCollection can be accessed by index.
 
Tracy



From: flexcoders@yahoogroups.com on behalf of Libby
Sent: Tue 2/24/2009 10:07 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: XML Parsing - maintaining a record pointer



well, this is a sequential file, output from a mainframe and basically
I need to start at the top and work my way to the bottom, with
frequent look-aheads. I have been trying hard to use e4x but so far
have not been successful with getting it to work. apparently there is
something about the syntax I am not getting. That cursor idea
another poster mentioned sounds intriguing...

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , 
Tracy Spratt tspr...@... wrote:

 I would suggest that you do not think in terms of reading the file.
 Rather, use e4x to find the node you want to process, then go from
 there.
 
 
 
 OTOH, it is acceptable to manipulate an XMLList, especially if your data
 is a single level.
 
 
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com  
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On
 Behalf Of Sam Lai
 Sent: Friday, February 20, 2009 4:12 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: Re: [flexcoders] XML Parsing - maintaining a record pointer
 
 
 
 You could use a different variable name in the inner loop, that way it
 won't change the object in the outer loop.
 
 On 2/21/09, Libby libbychan...@...
 mailto:libbychantel%40yahoo.com  wrote:
  hi, flexCoders!
  thanks for all ur help in the past!
 
  Does Flex maintain your record pointer while reading an xml file?
  basically what i want to do is read each line and when I hit certain
  values, read on for 4 or 5 records, then return to the original
  process without starting back at the last record read at the first
  read. I can do this the hard way of course by maintaining my own
  pointer and treating the file as a giant array, but surely there is an
  easier way?
 
 
  for each (var xmlNode:XML in xml.children()) {
  // do stuff
  // if(xmlNode.something==aValue) {
  for each (var xmlNode:XML  read on into the file
 
  thanks,
  Libby
 
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
  http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt  
  Alternative FAQ location:
 
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf- 
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf- 
 1e62079f6847
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf 
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf 
 -1e62079f6847 
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo 
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo  ! Groups
 Links
 
 
 
 





winmail.dat

RE: [flexcoders] Re: Accordion question - height minus header space

2009-02-24 Thread Tracy Spratt
Yes, most all layout containers have default padding.
 
Tracy



From: flexcoders@yahoogroups.com on behalf of lanekelly5
Sent: Tue 2/24/2009 9:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Accordion question - height minus header space



I think I have it close using:

accordion.height - (accordion.numChildren * accordion_header_height)

What I'm finding though is that the calculation comes in roughly 3 
pixels too short. If I use the result of the above for my TileList 
hight (the element that I'm placing in the accordion container) I 
still get some wasted space at the bottom. For the moment I'm just 
adding in a fudge constant of 3 pixels to make it look right. 
Could this discrepancy be the result of padding somewhere?

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , 
alinmircea_s alinmirce...@... 
wrote:

 child's height or width can be specified percent wise
 width=100%
 myComponent.percentWidth = 100;
 
 but if you have to you have to
 
 
http://livedocs.adobe.com/flex/3/langref/mx/containers/Accordion.html 
http://livedocs.adobe.com/flex/3/langref/mx/containers/Accordion.html 
 
 quote : headerHeight=depends on header font styles =
 Number(myAccordion.getStyle('headerHeight'))





winmail.dat

RE: [flexcoders] appending a record to xml file

2009-02-24 Thread Tracy Spratt
What server platform and language are you using to read/write on the server 
file system?



From: flexcoders@yahoogroups.com on behalf of naresh ch
Sent: Tue 2/24/2009 9:33 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] appending a record to xml file



how to append a recored to external xml file
suppose i have 2 or 3 text inputs at user end and i want them to append to an 
existing external XML file
Please share any example if you have or guide me to solve my problem
Thanks in advance

naresh  



Add more friends to your messenger and enjoy! Invite them now. 
http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/
  


winmail.dat

RE: [flexcoders] NavBar - setTargetViewStack

2009-02-24 Thread Tracy Spratt
Consider binding the dataProvider instead of assigning it.
 
Tracy



From: flexcoders@yahoogroups.com on behalf of mikeycmccarthy
Sent: Tue 2/24/2009 4:46 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] NavBar - setTargetViewStack



Hi there,

I've written a code behind that manages a ViewStack and a TabBar (it's almost 
like a 
PureMVC mediator without actually being a mediator). The ViewStack is the 
dataprovider of 
the TabBar.

When I try to test this I get the problem that the dataprovider is always null. 
I've attached 
the Flex source code and put it in debug mode and I've noticed it jumps to the 
setTargetViewStack method of NavBar:

private function setTargetViewStack(
newStack:Object /* can be String or ViewStack */):void
{
// If this property is set at creation time, the target view stack
// may not exist yet. In this case, we just save off the requested
// target stack and set it later.
if (!measurementHasBeenCalled  newStack)
{
pendingTargetStack = newStack;
invalidateProperties();
}
else
{
_setTargetViewStack(newStack);
}
}

Measurement hasn't been called so my dataProvider is null (well, pending). Is 
there any 
way to force this? It's making it really really difficult to do a test!

Thanks in advance!




winmail.dat

RE: [flexcoders] combo box help

2009-02-24 Thread Tracy Spratt
Have a change handler on the ComboBox get the key value form the selectedItem 
and invoke an RPC call (protocol of you choice) aganst the server platform, 
passing in the key value.  Have the backend query the database using the key, 
and return the value to Flex via a result handler.  Have that handler set an 
instance variable to which you have bound the Tree.  Voila!
 
Tracy



From: flexcoders@yahoogroups.com on behalf of manne praneeth
Sent: Sat 2/21/2009 3:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] combo box help



hi this is praneeth here!
when i select one item in combo box it should interact with data base 
and get the the data so that it should generate dynamic tree in new states 
.This is my requirement 
So plz help me out in solving bzc iam new in flex
 
 
 
 Thankyou.



winmail.dat

[flexcoders] Re: property editor component

2009-02-24 Thread Tracy Spratt
I don't know of a component, but i implemented a property editor 
several years ago.  the core is the input item REnderer.  Here is the 
code, maybe it will help

Tracy

mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; xmlns=* 
width=100% 
horizontalAlign=right verticalAlign=middle 
mx:Script![CDATA[
  import mx.core.IFlexDisplayObject;
  import mx.core.UIComponent;
  import mx.collections.XMLListCollection;
  import mx.collections.ArrayCollection;
  import mx.managers.PopUpManager;
  import components.RTEPopUp;
  import components.TAPopUp;

  [Bindable]private var _xmlAttribute:XML;
  private var _xmlComponentDef:XML;
  [Bindable]private var _xlOptions:XMLList;
  [Bindable]private var _iOptionItemIndex:int;
  private var _popUpRTE:RTEPopUp;
  private var _popUpTA:TAPopUp;
  

  override public function set data(value:Object) : void
  {
//trace(IRPropertyInput.set data);
super.data = value;
_xmlAttribute = XML(value)
_xmlComponentDef = _xmlAttribute.parent();
var sControlType:String = _xmlattribu...@inputtype;
try  {
currentState = sControlType;
}
catch (error:Error)  {
currentState = TextInput;
}
if (sControlType == ComboBox)  {
  _xlOptions = _xmlAttribute.option; 
  selectOptionItem();
}  
  }//
  

  private function selectOptionItem():void
  {
var xmlOption:XML;
var sValue:String = _xmlattribu...@value;
for (var i:int=0; i_xlOptions.length();i++)  {
  xmlOption = _xlOptions[i];
  if (xmlopti...@value == sValue)  {
_iOptionItemIndex = i;
break;
  }
}
  }//
  
 
  private function showRTE():void
  {
var iX:int = int(getAttrValue(x));
var iY:int = int(getAttrValue(y));
iY = (iY  30) ?  iY-30:0 ;
var iWidth:int = int(getAttrValue(width));
iWidth = (iWidth  400)  ?  iWidth:400;
var iHeight:int = int(getAttrValue(height)) + 30;
iHeight = (iHeight  300)  ?  iHeight:300 ;
_popUpRTE = RTEPopUp(PopUpManager.createPopUp(this, RTEPopUp, 
true));   
_popUpRTE.x=iX;
_popUpRTE.y=iY; 
_popUpRTE.width=iWidth;
_popUpRTE.height=iHeight; 
_popUpRTE.htmlText = _xmlattribu...@value;
_popUpRTE.addEventListener(closeRTE,onCloseRTE);
  }//
  
  private function onCloseRTE(oEvent:Event):void
  {
if(oEvent.target.closeMode == ok) {
  _xmlattribu...@value = oEvent.target.htmlText;
}
PopUpManager.removePopUp(_popUpRTE);
  }//
  
  private function showTA():void
  {
_popUpTA = TAPopUp(PopUpManager.createPopUp(this, TAPopUp, true));
_popUpTA.text = _xmlattribu...@value;
_popUpTA.addEventListener(closeTA,onCloseTA);
//PopUpManager.centerPopUp(_popUpTA);
_popUpTA.x=100;
_popUpTA.y=100;
  }//
  
  private function onCloseTA(oEvent:Event):void
  {
if(oEvent.target.closeMode == ok) {
  _xmlattribu...@value = oEvent.target.text;
}
PopUpManager.removePopUp(_popUpTA);
  }//
  
  /**  */
  private function getAttrValue(sName:String):String
  {
var sReturn:String = ;
var xmlAttrNode:XML = _xmlComponentDef.*.(@name==sName)[0];
if (xmlAttrNode) {
  sReturn = xmlAttrNode.attribute(value);
}
return sReturn;
  }//getAttrValue
  
  private function setupColorPicker():void
  {
trace(setupColorPicker:  + _xmlattribu...@value);
cp.selectedcolor=_xmlattribu...@value
  } //setupColorPicker
  
  private function clearColor():void
  {
_xmlattribu...@value = ;
  }//
   
]]/mx:Script

mx:states
mx:State name=CheckBox
mx:AddChild 
   mx:CheckBox id=cbx label=   
  
creationComplete=cbx.selected=_xmlattribu...@value 
  change=_xmlattribu...@value = cbx.selected;
  / 
/mx:AddChild
/mx:State 
mx:State name=TA
mx:AddChild
mx:Button id=ta label=... height=22 width=22
click=showTA()/mx:Button
/mx:AddChild
/mx:State
mx:State name=RTE  
mx:AddChild
  mx:HBox width=100% verticalAlign=middle 
horizontalAlign=right horizontalGap=2
mx:Label text={XML(_xmlAttribute)@value} 
  color=#99 
  truncateToFit=true fontSize=8 
width={this.width-35} /
mx:Button id=rte label=... height=22 width=22
toolTip=Edit htmlText with tich text editor
click=showRTE() /
  /mx:HBox
/mx:AddChild
/mx:State
mx:State name=ComboBox
mx:AddChild
mx:ComboBox id=cbo dataProvider={_xlOptions} 
selectedIndex={_iOptionItemIndex}
labelField=@value
change=_xmlattribu...@value = cbo.selectedLabel
width=100% /
/mx:AddChild
/mx:State   
mx:State name=TextInput
mx:AddChild
mx:TextInput 

[flexcoders] Re: property editor component

2009-02-24 Thread Tracy Spratt
Where will the dataProvider come from?

--- In flexcoders@yahoogroups.com, Sefi Ninio sefi.ni...@... wrote:

 Okay, how about this:
 When defining a combo box as an itemEditor, and specifying the
 editorDataField - How can I specify the combo box dataProvider?
 I can use the model to bind a dp to the combobox, but I'd like to 
create a
 generic component that does not have dependencies on external 
models...
 
 
 
 On Sun, Feb 22, 2009 at 1:54 PM, Sefi Ninio sefi.ni...@... wrote:
 
  Hi all.
 
  I'm looking for a property editor component (or something similar 
to the
  description below):
  What I need is a table (DG) based name-value pairs editor, where 
the value
  should be displayed as a label.
  When it gets focus, it should be editable according to the value 
defined
  type (text, stepper, combo box etc.)
 
  Sure, I can implement components (as item editors for the DG) 
with two
  states for text/combo box, text/stepper, text/text editor etc.
  I was wondering if there is a component that already has this
  functionality.
 
  Anyone has any ideas?
 
  Thanks
 





RE: [flexcoders] Re: ToggleButtonBar xml based dataProvider

2009-02-21 Thread Tracy Spratt
If floortasks is a component, then this makes no sense:

taskList = XMLList(resultXML.floortasks);

 

You need to use the xml data for the dataProvider not the component.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markgoldin_2000
Sent: Saturday, February 21, 2009 6:23 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: ToggleButtonBar xml based dataProvider

 

No, can't get it work:
taskList = XMLList(resultXML.floortasks);
floorTasks.dataProvider = taskList;

floorTasks is my ToggleButtonBar. I am getting:
The dataProvider of 'floorTasks' must not contain objects of type 
flash.display.DisplayObject.
With XMLListCollection I am getting:
taskList = XMLListCollection(resultXML.floortasks);
floorTasks.dataProvider = taskList;
Type Coercion failed: cannot convert xmll...@52e5901 to 
mx.collections.XMLListCollection

This works without errors:
taskList = Array([resultXML.floortasks]);
floorTasks.dataProvider = taskList;

But I am getting just one button with no text.

My data is this:
labelBOXING/label
labelCUTTING/label
labelGENERAL LABOR/label
labelMACHINE OPERATORS/label
labelPACKING/label
labelQUILTING/label
labelSEWING/label
labelSILO FILLERS/label

Thanks for help.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:

 Certainly. Why would you think not?
 
 
 
 Though to speak accurately, you would use XMLList or 
XMLListCollection
 as the dataProvider.
 
 
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of markgoldin_2000
 Sent: Friday, February 20, 2009 3:46 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] ToggleButtonBar xml based dataProvider
 
 
 
 Is that possible?
 
 Thanks






[flexcoders] Positioning logic for pop-up?

2009-02-21 Thread Tracy Spratt
I need to constain a popup to stay with the application boundries.

I will certainly be able to grind this logic out, but am wondering if
anyone might have done it already.

Hmm, if I can find a standard component that does this, that would also
be a place to look.


Tracy Spratt
Lariat Services

Flex development bandwidth available




RE: [flexcoders] Problem accessing data of an XML file

2009-02-20 Thread Tracy Spratt
But first, do not use mx:Model, it will not work with e4x expressions.
Instead, use mx:XML.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Paul Andrews
Sent: Friday, February 20, 2009 6:34 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Problem accessing data of an XML file

 


- Original Message - 
From: christophe_jacquelin christophe_jacque...@yahoo.fr
mailto:christophe_jacquelin%40yahoo.fr 
To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
Sent: Friday, February 20, 2009 11:01 AM
Subject: [flexcoders] Problem accessing data of an XML file

 Hello,

 I have an XML file with points inside :

 root
 Point
 x0343/x0
 y0350/y0
 x1343/x1
 y1359/y1
 /Point
 Point
 x0344/x0
 y0349/y0
 x1344/x1
 y1359/y1
 /Point
 /root

 I use these instructions :

 mx:Model id=pointModel source=Data/Pts.xml/
 mx:ArrayCollection id=EIMPoints source={pointModel.Point}/

 How to access to the point values in an actionscript function to draw
 the points ?

This should help: 
http://www.trilemetry.com/clients/f3gse/partIII/partIIIa/workingWithData
_e4x.cfm#
http://www.trilemetry.com/clients/f3gse/partIII/partIIIa/workingWithDat
a_e4x.cfm 

Truly speaking your XML doesn't describe points, it describes point
pairs, 
possibly line segments..

Paul

 Thank you,
 Christophe, 





RE: [flexcoders] Running Flex from HTA

2009-02-20 Thread Tracy Spratt
Generate the wrapper withut the history management.  It is a checkbox on
the Project, Compiler dialog.

 

Obviously, history managmeent makes no sense with an hta.  

 

In case anyone is following this, in this context, the tla hta means
HML Application, which is a way to run html in an IE browser without the
security restrictions of a browser. hta has other meanings in other
contexts.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markgoldin_2000
Sent: Friday, February 20, 2009 9:54 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Running Flex from HTA

 

I am looking for a solution of starting either a Flex or Air 
application from a regular win32 executable. I haven't tried AIR yet, 
but with Flex I have two options: Open Browser with a link to html page 
(standard with Flex) or with HTA file. If I do html page then I am 
getting sandbox violation, if HTA, then it starts fine, but after 
application starts loading I am getting a script error:
parent.BrowserHistory is null or not an object. line 14 

I have tried different IE versions, as well as different OSs.

Any idea?





RE: [flexcoders] Accordion problem - rowCount/scrollbar

2009-02-20 Thread Tracy Spratt
I don't think I have ever set rowCount with Accordion, and have never
seen the problem you describe.  What happens if you do not set it?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of lanekelly5
Sent: Friday, February 20, 2009 10:32 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Accordion problem - rowCount/scrollbar

 

Is there a way to essentially disable the rowCount property of an 
accordion and just have it show as much content (including partial 
rows) in the vertical space that is available? I'm finding that if I 
set a rowCount which takes up less space than the expanded section has 
available I get an annoying thin gray bounding box and the scroll bar 
only extends down that far. I have dead space below that before the 
collapsed accordion headers are displayed. If I set my rowCount to be 
large enough to take up more space than there is my scrollbar is 
screwed up - there's no slider or up/down arrow visible.

Does this make sense? I really want to specify no rowCount and have it 
show as much as possible based on the height available. (I need to fix 
the height of the overall accordion component to fit the design layout.)





RE: [flexcoders] Multiple filters on datagrid

2009-02-20 Thread Tracy Spratt
Why not just do all the logic in the filter fuction?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of m_ba...@goodyear.com
Sent: Friday, February 20, 2009 11:08 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Multiple filters on datagrid

 


I have four comboboxes populated from arrays. I have a datagrid
populated by an ArrayCollection. I can filter the ArrayCollection from
each combo box individually, but I need to filter by multiple
selections. For example, I may want to filter by UserID and Carrier and
Origin. 

The obvious solution is to run a conditional that appends a variable and
use the variable in the filter conditional. 

if(cboUserID.text != ){ 
filterVar = 'item.USER_ID == cboUserID.text'; 
} 
if(cboCarrier.text != ){ 
filterVar = filterVar + 'item.Carrier == cboCarrier.text';

} 

public function processFilters(item: Object):Boolean { 
if (filterVar.toString()) { 
  return true;} 
  { 
  

return false; 
   } 


The problem is that the processFilters function won't accept the
filterVar as a string. Is it a matter of using a different datatype or
do I need to escape characters or is this not possible? Is there a
better way to do this? 


Thanks,
Mike Baker
m_ba...@goodyear.com





RE: [flexcoders] Relative Layout Question

2009-02-20 Thread Tracy Spratt
Well, first, you are specifying that the two panels take up  a total of
100% of the app height, so what you describe is what you are asking for.

 

You can use an expression in binding braces. Try this, see if it does
what you want:

mx:Panel height={this.height/4}

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Keith Hughitt
Sent: Friday, February 20, 2009 11:37 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Relative Layout Question

 

Hi all,

I have a question about using creative relatively-sized layouts:

The default behavior
http://livedocs.adobe.com/flex/3/langref/mx/containers/Panel.html
of many containers is to use adopt a height just large enough to fit all
of it's children content. Manually specifying a relative height (e.g.
25%) for the container will work, but only if the content is small
enough. Otherwise the height is increased to fit the content.

e.g.

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical width=600 height=600
mx:Panel height=75%
mx:Text text=This panel should take up 75% of the
application's height /
/mx:Panel
mx:Panel height=25%
mx:Accordion
mx:Form
mx:Text text=Item 1 /
mx:Text text=Item 2 /
mx:Text text=Item 3 /
mx:Text text=Item 4 /
/mx:Form
mx:Form
mx:Text text=etc /
/mx:Form
/mx:Accordion
/mx:Panel
/mx:Application

Instead of taking up 25% of the application height the bottom panel will
expand to fit the accordion (which in turn has a height equal to the
amount of space used up by it's larged child).

Is there anyway I can force the panel to only expand to 25% of the main
application's height? I can set an absolute height the panel's children
which will assure a maximum height, but I would like to be able to use a
relative height.

Any ideas? Any suggestions would be greatly appreciated.

Thanks!
Keith





RE: [flexcoders] Error message in debug console?

2009-02-20 Thread Tracy Spratt
Myabe you broke your html wrapper?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markflex2007
Sent: Friday, February 20, 2009 1:58 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Error message in debug console?

 

Hi,

I get the following message in debug console,do you know what this
means?

*** Security Sandbox Violation ***
SecurityDomain 'file:///D:/WORKSPACE/Flex file:///D:\WORKSPACE\Flex
Builder
3/Reflex4/bin-debug/TabNavigatorDemo.html' tried to access
incompatible context 'file:///D:/WORKSPACE/Flex
file:///D:\WORKSPACE\Flex  Builder
3/Reflex4/bin-debug/TabNavigatorDemo.swf'
*** Security Sandbox Violation ***

Thanks for help

Mark





RE: [flexcoders] XML Parsing - maintaining a record pointer

2009-02-20 Thread Tracy Spratt
I would suggest that you do not think in terms of reading the file.
Rather, use e4x to find the node you want to process, then go from
there.

 

OTOH, it is acceptable to manipulate an XMLList, especially if your data
is a single level.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Sam Lai
Sent: Friday, February 20, 2009 4:12 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] XML Parsing - maintaining a record pointer

 

You could use a different variable name in the inner loop, that way it
won't change the object in the outer loop.

On 2/21/09, Libby libbychan...@yahoo.com
mailto:libbychantel%40yahoo.com  wrote:
 hi, flexCoders!
 thanks for all ur help in the past!

 Does Flex maintain your record pointer while reading an xml file?
 basically what i want to do is read each line and when I hit certain
 values, read on for 4 or 5 records, then return to the original
 process without starting back at the last record read at the first
 read. I can do this the hard way of course by maintaining my own
 pointer and treating the file as a giant array, but surely there is an
 easier way?


 for each (var xmlNode:XML in xml.children()) {
 // do stuff
 // if(xmlNode.something==aValue) {
 for each (var xmlNode:XML  read on into the file

 thanks,
 Libby



 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
 Alternative FAQ location:

https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-
1e62079f6847
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf
-1e62079f6847 
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo ! Groups
Links









RE: [flexcoders] ToggleButtonBar xml based dataProvider

2009-02-20 Thread Tracy Spratt
Certainly.  Why would you think not?

 

Though to speak accurately, you would use XMLList or XMLListCollection
as the dataProvider.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markgoldin_2000
Sent: Friday, February 20, 2009 3:46 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ToggleButtonBar xml based dataProvider

 

Is that possible?

Thanks





RE: [flexcoders] Re: Error message in debug console?

2009-02-20 Thread Tracy Spratt
Did you clean the project?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markflex2007
Sent: Friday, February 20, 2009 2:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Error message in debug console?

 

Thanks.

But I never change the html code.

the html code is generated with flex builder.

Mark







RE: [flexcoders] Re: How can I shorten the heading on the Advanced Data Grid

2009-02-19 Thread Tracy Spratt
Set sortExpertMode=true

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Amy
Sent: Thursday, February 19, 2009 11:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How can I shorten the heading on the Advanced
Data Grid

 

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, boy_trike boy_tr...@... wrote:

 I need to use the ADG for the style function but notice that the
 headings now are WIDER with a space on the right for multiple sort
 priorities. Is there an easy way to eliminate that?

http://flexdiary.blogspot.com/2008/09/extended-datagrid-with-
http://flexdiary.blogspot.com/2008/09/extended-datagrid-with- 
stylefunction.html





RE: [flexcoders] Re: Weird XMLListCollection behaviour - items won't remove

2009-02-19 Thread Tracy Spratt
First, are you sure your collections are independent?  If you use the
same XMLList for both, they are not.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexcoder2008
Sent: Thursday, February 19, 2009 2:27 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
won't remove

 

I should make a correction...the 2nd example doesn't workwhere I
am using the delete with an index. That just removes one of the nodes
of the object itself.

So I am still stuck as to how to successfully remove a shared object
between 1 list and another and have the item removed from 1 datagrid
and added to another.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, flexcoder2008 djohnso...@... wrote:

 I am having all sorts of problems with removing items from an
 XMLListCollection. Not sure if this is because the dataBinding is
 preventing the items from being removed or not - I'm hoping someone
 who has run into this issue as well can give me some insight.
 
 I have 2 XMLListCollections, each 1 is bound to a seperate DataGrid.
 
 There is an approvedItemList bound to dgApproved, and an
 unApprovedList bound to dgUnApproved.
 
 Sometimes, I want to remove an object from the 1 list, and then add it
 to the other list. (I am using Cairngorm by the way)
 
 For example, I want to take an item in the unApprovedList and add it
 to the ApprovedList. So first I would add the object to the
 ApprovedList, and then get the Index of the object in the
 UnApprovedList and use RemoveAt like so:
 
 approvedList.addItem(myObject);
 var index:int = unApprovedItemList.getItemIndex(myObject);
 unApprovedList.removeAt(index);
 
 I am looking at the collections in the watch window, and I can see
 that when the .removeAt fires, the object is still left in the
 unApprovedList! Why is this happening?
 
 I then attempted to remove the item this way as a workaround:
 
 approvedList.addItem(myObject);
 
 var index:int = 0;
 for each(var o:Object in unApprovedList){
 if(o.Id == myObject.Id.toString()){
 delete o[index];
 break;
 }
 else
 index++; 
 
 }
 
 Here again, when the delete command gets hit, the line executes, but
 the object is left in the collection. I am left with 2 copies, the
 newly added one in the approvedList, and the leftover copy that I've
 tried to delete in the unApprovedList.
 
 Is the databinding somehow making a copy or locking that object?






RE: [flexcoders] Read XML files

2009-02-19 Thread Tracy Spratt
I'd suggets HTTPService for reading xml files.  It is a bit easier to
use than URLLoader, and aimed specifically at XML over http.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Laurent Cozic
Sent: Thursday, February 19, 2009 12:08 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Read XML files

 

Parsing XML is built into AS3, see for example:
http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg1.htm

To load an XML file, see URLLoader and URLRequest. For example:

var loader = new URLLoader();
loader.load(new URLRequest(http://example.com/xml.xml;));
loader.addEventListener(complete, xmlLoaded);

function xmlLoaded(event) {
   var xmlString = event.currentTarget.data;

   // and parse the XML here
}

--
Laurent Cozic

Flash, Flex and Web Application development
http://pogopixels.com http://pogopixels.com 

--- On Thu, 2/19/09, christophe_jacquelin
christophe_jacque...@yahoo.fr wrote:

From: christophe_jacquelin christophe_jacque...@yahoo.fr
Subject: [flexcoders] Read XML files
To: flexcoders@yahoogroups.com
Date: Thursday, February 19, 2009, 5:04 PM

Hello,

Which instructions to use to read/write XML files ?

Thank you,
Christophe,

 





RE: [flexcoders] design question: editing / saving complex valueobjects

2009-02-19 Thread Tracy Spratt
Can you make the validation functionality independently available?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Maciek Sakrejda
Sent: Thursday, February 19, 2009 11:21 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] design question: editing / saving complex
valueobjects

 

Anyone? I'm sure this sort of thing comes up pretty frequently--I'd be
curious to know how other Flex users tackle it.

-Maciek

-Original Message-
From: Maciek Sakrejda msakre...@truviso.com
mailto:msakrejda%40truviso.com 
Reply-To: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
To: flexcoders flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
Subject: [flexcoders] design question: editing / saving complex value
objects
Date: Wed, 18 Feb 2009 10:35:04 -0800

Suppose I have a class Calendar that mirrors a server-side class (we're
not really working with Calendars, but I think this is a reasonably good
and simple analogy):

class Calendar {
public var appointments:ArrayCollection;
/* other stuff */
}

Then I want users to be able to edit and save the Calendar: I have a
CalendarEditor. Editing a Calendar is moderately complicated (e.g.,
adding, removing, or editing Appointments), so I want explicit
save/cancel steps.

When editing something really simple, this is not really a problem--when
the user saves, I propagate the view state to the object; when she hits
cancel, I don't do anything.

However, the Calendar determines what combination of Appointments is
valid (they can't overlap), and the Calendar is the dataProvider of the
CalendarEditor, so I can't fully validate a combination of Appointments
without adding them to the Calendar. This means I actually need to add
the appointments to the Calendar before it is saved so that they can be
(a) validated in combination and (b) used to update the view while the
edit is in progress. This makes save/cancel steps trickier: do I

(1) Clone the Calendar (and therefore have it provide a clone() method)
when assigned in the dataProvider, modify the clone, and assign the
dataProvider reference when the user hits save.
(2) Clone the Calendar as above, but have the Editor modify the
original, and restore the clone in case the user cancels.
(3) Something more clever?

The problem with (1) is that cloning may be somewhat complicated, and it
feels ugly to have the Editor update the dataProvider reference
(instead of modifying the actual object that was set as the data
provider). (2) hits the same issue. Perhaps the solution is to maintain
a private clone, and copy back the state on save? Or is the right answer
here that the model should not expect that the editor will update the
object it set as the dataProvider, but should instead expect an update
through a mechanism like a Mate map?

Any thoughts? (Please keep in mind that my experience with MVC
frameworks is unfortunately minimal, though I'm looking into Mate right
now).

Thanks,
Maciek





RE: [flexcoders] Re: Weird XMLListCollection behaviour - items won't remove

2009-02-19 Thread Tracy Spratt
Good.

 

Are you using copy() when you addItem() to the approvedList?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexcoder2008
Sent: Thursday, February 19, 2009 2:49 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
won't remove

 

The collections are independent. 
When my app starts up I have an XML variable that gets split into 2
seperate lists.

So for example:

var myList:XML

I then split the lists into 2 like so:

for each(var x:XML in myList){
if(x.Status == UnApproved) 
unApproved.addItem(x.copy()); 
else if(x.Status == Approved) 
approvedList.addItem(x.copy()); 
}

I used the .copy() method to ensure that this isn't tied back to the
original XML by reference.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:

 First, are you sure your collections are independent? If you use the
 same XMLList for both, they are not.
 
 
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of flexcoder2008
 Sent: Thursday, February 19, 2009 2:27 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
 won't remove
 
 
 
 I should make a correction...the 2nd example doesn't workwhere I
 am using the delete with an index. That just removes one of the nodes
 of the object itself.
 
 So I am still stuck as to how to successfully remove a shared object
 between 1 list and another and have the item removed from 1 datagrid
 and added to another.
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 , flexcoder2008 djohnson29@ wrote:
 
  I am having all sorts of problems with removing items from an
  XMLListCollection. Not sure if this is because the dataBinding is
  preventing the items from being removed or not - I'm hoping someone
  who has run into this issue as well can give me some insight.
  
  I have 2 XMLListCollections, each 1 is bound to a seperate DataGrid.
  
  There is an approvedItemList bound to dgApproved, and an
  unApprovedList bound to dgUnApproved.
  
  Sometimes, I want to remove an object from the 1 list, and then add
it
  to the other list. (I am using Cairngorm by the way)
  
  For example, I want to take an item in the unApprovedList and add it
  to the ApprovedList. So first I would add the object to the
  ApprovedList, and then get the Index of the object in the
  UnApprovedList and use RemoveAt like so:
  
  approvedList.addItem(myObject);
  var index:int = unApprovedItemList.getItemIndex(myObject);
  unApprovedList.removeAt(index);
  
  I am looking at the collections in the watch window, and I can see
  that when the .removeAt fires, the object is still left in the
  unApprovedList! Why is this happening?
  
  I then attempted to remove the item this way as a workaround:
  
  approvedList.addItem(myObject);
  
  var index:int = 0;
  for each(var o:Object in unApprovedList){
  if(o.Id == myObject.Id.toString()){
  delete o[index];
  break;
  }
  else
  index++; 
  
  }
  
  Here again, when the delete command gets hit, the line executes, but
  the object is left in the collection. I am left with 2 copies, the
  newly added one in the approvedList, and the leftover copy that I've
  tried to delete in the unApprovedList.
  
  Is the databinding somehow making a copy or locking that object?
 






RE: [flexcoders] Re: Forcing an Image to redraw when the source filename is the same

2009-02-19 Thread Tracy Spratt
Have you tried setting source=null; then resetting the source to the
actual url?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexcoder2008
Sent: Thursday, February 19, 2009 2:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Forcing an Image to redraw when the source
filename is the same

 

Thanks for that suggestion, but I don't think that's an approach I can
take. Any other suggestions?

Is this just a browser cache issue?





RE: [flexcoders] Repeaters and Referencing Component IDs

2009-02-19 Thread Tracy Spratt
The first thing I would do is crate a custom component that encapsulates
the repeated UI(tree and image), and repeat that.  Then I would create a
setter for the image source (set imageSource()) in the repeated
component.

 

I would give my component and id, say myTree.  Repeater would make an
array of the 5 instances.  Then I could do:

myTree[0].imageSource = myImageUrl;

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Merrill, Jason
Sent: Thursday, February 19, 2009 3:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Repeaters and Referencing Component IDs

 

I have a repeater inside a Viewstack working fine. i.e., the Tree
component gets created over and over as expected, however, I would like
to access an array of all the mx:Image instances, so I can load images
into them with Actionscript later (the file name for the image is not
loaded into the app until after the repeater runs and the XML is
loaded).

I thought inside a repeater, the examples I have seen (
http://www.adobe.com/devnet/flex/quickstart/using_the_repeater/
http://www.adobe.com/devnet/flex/quickstart/using_the_repeater/   -
see the last example on that page) indicate that the id tag converts to
an array of each repeated component.  However, when I trace
_image.length (ensuring I'm checking after Application.COMPLETE fires),
it's always 1, even though the dataprovider length for the repeater is
5.  Here is the relevant MXML part of my script:

mx:ViewStack selectedIndex={buttonBar.selectedIndex}

  mx:Repeater id=cubeSideRepeater dataProvider={arr} 

 mx:VBox width={vBoxWidth} height={toggleButtonBarHeight}
backgroundColor={vBoxBackgroundColor}verticalAlign=middle
horizontalAlign=center hideEffect=cache showEffect=cube

 mx:HBox

  mx:Tree borderThickness=0 width={treeWidth}
height=100% dataProvider={_currentTreeNode} labelField=@label
itemClick=treeItemClicked(event) /

  mx:Spacer width=5/

  mx:Image id=_images /

 /mx:HBox

  /mx:VBox

   /mx:Repeater

/mx:ViewStack

How would you handle this?

Jason Merrill

 Bank of  America   |  Learning Performance Solutions Instructional
Technology  Media  
Learn about the Adobe Flash platform for rich media experiences - join
the Bank of America Flash Platform Community
http://sharepoint.bankofamerica.com/sites/tlc/flash/default.aspx  

Anyone can follow my nonsense on Twitter: jmerrill_2001.  If you know me
personally, follow more nonsense on Facebook. 





.  



image001.gif

RE: [flexcoders] Re: Weird XMLListCollection behaviour - items won't remove

2009-02-19 Thread Tracy Spratt
Did you verify that var x:XML = unApprovedList[index]; is returning a
good reference?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexcoder2008
Sent: Thursday, February 19, 2009 3:57 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
won't remove

 

Thanks Tracey - yes I am doing that as well.

I'm trying a new approach now - the problem now is that when I try to
retrieve the item index, even though I can see that the object is
there, I am getting an index of -1. Is there something wrong with
this code block?

approvedList.addItem(myObject.copy());

var index:int = 0;
for each(var o:Object in unApprovedList){
if(o.id == o.id.toString()){
break;
}
else
index++; 

}

var x:XML = unApprovedList[index];
// x should refer to the same object in unApprovedList!

var index:int = unApprovedList.getItemIndex(x); // is returning -1
unApprovedList.removeItemAt(index);

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:

 Good.
 
 
 
 Are you using copy() when you addItem() to the approvedList?
 
 
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of flexcoder2008
 Sent: Thursday, February 19, 2009 2:49 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
 won't remove
 
 
 
 The collections are independent. 
 When my app starts up I have an XML variable that gets split into 2
 seperate lists.
 
 So for example:
 
 var myList:XML
 
 I then split the lists into 2 like so:
 
 for each(var x:XML in myList){
 if(x.Status == UnApproved) 
 unApproved.addItem(x.copy()); 
 else if(x.Status == Approved) 
 approvedList.addItem(x.copy()); 
 }
 
 I used the .copy() method to ensure that this isn't tied back to the
 original XML by reference.
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 , Tracy Spratt tspratt@ wrote:
 
  First, are you sure your collections are independent? If you use the
  same XMLList for both, they are not.
  
  
  
  Tracy Spratt 
  Lariat Services 
  
  Flex development bandwidth available 
  
  
  
  From: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 ] On
  Behalf Of flexcoder2008
  Sent: Thursday, February 19, 2009 2:27 PM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
  Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
  won't remove
  
  
  
  I should make a correction...the 2nd example doesn't workwhere I
  am using the delete with an index. That just removes one of the
nodes
  of the object itself.
  
  So I am still stuck as to how to successfully remove a shared object
  between 1 list and another and have the item removed from 1 datagrid
  and added to another.
  
  --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
  , flexcoder2008 djohnson29@ wrote:
  
   I am having all sorts of problems with removing items from an
   XMLListCollection. Not sure if this is because the dataBinding is
   preventing the items from being removed or not - I'm hoping
someone
   who has run into this issue as well can give me some insight.
   
   I have 2 XMLListCollections, each 1 is bound to a seperate
DataGrid.
   
   There is an approvedItemList bound to dgApproved, and an
   unApprovedList bound to dgUnApproved.
   
   Sometimes, I want to remove an object from the 1 list, and then
add
 it
   to the other list. (I am using Cairngorm by the way)
   
   For example, I want to take an item in the unApprovedList and add
it
   to the ApprovedList. So first I would add the object to the
   ApprovedList, and then get the Index of the object in the
   UnApprovedList and use RemoveAt like so:
   
   approvedList.addItem(myObject);
   var index:int = unApprovedItemList.getItemIndex(myObject);
   unApprovedList.removeAt(index);
   
   I am looking at the collections in the watch window, and I can see
   that when the .removeAt fires, the object is still left in the
   unApprovedList! Why is this happening?
   
   I then attempted to remove the item this way as a workaround:
   
   approvedList.addItem(myObject);
   
   var index:int = 0;
   for each(var o:Object in unApprovedList){
   if(o.Id == myObject.Id.toString()){
   delete o[index];
   break

RE: [flexcoders] Re: Weird XMLListCollection behaviour - items won't remove

2009-02-19 Thread Tracy Spratt
trace(x.toXMLString());  //is that the node you expect?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexcoder2008
Sent: Thursday, February 19, 2009 4:15 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
won't remove

 

What is the best way to do this? I tried this line and it returned
true so it should be a good reference right?

var x:XML = unApprovedList[index];
trace(x == unApprovedList[index]);

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:

 Did you verify that var x:XML = unApprovedList[index]; is returning a
 good reference?
 
 
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of flexcoder2008
 Sent: Thursday, February 19, 2009 3:57 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
 won't remove
 
 
 
 Thanks Tracey - yes I am doing that as well.
 
 I'm trying a new approach now - the problem now is that when I try to
 retrieve the item index, even though I can see that the object is
 there, I am getting an index of -1. Is there something wrong with
 this code block?
 
 approvedList.addItem(myObject.copy());
 
 var index:int = 0;
 for each(var o:Object in unApprovedList){
 if(o.id == o.id.toString()){
 break;
 }
 else
 index++; 
 
 }
 
 var x:XML = unApprovedList[index];
 // x should refer to the same object in unApprovedList!
 
 var index:int = unApprovedList.getItemIndex(x); // is returning -1
 unApprovedList.removeItemAt(index);
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 , Tracy Spratt tspratt@ wrote:
 
  Good.
  
  
  
  Are you using copy() when you addItem() to the approvedList?
  
  
  
  Tracy Spratt 
  Lariat Services 
  
  Flex development bandwidth available 
  
  
  
  From: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 ] On
  Behalf Of flexcoder2008
  Sent: Thursday, February 19, 2009 2:49 PM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
  Subject: [flexcoders] Re: Weird XMLListCollection behaviour - items
  won't remove
  
  
  
  The collections are independent. 
  When my app starts up I have an XML variable that gets split into 2
  seperate lists.
  
  So for example:
  
  var myList:XML
  
  I then split the lists into 2 like so:
  
  for each(var x:XML in myList){
  if(x.Status == UnApproved) 
  unApproved.addItem(x.copy()); 
  else if(x.Status == Approved) 
  approvedList.addItem(x.copy()); 
  }
  
  I used the .copy() method to ensure that this isn't tied back to the
  original XML by reference.
  
  --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
  , Tracy Spratt tspratt@ wrote:
  
   First, are you sure your collections are independent? If you use
the
   same XMLList for both, they are not.
   
   
   
   Tracy Spratt 
   Lariat Services 
   
   Flex development bandwidth available 
   
   
   
   From: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
  [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
  ] On
   Behalf Of flexcoder2008
   Sent: Thursday, February 19, 2009 2:27 PM
   To: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
   Subject: [flexcoders] Re: Weird XMLListCollection behaviour -
items
   won't remove
   
   
   
   I should make a correction...the 2nd example doesn't workwhere
I
   am using the delete with an index. That just removes one of the
 nodes
   of the object itself.
   
   So I am still stuck as to how to successfully remove a shared
object
   between 1 list and another and have the item removed from 1
datagrid
   and added to another.
   
   --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com 
  mailto:flexcoders%40yahoogroups.com
  mailto:flexcoders%40yahoogroups.com
   , flexcoder2008 djohnson29@ wrote:
   
I am having all sorts of problems with removing items from an
XMLListCollection. Not sure

RE: [flexcoders] Re: Repeaters and Referencing Component IDs

2009-02-19 Thread Tracy Spratt
I don't know that repeater makes a reference array for child components
of the repeated parent.  It may, but I never do it that way.  

 

Try the component.  The refactor will take you maybe 3 minutes, and you
will never go back.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jason
Sent: Thursday, February 19, 2009 4:13 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Repeaters and Referencing Component IDs

 

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:

 The first thing I would do is crate a custom component that 
encapsulates
 the repeated UI(tree and image), and repeat that. Then I would 
create a
 setter for the image source (set imageSource()) in the repeated
 component.
 
 
 
 I would give my component and id, say myTree. Repeater would 
make an
 array of the 5 instances. Then I could do:
 
 myTree[0].imageSource = myImageUrl;

OK thanks! I will do that, however, custom component discussion 
aside, this seems to be do-able without a custom component (even 
though yeah, I should wrap it up into one). The main point of my 
question is that it seems that, applying your example, myTree is not 
an array of several objects (demonstrated with my example) as I would 
have thought - that is the problem with my code I'm trying to figure 
out. In your example, I would think myTree be an array with a length 
of 5 (since the DP is 5 in length) - each object in the array being 
an Image (or in your example, an instance of your custom component). 
But as my example shows, it's length is 1. Best practices aside, 
from a pure coding perspective (bad as it may be), why does my 
_images array have a length of 1 instead of 5 like the DP?





RE: [flexcoders] Re: Repeaters and Referencing Component IDs

2009-02-19 Thread Tracy Spratt
I'd have to test it to know for sure, but I was just theorizing on why
you were not able to access the id array for the image.  I could further
theorize that the image tag, being a child of the repeated container, is
treated differently by Repeater than the container, but that is
theorizing to support a theory that I do not even know is correct.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jason
Sent: Thursday, February 19, 2009 4:34 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Repeaters and Referencing Component IDs

 

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:
 I don't know that repeater makes a reference array for child 
components
 of the repeated parent. It may, but I never do it that way. 

OK, because you just said, 

Repeater would 
make an
 array of the 5 instances.

How is that fundamentally different?

The custom component you're suggesting is just a class just like 
mx:Image is, so I don't see how your example is any different 
really? NOT trying to argue, just trying to understand. If you say, 
myTree[0].imageSource = myImageUrl; - isn't myTree an array created 
from doing c:MyTree id=myTree / inside the repeater - just like 
mx:Image id=_images / as in my example? 

Again, NOT trying to argue, just trying to understand the difference! 
Thanks so much for your help!





RE: [flexcoders] Re: Using an itemRenderer in a grid and rendering glitches

2009-02-19 Thread Tracy Spratt
...override the set data protected function - but what do I change?...
that depends on what your renderer does.

 

I suggest that you start with a renderer that someone else has written
and modify it to meet your purposes.  Either that or start reading up on
renderers.  Some of the key parts you should learn about are:

set data() 

commitProperties()

createChildren()

updateDisplayList

measure()

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of lelander
Sent: Thursday, February 19, 2009 5:10 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Using an itemRenderer in a grid and rendering
glitches

 

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Amy amyblankens...@... wrote:

 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , biosmonkey biosmonkey@ 
 wrote:
 
  I have an adg that displays a tree of items, along with a custom 
 item
  renderer that shows an icon representing status.
  
  For the most part this works well, however, in some rare 
 circumstances
  when scrolling I have seen the item renderer glitch ... sometimes it
  appears to be double rendered, sometimes it is rendered in the wrong
  place. I have also seen the text labels in the tree superimpose on
  top of themselves sometimes.
  
  This problem is actually not unique to this situation, because I 
 have
  seen it in other grids with IRs. This problem, however, just 
 happens
  to be in a MAJOR project of mine :).
  
  Has anyone else seen similar problems? I don't know how it would be
  my code ... it seems more like a flash player bug. I am using flash
  10. Note also that my IR is not doing any graphical drawing; it is
  essentially an hbox with an img that just gets its source changed.
 
 Check out Q2
 http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf 


I'm having the same problem, and checked out this pdf. Amy says to
override the set data 
protected function - but what do I change?

Thanks!
JP





RE: [flexcoders] Re: parse SOAP response for values

2009-02-18 Thread Tracy Spratt
Unless your xml is very simple, you should not guess at the e4x
expession, but rather work your way to the node you want by using
temporary variables and tracing the results as you go.

 

To do this you must use a resultHandler, and do not use lastResult.
Start with something like:

private function handleResult(event:ResultEvent):void

var xmlResult:XML = XML(event.result)

trace(xmlResult.toXMLString());  //CRITICAL step, verify your structure

 

Then get the next node in the path you want, trace again, etc.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of m_ollman
Sent: Wednesday, February 18, 2009 4:23 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: parse SOAP response for values

 

Tracy :-)

Thought about the namespace issue - some examples where talking about
the SOAP Header being removed automatically, I was'nt seeing that. The
reult format is E4X. However I could not get into the structure using
childNode etc.

So I would start by defining the namespace it.

SOAP-ENV...
typ=http://ruleburst.com/ruleserver/9.1/rulebase/types
http://ruleburst.com/ruleserver/9.1/rulebase/types 

in AS 

public var typ:Namespace =
new
Namespace(http://ruleburst.com/ruleserver/9.1/rulebase/types
http://ruleburst.com/ruleserver/9.1/rulebase/types );

Next step I'm not sure about the path to the attribute.

WS.Assess.lastResult.typ::session-data.global.global_1.abc570.

WS.Assess.lastResult.typ::assess-response.session-data.list-entity.entit
y.abc570

Will test in the morning when back at desk. Rushed out so fast I left
my USB! doh

Cheers
martin

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:

 One big hassle with SOAP is the namespaces. Once you get that
straight,
 you can use normal e4x expressions on it. 
 
 
 
 Where are you having difficulty?
 
 
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of m_ollman
 Sent: Wednesday, February 18, 2009 12:38 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] parse SOAP response for values
 
 
 
 I have been looking around for a few hours - Flex Cookbook has some
 info about mapping types. But no real method of getting into the
 structure.
 
 I need to grab the value of an attribute - abc570, which will be EOPO
 + 4 other attributes.
 
 SOAP-ENV:Envelope
 xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/
http://schemas.xmlsoap.org/soap/envelope/ 
 http://schemas.xmlsoap.org/soap/envelope/
http://schemas.xmlsoap.org/soap/envelope/   
 
 xmlns:typ=http://ruleburst.com/ruleserver/9.1/rulebase/types
http://ruleburst.com/ruleserver/9.1/rulebase/types 
 http://ruleburst.com/ruleserver/9.1/rulebase/types
http://ruleburst.com/ruleserver/9.1/rulebase/types  
 SOAP-ENV:Header/
 SOAP-ENV:Body
 typ:assess-response
 typ:session-data
 typ:list-entity entity-type=global
 typ:entity id=global_1
 
 typ:attribute id=abc570 inferencing-type=intermediate
type=text
 typ:text-valEOPO/typ:text-val
 /typ:attribute
 
 ** ETC - 4 more vales **
 
 /typ:entity
 /typ:list-entity
 /typ:session-data
 /typ:assess-response
 /SOAP-ENV:Body
 /SOAP-ENV:Envelope
 
 Handler is 
 
 private function RBcompleteHandler(event:Event) : void
 {
 
 var dataXML:XML = XML(event.target.data);
 }
 
 any help much appreciated
 
 rgds
 martin






RE: [flexcoders] Desperate Help! crossdomain.xml

2009-02-18 Thread Tracy Spratt
You are missing the most important part:

allow-access-from domain=* to-ports=*/

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Wally Kolcz
Sent: Wednesday, February 18, 2009 10:11 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Desperate Help! crossdomain.xml

 

I have a site (http://www2.med.umich.edu/prmc/af/) that had an old
crossdomain.xml file that worked fine until FP10. It works fine when
visiting from that URL since it on the same server, however, we also
have this domain (http://www.victorsvaliant.org/af/) pointing to it also
and I get a security error when the video is played. How can I modifiy
my crossdomain.xml file to allow for both? Here is my current. I need to
have this done today since the new URL went public. Thanks!

?xml version=1.0?
!DOCTYPE cross-domain-policy SYSTEM
http://www.adobe.com/xml/dtds/cross-domain-policy.dtd;
cross-domain-policy
site-control permitted-cross-domain-policies=all /
/cross-domain-policy





RE: [flexcoders] Help with Timer issue

2009-02-18 Thread Tracy Spratt
You are adding an event listener every time yu click the button.  I
don't know that this is the problem but it makes me suspicious.  Either
remove the event listener in the success condition, or add it one time
in an init function. See if that chnges the behavior.

 

Other than that, simplify the setup to the minimum and see if the issue
continues.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of trishhartnett
Sent: Wednesday, February 18, 2009 1:38 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Help with Timer issue

 

Hello all, 

I'm a Flex newbie. I'm working on an application where an end user
clicks a button, and when the button is clicked a DB is queried
repeatedly until a particular result is returned. When the result is
returned the end user gets a confirmation message to tell them that
they were successful.

So the code goes like this:

private var dBTimer:Timer = new Timer(5000);

private function onButtonClick(): void{
dBTimer.addEventListener(TimerEvent.TIMER, timeTick);
dBTimer.start();
}

public function timeTick(evt:TimerEvent):void {
checkStatus(callBackFunction, id); 
}

private function callBackFunction():void 
{
if( status == 'SUCCESS' )
{ 
// cancel the timer
dBTimer.stop(); 
dBTimer.reset();
Alert.show(Succcess string,Info,OK,null,null,INFO_ICON);
}else{
//do nothing and the checkStatus 
//will be called again at next TimerEvent
} 
}

So the first time the end user clicks on the button, everything works
okay. The DB is queried and when SUCCESS is returned the dBTimer is
stopped and reset. The end user gets the Success Alert dialog box and
everything is okay.

The second time the end user clicks the button, everything happens the
same as before, only the dbTimer, despite being stopped doesn't stop
working. checkStatus is called over and over again in an infinite loop
because the dbTimer never stops.

Can anyone suggest anything please ? I am really puzzled by this one.

Best Regards, 
Trish.





RE: [flexcoders] Flex compile error

2009-02-18 Thread Tracy Spratt
Did you Clean the project?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Nathaniel Skiba
Sent: Wednesday, February 18, 2009 8:03 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex compile error

 

I can't say for certain without seeing your code, but it looks like
you're using the class data somewhere without importing it.

~Nate





RE: [flexcoders] Presenting images with links to new Browser location

2009-02-17 Thread Tracy Spratt
Image does dispatch a click event.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of brucewhealton
Sent: Monday, February 16, 2009 11:33 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Presenting images with links to new Browser
location

 

Hello all,
I was looking at the navigateToURL method and wanted to see
about using an image as a clickable link to a website. The image
component does not have an onClick property, so it isn't possible to
make an image into an active link to a website. Is there a way to
accomplish this? Maybe by putting an image inside a button?
Thanks,
Bruce





RE: [flexcoders] Re: filter arraycollection with checkbox acting wired

2009-02-17 Thread Tracy Spratt
I've quit this one.  The original poster needs to develop his debugging
techniques before going any further.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Tim Hoff
Sent: Tuesday, February 17, 2009 12:57 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: filter arraycollection with checkbox acting
wired

 


This is asolutely comical.

-TH

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, johndoematrix johndoemat...@...
wrote:

 hi Ben when i tried the solution you gave, it worked very very well.
 but this is when am using a single criteria. when i try to add it to a
 filter function that filter's based on more than one criteria that's
 when there come's a problem.






RE: [flexcoders] Re: Using an itemRenderer in a grid and rendering glitches

2009-02-17 Thread Tracy Spratt
Right.  Or my response would be, is your itemRenderer coded correctly?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Amy
Sent: Tuesday, February 17, 2009 2:22 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Using an itemRenderer in a grid and rendering
glitches

 

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, biosmonkey biosmon...@... 
wrote:

 I have an adg that displays a tree of items, along with a custom 
item
 renderer that shows an icon representing status.
 
 For the most part this works well, however, in some rare 
circumstances
 when scrolling I have seen the item renderer glitch ... sometimes it
 appears to be double rendered, sometimes it is rendered in the wrong
 place. I have also seen the text labels in the tree superimpose on
 top of themselves sometimes.
 
 This problem is actually not unique to this situation, because I 
have
 seen it in other grids with IRs. This problem, however, just 
happens
 to be in a MAJOR project of mine :).
 
 Has anyone else seen similar problems? I don't know how it would be
 my code ... it seems more like a flash player bug. I am using flash
 10. Note also that my IR is not doing any graphical drawing; it is
 essentially an hbox with an img that just gets its source changed.

Check out Q2
http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf 





RE: [flexcoders] ImageSnapshot sandbox problem

2009-02-17 Thread Tracy Spratt
Hey, Guy.

 

You can read up on the rationale for all this security crap if you
really want to know.  Adobe has whitepapers out the wazoo.  I say apply
the death penalty to the jerks who make it necessary.

 

Proxy servers are not specific Flex/Flash technologies, but rather
depend on the server platform/language  I saw a php one recently, and
probably google would reveal examples for other platforms.

 

I just tried google and was dissappointed not to find more examples
readily.  Lots of references to proxies, but few concrete examples.
Probably because pros in those languages consider it a trivial exercise.

 

Next time I see one, I will start a collection.

 

This has not been an issue for me because all of my app to date have had
a server-side business logic tier, which does all my external data
access.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Guy Morton
Sent: Tuesday, February 17, 2009 6:47 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ImageSnapshot sandbox problem

 

Hi Alex

 

Mm. ok... but if I were a bad guy wouldn't *I* just use a proxy server?
:-) 

 

It seems a bit of a stretch, frankly, that allowing flash to read the
bitmap data constitutes a risk beyond that that simply rendering it
poses, but I guess arguing that point won't fix my problem anytime soon.

 

When you say we could get around this using a proxy server, are you
referring to some Flex/flash specific tech? Or are you just suggesting
we whip up a web service that funnels the tile requests from our server
to the original host?

 

We had considered that, but are not all that keen to do it that way as
it increases server load and will increase round-trip times.

 

Is there really no other way?

 

Guy

 

 

On 18/02/2009, at 10:22 AM, Alex Harui wrote:






You can load foreign content, but you can't touch it.  There are
potential security issues involving sniffing through images of charts
and what not.

 

Normally you get around this using a proxy server

 

Alex Harui

Flex SDK Developer

Adobe Systems Inc. http://www.adobe.com/ 

Blog: http://blogs.adobe.com/aharui http://blogs.adobe.com/aharui 

 

From: flexcoders@yahoogroups.com [mailto:flexcoders@
mailto:flexcoders@ yahoogroups.com] On Behalf Of Guy Morton
Sent: Tuesday, February 17, 2009 4:20 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ImageSnapshot sandbox problem

 

Hi all

I'm using Virtual Earth and the UMap component (afcomponents.com) to 
display maps in my app. I want to use ImageSnapshot to capture the map 
(and my overlays) and allow the user to save it to disk etc. However, 
when I run the code on the server I get the dreaded sandbox issue:

SecurityError: Error #2122: Security sandbox violation: 
BitmapData.draw: http://www.blergh.com/bin/myapp.swf
http://www.blergh.com/bin/myapp.swf  cannot
accesshttp://us.maps1.yimg.com/us.tile.maps.yimg.com/tl?v=4.2md=2x=0y
=0z=2r=1
http://us.maps1.yimg.com/us.tile.maps.yimg.com/tl?v=4.2md=2x=0y=0z=
2r=1  
. A policy file is required, but the checkPolicyFile flag was not set 
when this media was loaded.
at flash.display::BitmapData/draw()
at mx.graphics::ImageSnapshot$/captureBitmapData()
at mx.graphics::ImageSnapshot$/captureImage()
at com.blergh.control::Map/saveSnapshot()
at com.blergh.view::SnapshotDialogue/generate()
at com.blergh.view::SnapshotDialogue/___SnapshotDialogue_Button2_click()

Now, first of all I don't really understand why if I can LOAD the maps 
in the first place (which I can) I'm not then able to copy them.

Secondly, MS doesn't put crossdomain.xml files on it's tile servers, 
so does that mean I'm up the proverbial creek without a paddle?

Guy

 

 





[flexcoders] Proxy scripts for crossdomain issues

2009-02-17 Thread Tracy Spratt
Here is a php proxy by our own Abdul Qabiz.  I'll post any others I find
as well.
http://www.abdulqabiz.com/blog/archives/general/php_proxy_script_for.php

Tracy Spratt
Lariat Services

Flex development bandwidth available




RE: [flexcoders] parse SOAP response for values

2009-02-17 Thread Tracy Spratt
One big hassle with SOAP is the namespaces.  Once you get that straight,
you can use normal e4x expressions on it. 

 

Where are you having difficulty?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of m_ollman
Sent: Wednesday, February 18, 2009 12:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] parse SOAP response for values

 

I have been looking around for a few hours - Flex Cookbook has some
info about mapping types. But no real method of getting into the
structure.

I need to grab the value of an attribute - abc570, which will be EOPO
+ 4 other attributes.

SOAP-ENV:Envelope
xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/
http://schemas.xmlsoap.org/soap/envelope/  

xmlns:typ=http://ruleburst.com/ruleserver/9.1/rulebase/types
http://ruleburst.com/ruleserver/9.1/rulebase/types 
SOAP-ENV:Header/
SOAP-ENV:Body
typ:assess-response
typ:session-data
typ:list-entity entity-type=global
typ:entity id=global_1

typ:attribute id=abc570 inferencing-type=intermediate type=text
typ:text-valEOPO/typ:text-val
/typ:attribute

** ETC - 4 more vales **

/typ:entity
/typ:list-entity
/typ:session-data
/typ:assess-response
/SOAP-ENV:Body
/SOAP-ENV:Envelope

Handler is 

private function RBcompleteHandler(event:Event) : void
{

var dataXML:XML = XML(event.target.data);
}

any help much appreciated

rgds
martin





RE: [flexcoders] is it possible to track visitors / the page an swf is embedded on

2009-02-17 Thread Tracy Spratt
Look into the BrowserManager, perhaps it will help.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of uclamerrick
Sent: Wednesday, February 18, 2009 12:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] is it possible to track visitors / the page an swf
is embedded on

 

Lets say I run a video site like youtube, how can I capture the url of
the page where my swf object is embedded.

For example someone takes the embed code from
http://youtube.com/videoid123 http://youtube.com/videoid123  and
places it onto the page at
http://myblog.wordpress.com/this_video_rocks
http://myblog.wordpress.com/this_video_rocks 

I know how to use HTTPService to report this information back to my
server and store it in the database, but I don't know how to use Flex
3 / Actionscript 3 to determine the URL of the page that embeds an
swf. In the example above I would want to capture:

http://myblog.wordpress.com/this_video_rocks
http://myblog.wordpress.com/this_video_rocks 

Thanks.





RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

2009-02-16 Thread Tracy Spratt
Search the archives for; addChild reference array

 

One example:

_aChildren[one] = tiletest.addChild(moduleloader);

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of - -
Sent: Monday, February 16, 2009 2:20 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

 

Hi tracy, where can I find some docs on taking references from childs?

Thanks.

 



From: Tracy Spratt tspr...@lariatinc.com
To: flexcoders@yahoogroups.com
Sent: Monday, February 16, 2009 12:20:05 AM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

...set their IDs...  That does not work in actionscript, only in mxml.
You need to take the reference from addChild, and put in your array.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcod...@yahoogro ups.com http://ups.com/  [mailto:flexcoders@
yahoogroups. com] On Behalf Of - -
Sent: Sunday, February 15, 2009 4:04 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

 

Hi Tracy, I have a little more complicated situation... 

My linkButtons are now created with actionScript (addChild). 

I set their IDs before adding them to their parent.

My action script also fills up my Array of linkButton IDs called
buttons.

 

[Bindable]

private var buttons:Array = new Array();

 

for each (var itemsIDs:String in buttons)

{ 

trace(itemsIDs);

this[itemsIDs].setStyle (styleName,linkButton);

}


My trace properly returns all the IDs of my buttons but I get the
following error:

Property test001 not found... and there is no default value.

It's like I don't have access to the ID of my linkButtons because they
were created via the ADDCHILD ???

Is this possible?

 

Any ideas how I can get around this?

 

Thanks again :)

 

-David

 

 



From: Tracy Spratt tspr...@lariatinc. com
To: flexcod...@yahoogro ups.com
Sent: Friday, February 13, 2009 5:49:57 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

styleName is not a property, it is a style. You have to use setStyle();

Also, debug your loop, make sure you have a good refrence to the button.

Tracy Spratt 
Lariat Services 
Flex development bandwidth available 
 _ _ _ _
From: flexcod...@yahoogro ups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcod...@yahoogro ups.com
mailto:flexcoders%40yahoogroups.com ] On Behalf Of - -
Sent: Friday, February 13, 2009 5:31 PM
To: flexcod...@yahoogro ups.com mailto:flexcoders%40yahoogroups.com 
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

Hi Tracy, I can get it to work as a var, but when I try to access the
Array, I get: 
Cannot access a property or method of a null object reference.

This is my array:
 
[Bindable]
private var buttons:Array = new Array(test001 , test002, test003);
 
for each(var target:String in buttons)
{
this[target] .styleName = linkButton; 
}
 
Thanks again! :)

 _ _ _ _
From: Tracy Spratt tspr...@lariatinc. com
mailto:tspratt%40lariatinc.com 
To: flexcod...@yahoogro ups.com mailto:flexcoders%40yahoogroups.com 
Sent: Friday, February 13, 2009 5:15:22 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
Yes, sailorsea, see that link.
 
Also, be careful of terminology.  I said store references.  This is
not the same as storing IDs.
 
You can do this using ids, with bracket notation.  
var sId:String = test001;
this[sId].setStyle( );  //should work
 
Tracy Spratt 
Lariat Services 
Flex development bandwidth available 
 _ _ _ _
From: flexcod...@yahoogro ups.com http://ups.com/  [mailto:flexcoders@
yahoogroups. com] On Behalf Of Ryan Graham
Sent: Friday, February 13, 2009 5:08 PM
To: flexcod...@yahoogro ups.com
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
Hey now, you knew this was in the docs... :D
 
http://livedocs. http://livedocs./  adobe.com/ flex/3/html/ help.html?
content=03_ Language_ and_Syntax_ 16.html
 
HTH,
Ryan
 
From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com]
On Behalf Of - -
Sent: Friday, February 13, 2009 2:28 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
Hi Tracy, I created an array of all the IDs of my linkButtons, can you
show me an example how to loop in the array?
 
Thanks.
 
 _ _ _ _
From: Tracy Spratt tspr...@lariatinc. com
To: flexcod...@yahoogro ups.com
Sent: Friday, February 13, 2009 4:11:05 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
Store references to each in an Array, then loop over the array.
 
Tracy Spratt 
Lariat Services 
Flex development bandwidth available 
 _ _ _ _
From: flexcod

RE: [flexcoders] open new browser in maximized state

2009-02-16 Thread Tracy Spratt
Write a javascript function in the html wrapper that actually opens the
browser, and use ExternalInterface to call that function.

 

  function showHelp(sURL)

  {

if (windowHelp  windowHelp.open  !windowHelp.closed)  {//Be
SURE the window is available

  if (sURL != sLastURL  sURL.length  0)  {  //If
user wants a new url

windowHelp.location.href = sURL;
//navigate

sLastURL = sURL;

  }

  windowHelp.focus();
//always focus

}

else  {

  if (sURL.length  0)  {
//make sure we have an url

var iBorderWidth = 50;

var iLeft = window.screenLeft;

var iTop = window.screenTop;

var iWidth = document.body.offsetWidth;

var iHeight = document.body.offsetHeight;   



var sWindowProperties =
location=no,toolbar=no,scrollbars=yes,menubar=no,resizable=yes

sWindowProperties += ,top= + (iTop + iBorderWidth);

sWindowProperties += ,left= + (iLeft + iBorderWidth);

sWindowProperties += ,height=500;

sWindowProperties += ,width=400;

windowHelp = window.open(sURL,'Help',sWindowProperties);

sLastURL = sURL;

  }

}

  }//showHelp

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of GeeTee
Sent: Monday, February 16, 2009 2:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] open new browser in maximized state

 


Hi everyone,

Can anyone let me know if it is possible using Flex / AS to open a new
browser (using navigateToURL(arg1,_blank)) with the new browser in
maximized state? On my system, it always opens at a smaller size and
does
not create a good user experience.

Thanks.
Gaurav
-- 
View this message in context:
http://www.nabble.com/open-new-browser-in-maximized-state-tp22044344p220
44344.html
http://www.nabble.com/open-new-browser-in-maximized-state-tp22044344p22
044344.html 
Sent from the FlexCoders mailing list archive at Nabble.com.





RE: [flexcoders] open new browser in maximized state

2009-02-16 Thread Tracy Spratt
And the Flex side:
var sLoadUrl:String = _sSiteAssetsUrl + help/ + sFileName;
ExternalInterface.call(showHelp, sLoadUrl);   

Tracy Spratt 
Lariat Services 
Flex development bandwidth available 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Tracy Spratt
Sent: Monday, February 16, 2009 3:56 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] open new browser in maximized state

Write a javascript function in the html wrapper that actually opens the 
browser, and use ExternalInterface to call that function.
 
  function showHelp(sURL)
  {
    if (windowHelp  windowHelp.open  !windowHelp.closed)  {    //Be SURE 
the window is available
  if (sURL != sLastURL  sURL.length  0)  {  //If user 
wants a new url
    windowHelp.location.href = sURL;   //navigate
    sLastURL = sURL;
  }
  windowHelp.focus();  //always 
focus
    }
    else  {
  if (sURL.length  0)  {  //make sure 
we have an url
    var iBorderWidth = 50;
    var iLeft = window.screenLeft;
    var iTop = window.screenTop;
    var iWidth = document.body.offsetWidth;
    var iHeight = document.body.offsetHeight;   
    
    var sWindowProperties = 
location=no,toolbar=no,scrollbars=yes,menubar=no,resizable=yes
    sWindowProperties += ,top= + (iTop + iBorderWidth);
    sWindowProperties += ,left= + (iLeft + iBorderWidth);
    sWindowProperties += ,height=500;
    sWindowProperties += ,width=400;
    windowHelp = window.open(sURL,'Help',sWindowProperties);
    sLastURL = sURL;
  }
    }
  }//showHelp
 
Tracy Spratt 
Lariat Services 
Flex development bandwidth available 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of GeeTee
Sent: Monday, February 16, 2009 2:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] open new browser in maximized state
 

Hi everyone,

Can anyone let me know if it is possible using Flex / AS to open a new
browser (using navigateToURL(arg1,_blank)) with the new browser in
maximized state? On my system, it always opens at a smaller size and does
not create a good user experience.

Thanks.
Gaurav
-- 
View this message in context: 
http://www.nabble.com/open-new-browser-in-maximized-state-tp22044344p22044344.html
Sent from the FlexCoders mailing list archive at Nabble.com.




RE: [flexcoders] Need advise on how to display multiple SWF apps

2009-02-16 Thread Tracy Spratt
HBox, Repeater, and repeat a custom component containing SWFLoader.  The
custom component wrapper will make it easier when you want to interact
with the items.

 

But wait, that is only if you need the charts to be their own
Application.  Why not just use instances the same charting component
with different data?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of todd.bruner
Sent: Monday, February 16, 2009 3:59 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Need advise on how to display multiple SWF apps

 

I have developed a small flex charting app that displays a graph based
on xml returned from a web service. Works great. Now I want to
display many of these charts in a single interface. The idea is to
have 3 or so of these charts in a horizontal line say C1, C2, C3. At
a time interval or a click event from the user, I'd like to shift C1
off screen to the left, Shift C2 to C1's former location, C3 to C2's
former location and finally add C4 to C3's former location. (and the
reverse if the user clicks the to the right). I'm open to doing
this with JavaScript/HTML or inside another FLEX application.

I thought I saw a demo (with source) once that had something similar
where each picture in a gallery was a flash movie and you could
walk through the gallery. Unfortunately, my googling has not turned
that up again. 

Can anyone point me to an example that I could extrapolate from? I'm
new to flex programming so I apologize if this something I should
just know how to do. (pointers on where to learn that, appreciated
as well.)

Thanks in advance for any help or pointers.

Todd





RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

2009-02-15 Thread Tracy Spratt
...set their IDs...  That does not work in actionscript, only in mxml.
You need to take the reference from addChild, and put in your array.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of - -
Sent: Sunday, February 15, 2009 4:04 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

 

Hi Tracy, I have a little more complicated situation... 

My linkButtons are now created with actionScript (addChild). 

I set their IDs before adding them to their parent.

My action script also fills up my Array of linkButton IDs called
buttons.

 

[Bindable]

private var buttons:Array = new Array();

 

for each (var itemsIDs:String in buttons)

{ 

trace(itemsIDs);

this[itemsIDs].setStyle(styleName,linkButton);

}


My trace properly returns all the IDs of my buttons but I get the
following error:

Property test001 not found... and there is no default value.

It's like I don't have access to the ID of my linkButtons because they
were created via the ADDCHILD ???

Is this possible?

 

Any ideas how I can get around this?

 

Thanks again :)

 

-David

 

 



From: Tracy Spratt tspr...@lariatinc.com
To: flexcoders@yahoogroups.com
Sent: Friday, February 13, 2009 5:49:57 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

styleName is not a property, it is a style. You have to use setStyle();

Also, debug your loop, make sure you have a good refrence to the button.

Tracy Spratt 
Lariat Services 
Flex development bandwidth available 
 _ _ _ _
From: flexcod...@yahoogro ups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcod...@yahoogro ups.com
mailto:flexcoders%40yahoogroups.com ] On Behalf Of - -
Sent: Friday, February 13, 2009 5:31 PM
To: flexcod...@yahoogro ups.com mailto:flexcoders%40yahoogroups.com 
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

Hi Tracy, I can get it to work as a var, but when I try to access the
Array, I get: 
Cannot access a property or method of a null object reference.

This is my array:
 
[Bindable]
private var buttons:Array = new Array(test001 , test002, test003);
 
for each(var target:String in buttons)
{
this[target] .styleName = linkButton; 
}
 
Thanks again! :)

 _ _ _ _
From: Tracy Spratt tspr...@lariatinc. com
mailto:tspratt%40lariatinc.com 
To: flexcod...@yahoogro ups.com mailto:flexcoders%40yahoogroups.com 
Sent: Friday, February 13, 2009 5:15:22 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
Yes, sailorsea, see that link.
 
Also, be careful of terminology.  I said store references.  This is
not the same as storing IDs.
 
You can do this using ids, with bracket notation.  
var sId:String = test001;
this[sId].setStyle( );  //should work
 
Tracy Spratt 
Lariat Services 
Flex development bandwidth available 
 _ _ _ _
From: flexcod...@yahoogro ups.com http://ups.com/  [mailto:flexcoders@
yahoogroups. com] On Behalf Of Ryan Graham
Sent: Friday, February 13, 2009 5:08 PM
To: flexcod...@yahoogro ups.com
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
Hey now, you knew this was in the docs... :D
 
http://livedocs. http://livedocs./  adobe.com/ flex/3/html/ help.html?
content=03_ Language_ and_Syntax_ 16.html
 
HTH,
Ryan
 
From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com]
On Behalf Of - -
Sent: Friday, February 13, 2009 2:28 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
Hi Tracy, I created an array of all the IDs of my linkButtons, can you
show me an example how to loop in the array?
 
Thanks.
 
 _ _ _ _
From: Tracy Spratt tspr...@lariatinc. com
To: flexcod...@yahoogro ups.com
Sent: Friday, February 13, 2009 4:11:05 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
Store references to each in an Array, then loop over the array.
 
Tracy Spratt 
Lariat Services 
Flex development bandwidth available 
 _ _ _ _
From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com]
On Behalf Of sailorsea21
Sent: Friday, February 13, 2009 4:01 PM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
I have a series of 3 linkButtons.
I am able to switch the styleName of a linkButton when I click on it 
as follows:

[Bindable]
private var linkButton:String = 'linkButton' ;

[Bindable]
private var linkButtonOff: String = 'linkButtonOff' ;

mx:LinkButton id=test001 label=001 styleName={ linkButton}  
buttonMode= true click=setType( event)/

mx:LinkButton id=test002 label=002 styleName={ linkButton}  
buttonMode= true click=setType( event)/

mx:LinkButton id=test003 label=003 styleName={ linkButton}  
buttonMode= true click=setType( event)/

private

RE: [flexcoders] Re: Socket communications in Flex

2009-02-14 Thread Tracy Spratt
Yes.  I wrote a socket server in VB.Net that talked to a Flex app.  It
was years ago but I'll send you the code if you like.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markgoldin_2000
Sent: Saturday, February 14, 2009 11:42 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Socket communications in Flex

 

I am not sure myself about my question :).
First, can Flex be listening to a socket that is created within 
any program? I mean, if a vb program creates a socket using 
Winsock will Flex be able to listen to such socket?
Second, if yes, how would data actually be transfered?

Thanks

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Guy Morton g...@... wrote:

 Well...nothing would, normally. You'd have to set up a server to 
talk 
 to you on that socket, develop a protocol for conversing over 
the 
 socket, etc.
 
 An XML socket is just a pipe to communicate over. Unlike normal 
http 
 requests which encapsulate the http conversation so you don't 
see it, 
 a raw XML socket requires you to define what messages are going 
to be 
 sent by whom and what those messages mean.
 
 Does that help, or have I misunderstood your question?
 
 Guy
 
 
 On 14/02/2009, at 10:50 PM, markgoldin_2000 wrote:
 
  I am trying to understand how socket communications work in 
flex.
  This code will connect to a port 8080 on a local computer:
 
  var xmlsock:XMLSocket = new XMLSocket();
  xmlsock.connect(127.0.0.1, 8080);
 
  But what I dont understand is what would be sending data to 
that
  port?
 
  Thanks
 
 
 






RE: [flexcoders] HTML advice please

2009-02-13 Thread Tracy Spratt
I have tried a couple and I prefer Alistair Rutherford's component.

http://ccgi.arutherford.plus.com/blog/wordpress/?page_id=171
http://ccgi.arutherford.plus.com/blog/wordpress/?page_id=171 

 

Note that a fairly recent change to the code has made it so that it
requires history management in the Flex wrapper,  Since I always turn
this off, I had to make a small modification to the code to make it work
for me.

 

But other than that, it works flawlessly, seamlessly, in a word, great.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Maya Tulchinsky
Sent: Friday, February 13, 2009 8:38 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] HTML  advice please

 

Check out this one:
http://www.deitte.com/IFrameDemo3/IFrameDemo.html

Here is blog about Iframe use in flex:
http://www.themidnightcoders.com/blog/2006/12/mixing-html-and-flex-using
-iframe.html

Good luck,

Maya


--- On Fri, 2/13/09, aphexyuri yuriv...@yahoo.co.uk wrote:

From: aphexyuri yuriv...@yahoo.co.uk
Subject: [flexcoders] HTML  advice please
To: flexcoders@yahoogroups.com
Date: Friday, February 13, 2009, 5:31 AM

Hi All

As far as I know, we can't load complex HTML pages into a Flex
control, but I was wondering if anybody has had experience with this.

Its for a dashboard app that has flex elements, but must be able to
load full websites into specific containers of the dashboard.

I'm not sure what other technologies would be able to do this, Ajax,
JavaScript?

Any suggestions would be appreciated. ..thanks

Yuri

 





RE: [flexcoders] how to bubble and catch events

2009-02-13 Thread Tracy Spratt
That should work, the second argument in the event constructor makes it
bubble.

 

I don't see your listener defined.  You should do that in a function
called on creation complete of the application:

this.addEventListener(Event.ADDED, onAction)

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stevepruitt97
Sent: Friday, February 13, 2009 12:08 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] how to bubble and catch events

 

I have the following scenario. I need to catch the click events for 
either of the two buttons. I tried putting the event handler on the 
DataGrid, but I'm getting an unresolved error for it. Is this even 
possible?

Thanks in advance for any help.

-S

mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml
http://www.adobe.com/2006/mxml 
mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import 
mx.controls.dataGridClasses.DataGridItemRenderer;

[Bindable]
private var _content : ArrayCollection = new 
ArrayCollection();

:
:

private function onAction(event : Event) : void
{
trace(got action:  + event.target.id);
}
]]
/mx:Script
mx:DataGrid id=templateGrid width=100% height=100% 
rowCount=5 dataProvider={_content} action=onAction(event)
mx:columns
mx:DataGridColumn id=actionColumn headerText=Action
mx:itemRenderer
mx:Component
mx:ViewStack
mx:Metadata
[Event(name = action, type 
= flash.events.Event)]
/mx:Metadata
mx:Script
![CDATA[
private function onAction(event : 
Event) : void
{
trace(action:  + event.target.id);
var e : Event;

if(event.target.id == adder)
e = new Event(Event.ADDED, 
true);
if(event.target.id == deleter)
e = new Event(Event.REMOVED, 
true);

dispatchEvent(e);
}
]]
/mx:Script
mx:Text text=/
mx:Button id=adder label=Add 
click=onAction(event)/
mx:Button id=deleter label=Delete 
click=onAction(event)/
/mx:ViewStack 
/mx:Component
/mx:itemRenderer
/mx:DataGridColumn
!--mx:DataGridColumn dataField=index headerText=ID/--

mx:DataGridColumn dataField=title 
headerText=Template/
mx:DataGridColumn dataField=description 
headerText=Description/
mx:DataGridColumn dataField=version 
headerText=Version/
/mx:columns
/mx:DataGrid
/mx:Canvas





RE: [flexcoders] Re: filter arraycollection with checkbox acting wired

2009-02-13 Thread Tracy Spratt
I think I suggested already that you just need to debug this.  Find an
item that does not filter as you expect, step through the code til you
hit that item, then step through the code to see why the filter function
is not returning the expected value.  It will almost certainly be
obvious.

 

For us to help, we need to do that process a a thought experiment.  It
will be much easier for you do do it in the debugger.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of johndoematrix
Sent: Friday, February 13, 2009 10:54 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: filter arraycollection with checkbox acting
wired

 

can someone please help me out here..thanks





RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

2009-02-13 Thread Tracy Spratt
Store references to each in an Array, then loop over the array.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of sailorsea21
Sent: Friday, February 13, 2009 4:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

 

I have a series of 3 linkButtons.
I am able to switch the styleName of a linkButton when I click on it 
as follows:

[Bindable]
private var linkButton:String = 'linkButton';

[Bindable]
private var linkButtonOff:String = 'linkButtonOff';

mx:LinkButton id=test001 label=001 styleName={linkButton} 
buttonMode=true click=setType(event)/

mx:LinkButton id=test002 label=002 styleName={linkButton} 
buttonMode=true click=setType(event)/

mx:LinkButton id=test003 label=003 styleName={linkButton} 
buttonMode=true click=setType(event)/

private function setType(result:Event):void
{
result.currentTarget.styleName = linkButtonOff;
}

How can I automatically reset all the other linkButtons styleNames 
to {linkButton} when a linkButton is clicked?

Thank you.





RE: [flexcoders] Re: how to bubble and catch events

2009-02-13 Thread Tracy Spratt
Iv'e lost you.  If this is no longer about bubbling and catching events,
start a new thread.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stevepruitt97
Sent: Friday, February 13, 2009 1:34 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: how to bubble and catch events

 

I have bigger problems. By changing the events to standard ADD and 
REMOVE and modifying

mx:DataGrid id=templateGrid width=100% height=100% 
rowCount=5 dataProvider={_content} click=onTemplateSelected
(event) add=onAdd(event) remove=onRemove(event)

I at least got past the compile problems. I am now trying to select 
the view choices in the ViewStack with

actionColumn.selectedIndex = 1;

But actionColumn is not visible at the top level. This is my first 
foray into embedded components and trying to inline renderers. I may 
have to break down and start customizing.

Thanks in advance.

-S

mx:DataGrid id=templateGrid width=100% height=100% 
rowCount=5 dataProvider={_content} click=onTemplateSelected
(event) add=onAdd(event) remove=onRemove(event)
mx:columns
mx:DataGridColumn id=actionColumn headerText=Action
mx:itemRenderer
mx:Component
mx:ViewStack id=actionChoices
--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:

 That should work, the second argument in the event constructor 
makes it
 bubble.
 
 
 
 I don't see your listener defined. You should do that in a function
 called on creation complete of the application:
 
 this.addEventListener(Event.ADDED, onAction)
 
 
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of stevepruitt97
 Sent: Friday, February 13, 2009 12:08 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] how to bubble and catch events
 
 
 
 I have the following scenario. I need to catch the click events for 
 either of the two buttons. I tried putting the event handler on the 
 DataGrid, but I'm getting an unresolved error for it. Is this even 
 possible?
 
 Thanks in advance for any help.
 
 -S
 
 mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml
http://www.adobe.com/2006/mxml 
 http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml  
 mx:Script
 ![CDATA[
 import mx.collections.ArrayCollection;
 import 
 mx.controls.dataGridClasses.DataGridItemRenderer;
 
 [Bindable]
 private var _content : ArrayCollection = new 
 ArrayCollection();
 
 :
 :
 
 private function onAction(event : Event) : void
 {
 trace(got action:  + event.target.id);
 }
 ]]
 /mx:Script
 mx:DataGrid id=templateGrid width=100% height=100% 
 rowCount=5 dataProvider={_content} action=onAction(event)
 mx:columns
 mx:DataGridColumn id=actionColumn headerText=Action
 mx:itemRenderer
 mx:Component
 mx:ViewStack
 mx:Metadata
 [Event(name = action, type 
 = flash.events.Event)]
 /mx:Metadata
 mx:Script
 ![CDATA[
 private function onAction(event : 
 Event) : void
 {
 trace(action:  + event.target.id);
 var e : Event;
 
 if(event.target.id == adder)
 e = new Event(Event.ADDED, 
 true);
 if(event.target.id == deleter)
 e = new Event(Event.REMOVED, 
 true);
 
 dispatchEvent(e);
 }
 ]]
 /mx:Script
 mx:Text text=/
 mx:Button id=adder label=Add 
 click=onAction(event)/
 mx:Button id=deleter label=Delete 
 click=onAction(event)/
 /mx:ViewStack 
 /mx:Component
 /mx:itemRenderer
 /mx:DataGridColumn
 !--mx:DataGridColumn dataField=index headerText=ID/--
 
 mx:DataGridColumn dataField=title 
 headerText=Template/
 mx:DataGridColumn dataField=description 
 headerText=Description/
 mx:DataGridColumn dataField=version 
 headerText=Version/
 /mx:columns
 /mx:DataGrid
 /mx:Canvas






RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

2009-02-13 Thread Tracy Spratt
Yes, sailorsea, see that link.

 

Also, be careful of terminology.  I said store references.  This is
not the same as storing IDs.

 

You can do this using ids, with bracket notation.  

var sId:String = test001;

this[sId].setStyle();  //should work

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Ryan Graham
Sent: Friday, February 13, 2009 5:08 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

 

Hey now, you knew this was in the docs... :D

 

http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_
Syntax_16.html
http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and
_Syntax_16.html 

 

HTH,

Ryan

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of - -
Sent: Friday, February 13, 2009 2:28 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

 

Hi Tracy, I created an array of all the IDs of my linkButtons, can you
show me an example how to loop in the array?

 

Thanks.

 



From: Tracy Spratt tspr...@lariatinc.com
To: flexcoders@yahoogroups.com
Sent: Friday, February 13, 2009 4:11:05 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

Store references to each in an Array, then loop over the array.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcod...@yahoogro ups.com http://ups.com/  [mailto:flexcoders@
yahoogroups. com] On Behalf Of sailorsea21
Sent: Friday, February 13, 2009 4:01 PM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

 

I have a series of 3 linkButtons.
I am able to switch the styleName of a linkButton when I click on it 
as follows:

[Bindable]
private var linkButton:String = 'linkButton' ;

[Bindable]
private var linkButtonOff: String = 'linkButtonOff' ;

mx:LinkButton id=test001 label=001 styleName={ linkButton}  
buttonMode= true click=setType( event)/

mx:LinkButton id=test002 label=002 styleName={ linkButton}  
buttonMode= true click=setType( event)/

mx:LinkButton id=test003 label=003 styleName={ linkButton}  
buttonMode= true click=setType( event)/

private function setType(result: Event):void
{
result.currentTarge t.styleName = linkButtonOff;
}

How can I automatically reset all the other linkButtons styleNames 
to {linkButton}  when a linkButton is clicked?

Thank you.

 

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





RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

2009-02-13 Thread Tracy Spratt
styleName is not a property, it is a style.  You have to use setStyle();

Also, debug your loop, make sure you have a good refrence to the button.

Tracy Spratt 
Lariat Services 
Flex development bandwidth available 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of - -
Sent: Friday, February 13, 2009 5:31 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

Hi Tracy, I can get it to work as a var, but when I try to access the Array, I 
get: 
Cannot access a property or method of a null object reference.

This is my array:
 
[Bindable]
private var buttons:Array = new Array(test001, test002, test003);
 
for each(var target:String in buttons)
{
this[target].styleName = linkButton; 
}
 
Thanks again! :)


From: Tracy Spratt tspr...@lariatinc.com
To: flexcoders@yahoogroups.com
Sent: Friday, February 13, 2009 5:15:22 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
Yes, sailorsea, see that link.
 
Also, be careful of terminology.  I said store references.  This is not the 
same as storing IDs.
 
You can do this using ids, with bracket notation.  
var sId:String = test001;
this[sId].setStyle( );  //should work
 
Tracy Spratt 
Lariat Services 
Flex development bandwidth available 

From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of Ryan Graham
Sent: Friday, February 13, 2009 5:08 PM
To: flexcod...@yahoogro ups.com
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
Hey now, you knew this was in the docs... :D
 
http://livedocs. adobe.com/ flex/3/html/ help.html? content=03_ Language_ 
and_Syntax_ 16.html
 
HTH,
Ryan
 
From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of - -
Sent: Friday, February 13, 2009 2:28 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
Hi Tracy, I created an array of all the IDs of my linkButtons, can you show me 
an example how to loop in the array?
 
Thanks.
 

From: Tracy Spratt tspr...@lariatinc. com
To: flexcod...@yahoogro ups.com
Sent: Friday, February 13, 2009 4:11:05 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
Store references to each in an Array, then loop over the array.
 
Tracy Spratt 
Lariat Services 
Flex development bandwidth available 

From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of sailorsea21
Sent: Friday, February 13, 2009 4:01 PM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
I have a series of 3 linkButtons.
I am able to switch the styleName of a linkButton when I click on it 
as follows:

[Bindable]
private var linkButton:String = 'linkButton' ;

[Bindable]
private var linkButtonOff: String = 'linkButtonOff' ;

mx:LinkButton id=test001 label=001 styleName={ linkButton}  
buttonMode= true click=setType( event)/

mx:LinkButton id=test002 label=002 styleName={ linkButton}  
buttonMode= true click=setType( event)/

mx:LinkButton id=test003 label=003 styleName={ linkButton}  
buttonMode= true click=setType( event)/

private function setType(result: Event):void
{
result.currentTarge t.styleName = linkButtonOff;
}

How can I automatically reset all the other linkButtons styleNames 
to {linkButton}  when a linkButton is clicked?

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





RE: [flexcoders] Is there a 'token' equivalent to use with the URLLoader class?

2009-02-13 Thread Tracy Spratt
What does the class reference say about that method?

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of luvfotography
Sent: Friday, February 13, 2009 5:35 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Is there a 'token' equivalent to use with the
URLLoader class?

 

Is there a 'token' equivalent to use with the URLLoader class?

I need to keep track of my events.

I can use token with an HttpService.send() request, how do I use it
with URLLoader?

ex:

var myloader:URLLoader = new URLLoader();
myloader.addEventListener(Event.COMPLETE, loadHandler);
var token:AsyncToken = myloader.load(new URLRequest(getdata.com)); 
token.artist = artist; 

I get:
1067: Implicit coercion of a value of type void to an unrelated type
mx.rpc:AsyncToken.





RE: [flexcoders] Re: Events and Child SWFs

2009-02-12 Thread Tracy Spratt
You are misunderstanding how listeners work.  You add the listener to
the component that *dispatches* the event, and have it call a method
where you want the action to take place.

 

parent just goes up one component.  The surest way to do this is to
use Application.application.addEventListener().

 

A bubbling event will hot help you going in this direction (down to the
child) 

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stldvd
Sent: Thursday, February 12, 2009 1:02 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Events and Child SWFs

 

Hi Steve,

But I need the child swf to react, not the parent. So I think the
listener has to be in the child, not the parent.

David

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Steve Mathews happy...@... wrote:

 You are assigning the listener to the wrong object. this is your
child
 swf, but it is the parent that dispatches the event. Depending on
the rest
 of the app this.parent might work. So:
 this.parent.addEventListener(inDeleteMode, deleteModeHandler);
 
 Steve
 
 On Thu, Feb 12, 2009 at 10:44 AM, stldvd stl...@... wrote:
 
  Hi guys,
 
  I've got a parent application with a 'delete' button. When it's
  clicked, I want to set a flag in a child swf, which is loaded via
SWF
  loader.
 
  So in the parent app on the button's click event I'm dispatching
an event:
 
  dispatchEvent(new Event(inDeleteMode));
 
  In the child SWF's init function I've got this:
 
  this.addEventListener(inDeleteMode, deleteModeHandler);
 
  And then the deleteModeHandler function (stubbed in for testing):
 
  private function deleteModeHandler():Boolean
  {
  Alert.show(got it!);
  return true;
  }
 
  It ain't working. Can someone see what I'm doing wrong?
 
  Thanks,
 
  David
 
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
  Alternative FAQ location:
 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-
1e62079f6847
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf
-1e62079f6847 
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo ! Groups
  Links
 
 
 
 






RE: [flexcoders] Re: Events and Child SWFs

2009-02-12 Thread Tracy Spratt
No, you are mistaken.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Wally Kolcz
Sent: Thursday, February 12, 2009 1:25 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Events and Child SWFs

 

I thought the child of the parent (main application) would be up the
chain. The child has to listen and react to the event dispatched by the
main application. 

I've got a parent application with a 'delete' button. When it's
clicked, I want to set a flag in a child swf, which is loaded via SWF
loader. 



From: Tracy Spratt tspr...@lariatinc.com
Sent: Thursday, February 12, 2009 10:16 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Events and Child SWFs

You are misunderstanding how listeners work.  You add the listener to
the component that *dispatches* the event, and have it call a method
where you want the action to take place.

 

parent just goes up one component.  The surest way to do this is to
use Application.application.addEventListener().

 

A bubbling event will hot help you going in this direction (down to the
child) 

 

Tracy Spratt
Lariat Services

Flex development bandwidth available



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stldvd
Sent: Thursday, February 12, 2009 1:02 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Events and Child SWFs

 

Hi Steve,

But I need the child swf to react, not the parent. So I think the
listener has to be in the child, not the parent.

David

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Steve Mathews happy...@... wrote:

 You are assigning the listener to the wrong object. this is your
child
 swf, but it is the parent that dispatches the event. Depending on
the rest
 of the app this.parent might work. So:
 this.parent.addEventListener(inDeleteMode, deleteModeHandler);
 
 Steve
 
 On Thu, Feb 12, 2009 at 10:44 AM, stldvd stl...@... wrote:
 
  Hi guys,
 
  I've got a parent application with a 'delete' button. When it's
  clicked, I want to set a flag in a child swf, which is loaded via
SWF
  loader.
 
  So in the parent app on the button's click event I'm dispatching
an event:
 
  dispatchEvent(new Event(inDeleteMode));
 
  In the child SWF's init function I've got this:
 
  this.addEventListener(inDeleteMode, deleteModeHandler);
 
  And then the deleteModeHandler function (stubbed in for testing):
 
  private function deleteModeHandler():Boolean
  {
  Alert.show(got it!);
  return true;
  }
 
  It ain't working. Can someone see what I'm doing wrong?
 
  Thanks,
 
  David
 
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
  Alternative FAQ location:
 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-
1e62079f6847
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf
-1e62079f6847 
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo ! Groups
  Links
 
 
 
 


 





RE: [flexcoders] Re: Events and Child SWFs

2009-02-12 Thread Tracy Spratt
...listener in the same component that dispatches the event... No, not
quite.   When you do Component.addEventListener(), you are telling the
current component to listen to Component for an event and run a method.

 

The declaration happens where you have the handler method, but you call
addListener using a reference to the component dispatching the event.

 

To set a listener for a non-bubbling event, you must have a reference to
the dispatching object.

 

For bubbling events, you only need to have a reference to some component
in the dispatching conponent's parent chain.  Application.application is
at the top, except for Popups.  Then SystemManager is the top.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stldvd
Sent: Thursday, February 12, 2009 2:32 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Events and Child SWFs

 

Hi Tracy,

Thanks for responding.

Here is my understanding:

1) The idea behind events and event listeners is that you can dispatch
an event anywhere in the app and listen for it anywhere else in the
app, assuming that bubbling is set correctly, and/or that you've used
Application.application.addEventListener() or
SystemManager.addEventListener(). What you're saying, then, is that
the preferred way to accomplish this is by having the listener in the
same component that dispatches the event, and have it call a method
that is in the second component. But you *could* just have the
listener in the second component, right?

2) Then, to do it as you suggest, the issue becomes how to reference
the second component from the first.

I've got the main app with a popup that holds the delete button. Since
the child swf is not loaded there, I'm not sure how to refer to it.
Elsewhere in the main app we load the swf with a load function:

load(url)

Inside the load() function are:
_loader = new SWFLoader();
...
_loader.addEventListener(complete, onChildLoaded );
_loader.load( url );
addChild( _loader );

So perhaps I could add the eventlistener there. I also think (correct
me if I'm wrong) that I need to refer to the loader's content, not the
loader itself. So the syntax would be:

_loader.content.addEventListener(inDeleteMode,
_loader.content.deleteModeHandler);

Do I have this right or am I completely confused? :)

Thanks,

David

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt tspr...@... wrote:

 You are misunderstanding how listeners work. You add the listener to
 the component that *dispatches* the event, and have it call a method
 where you want the action to take place.
 
 
 
 parent just goes up one component. The surest way to do this is to
 use Application.application.addEventListener().
 
 
 
 A bubbling event will hot help you going in this direction (down to
the
 child) 
 
 
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of stldvd
 Sent: Thursday, February 12, 2009 1:02 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Re: Events and Child SWFs
 
 
 
 Hi Steve,
 
 But I need the child swf to react, not the parent. So I think the
 listener has to be in the child, not the parent.
 
 David
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 , Steve Mathews happydog@ wrote:
 
  You are assigning the listener to the wrong object. this is your
 child
  swf, but it is the parent that dispatches the event. Depending on
 the rest
  of the app this.parent might work. So:
  this.parent.addEventListener(inDeleteMode, deleteModeHandler);
  
  Steve
  
  On Thu, Feb 12, 2009 at 10:44 AM, stldvd stldvd@ wrote:
  
   Hi guys,
  
   I've got a parent application with a 'delete' button. When it's
   clicked, I want to set a flag in a child swf, which is loaded via
 SWF
   loader.
  
   So in the parent app on the button's click event I'm dispatching
 an event:
  
   dispatchEvent(new Event(inDeleteMode));
  
   In the child SWF's init function I've got this:
  
   this.addEventListener(inDeleteMode, deleteModeHandler);
  
   And then the deleteModeHandler function (stubbed in for testing):
  
   private function deleteModeHandler():Boolean
   {
   Alert.show(got it!);
   return true;
   }
  
   It ain't working. Can someone see what I'm doing wrong?
  
   Thanks,
  
   David
  
  
  
   
  
   --
   Flexcoders Mailing List
   FAQ:
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
http://groups.yahoo.com/group

RE: [flexcoders] 15 seconds timeout will a progress bar help?

2009-02-12 Thread Tracy Spratt
Yep, last time I checked, there was an arbitrary maximum of 60 seconds.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Ryan Graham
Sent: Thursday, February 12, 2009 3:40 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] 15 seconds timeout will a progress bar help?

 

In Flex it's Application.scriptTimeLimit. If you're doing an AS3 only
project, try checking out the -default-script-limits compiler argument
to set a higher time.

 

HTH,

Ryan

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of flexaustin
Sent: Thursday, February 12, 2009 12:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] 15 seconds timeout will a progress bar help?

 

So I have a project that needs to build 1000 sprites on stage that
contain some tiny bitmap's but this is happening on startup in an all
AS3 project.

When the app starts and tries creating and rendering all 1000 items
nothing is shown and I get the application hasn't responded in 15
seconds exception.

Is there a way to make the app build all 1000 and not get the timeout?

TIA

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





RE: [flexcoders] ArrayCollection DataProvider question.

2009-02-11 Thread Tracy Spratt
That is not as bad as I thought it might be(I was expecting to see the
default resultFormat.  E4x is good!), but it is a bit odd.  You are
manually building an ArrayCollection of XML nodes.

 

I don't see any reason to do that.  Just use XMLListCollection, and
avoid the loop.

 

Now, best practice, or at least this list's apparent consensus of best
practice, is to do what you are doing, but instead of adding xml nodes,
you populate a strongly data typed Value Object and add tht to the
ArrayCollection.  This is probably the most efficient and performant
approach.

 

But I mostly use XML and XMLListCollection.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of - -
Sent: Wednesday, February 11, 2009 9:37 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection DataProvider question.

 

Hi Tracy, this is how I get the XML info into an ArrayCollection:

 

mx:HTTPService url=days.php useProxy=false method=POST id=Days
resultFormat=e4x result=get_days(event)

 

private function get_days(event:ResultEvent):void

{

Arraydays.removeAll();

XMLdays = event.result as XML;

for each(var ourxml:XML in XMLdays.elements())
Arraydays.addItem(ourxml);

}

Is this ok?

 

Thanks

 

-David

 



From: Tracy Spratt tspr...@lariatinc.com
To: flexcoders@yahoogroups.com
Sent: Tuesday, February 10, 2009 4:19:53 PM
Subject: RE: [flexcoders] ArrayCollection DataProvider question.

I suggest using e4x expressions against the XML, and then putting the
result in an XMLListCollection.

var xlResults:XMLList = xmlData.result. (attribute(id) == 1);

trace(xlResults. toXMLString( ));  //to verify your data

xlcResults = new XMLListCollection( xlResults) ;

 

You did not say how you got your XML into an ArrayCollection, but I
suspect it is not the good way.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcod...@yahoogro ups.com http://ups.com/  [mailto:flexcoders@
yahoogroups. com] On Behalf Of Henrique
Sent: Tuesday, February 10, 2009 2:19 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] ArrayCollection DataProvider question.

 

Humm, you have to make a filterFunction, like this:

 

private function filterFucntion( item:Object) :Boolean

{

   return item.id http://item.id/  == 1;

}

 

Henrique F. Marino

blog.dclick. com.br http://blog.dclick.com.br/ 

www.dclick.com. br http://www.dclick.com.br/ 

On Tue, Feb 10, 2009 at 3:35 PM, sailorsea21 sailorsea21@ yahoo.com
mailto:sailorse...@yahoo.com  wrote:

I loaded the following xml as an ArrayCollection. 

data
result id=1
datetoday/date
yes13154/yes
no654321/no 
/result
result id=1
dateyesterday/date
yes21354/yes
no5468432/no 
/result
result id=2
datetoday/date
yes2665/yes
no4256/no 
/result
result id=2
dateyesterday/date
yes7425/yes
no7542/no 
/result
/data

How can I use this as a dataprovider but only using the values in 
result id=1 and not result id=2?

My arraycollection var is Arraydays.
I tried {Arraydays.( @id=='2')} but it gave me an error: Error #1123: 
Filter operator...

Thanks.

 

 





RE: [flexcoders] Logic in dataProvider

2009-02-10 Thread Tracy Spratt
Yes, you use an e4x expression to return an XMLList.  A common issue
with attributes is that the @attrName syntax will error if ALL of the
nodes do not have that attribute. Instead use attribute(attrName).

 

So for your expression, it might be something like:

var xlNodes:XMLList = xmlData.node.(attribute(this).length()  0 ||
attribute(that).length()  0)

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of sandi.pond
Sent: Tuesday, February 10, 2009 11:18 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Logic in dataProvider

 

Hello all, I'm new to Flex and so full of questions ... Is there a way 
to use logic to determine a dataProvider for a list? By that I mean, I 
have 2 attributes in my XML nodes and one will always contain a value 
and the other will always not. For example,

node this= that /

And my XMLList may contain several nodes:

node this=value /
node thatanothervalue /
node this=andanother /

And then I have an mx:List that I'd like to display the attribute 
that has a value - either this or that. I've tried using the || 
statement but no luck yet. 

Thank you in advance.





<    3   4   5   6   7   8   9   10   11   12   >