Re: [flexcoders] Re: Dynamic Shared Object - Is This Possible?

2010-03-24 Thread Tom Chiverton
On Tuesday 23 Mar 2010, James wrote:
  for each(var str:String in profile1NewsAndSportaddList){
                 for each(var obj1:Object in
 profile1NewsAndSportaddLinksAC){ if(str == obj1.label){
                     profile1NewsAndSporttempAC1.addItem(obj1);
                     continue;
                   }
                 }

I was thinking you'd be better off adding everything from the remote 
collections, then do this sort of thing, but remember to check in the other 
AC too for 'obj.label'.

-- 
Helping to proactively engineer platforms as part of the IT team of the year 
2010, '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] Re: Dynamic Shared Object - Is This Possible?

2010-03-24 Thread Samuel Colak
Technically this isnt a dynamic object.

Using the dynamic keyword in a class definition.

Per the request, yes it is possible to use dynamic shared objects. From FMS or 
other services, all are cast of type of object.

You would have to cast them into a dynamic class definition or keep them as 
type object.

Regards
Sam


On Mar 24, 2010, at 10:50 AM, Tom Chiverton wrote:

 On Tuesday 23 Mar 2010, James wrote:
  for each(var str:String in profile1NewsAndSportaddList){
  for each(var obj1:Object in
  profile1NewsAndSportaddLinksAC){ if(str == obj1.label){
  profile1NewsAndSporttempAC1.addItem(obj1);
  continue;
}
  }
 
 I was thinking you'd be better off adding everything from the remote 
 collections, then do this sort of thing, but remember to check in the other 
 AC too for 'obj.label'.
 
 -- 
 Helping to proactively engineer platforms as part of the IT team of the year 
 2010, '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.
 
 
 




Disclaimer

_

The information transmitted is intended only for the person or entity to which 
it is addressed

and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination

or other use of, or taking of any action in reliance upon, this information by 
persons or entities

other than the intended recipient is prohibited. If you received this in error, 
please contact the

sender and delete the material from your computer. Thank you.



[flexcoders] Re: Dynamic Shared Object - Is This Possible?

2010-03-23 Thread James
Cheers Tom. Thanks sounds right but I'm unsure how to implement it. Previously 
I had it working using 2 array collections which I'd defined within the app. 
I've now commented out these array collections and have instead retrieved them 
via the last result method of a http request but it doesn't seem to be working. 
Here's what I've got so far. You can see where I've commented out my old array 
collections and replaced them with the new dynamic one's just above. I can't 
figure out what I'm doing wrong here:-

?xml version=1.0 encoding=utf-8?
mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute creationComplete=newsService.send(); 
initprofile1NewsAndSportSO()

mx:Script
![CDATA[

  import mx.rpc.events.ResultEvent;
  import mx.collections.*;
  import flash.net.SharedObject;

  public var profile1NewsAndSportSO:SharedObject;
  
  [Bindable]
  private var profile1NewsAndSportaddLinksFullAC:ArrayCollection;
  
  [Bindable]
  private var profile1NewsAndSportaddLinksAC:ArrayCollection;

  private function newsResultHandler(event:ResultEvent):void
  {
  
profile1NewsAndSportaddLinksFullAC=newsService.lastResult.newscategory.news as 
ArrayCollection;
  
profile1NewsAndSportaddLinksAC=newsService.lastResult.newscategory.news as 
ArrayCollection; 
  }
  
//  private var profile1NewsAndSportaddLinksFullAC:ArrayCollection = new 
ArrayCollection([
//{label:BBC News},
//{label:ITV},
//{label:Sky News}
//  ]);
  
//  private var profile1NewsAndSportaddLinksAC:ArrayCollection = new 
ArrayCollection([
//{label:BBC News},
//{label:ITV},
//{label:Sky News}
//  ]);
  
  private function profile1NewsAndSportReset():void{
resetprofile1NewsAndSportAC();
profile1NewsAndSportAddLinksTilelist.dataProvider 
  = profile1NewsAndSportaddLinksAC;
profile1NewsAndSportLinkChoice.dataProvider = new ArrayCollection([]); 
  }
  
  private function resetprofile1NewsAndSportAC():void{
profile1NewsAndSportaddLinksAC.removeAll();
for each(var obj:Object in profile1NewsAndSportaddLinksFullAC){
  profile1NewsAndSportaddLinksAC.addItem(obj);
}
  }
  
  private function initprofile1NewsAndSportSO():void{
profile1NewsAndSportSO = SharedObject.getLocal(profile1NewsAndSport);
if(profile1NewsAndSportSO.size  0){
  if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList){
if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList != 
empty){
  var profile1NewsAndSportaddList:Array = 
profile1NewsAndSportSO.data.profile1NewsAndSportaddList.split(,);
  var profile1NewsAndSporttempAC1:ArrayCollection = new 
ArrayCollection();
  for each(var str:String in profile1NewsAndSportaddList){
for each(var obj1:Object in profile1NewsAndSportaddLinksAC){
  if(str == obj1.label){
profile1NewsAndSporttempAC1.addItem(obj1);
continue;
  }
}
  }
  if(profile1NewsAndSporttempAC1.length  0){
profile1NewsAndSportAddLinksTilelist.dataProvider = 
profile1NewsAndSporttempAC1;
  }
}
  }
  if(profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList){
var profile1NewsAndSportchoiceList:Array = 
profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split(,);
var profile1NewsAndSporttempAC2:ArrayCollection = new 
ArrayCollection();
for each(var str2:String in profile1NewsAndSportchoiceList){
  for each(var obj2:Object in profile1NewsAndSportaddLinksAC){
if(str2 == obj2.label){
  profile1NewsAndSporttempAC2.addItem(obj2);
  continue;
}
  }
}
if(profile1NewsAndSporttempAC2.length  0){
  profile1NewsAndSportLinkChoice.dataProvider = 
profile1NewsAndSporttempAC2;
}
  }
}else{
profile1NewsAndSportReset();
}
  }
  private function saveprofile1NewsAndSport(event:MouseEvent):void{
var profile1NewsAndSportaddList:String = ;
if(profile1NewsAndSportAddLinksTilelist.dataProvider){
  
if(ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length  
0){
for each(var obj1:Object in 
  profile1NewsAndSportAddLinksTilelist.dataProvider){
  profile1NewsAndSportaddList += obj1.label + ,;
}
  }else{
profile1NewsAndSportaddList = empty;
  }
}