Re: [flexcoders] Re: Parsley MVC :: some thoughts

2008-12-09 Thread Ralf Bokelberg
Haha Amy, that's a good one. Maybe it should :)

But seriously, dispatchEvent is nothing more than a function call,
which calls all the event handler methods. Of cause you can think of
pathologic examples like Paul likes to do :) But this is really the
same with function calls. It is completely synchronous and there is
nothing like "three lines later it does something strange to my code".
It would be really bad, if something like this could happen.

I would be happy to reconsider, if you can provide me with a example,
which does what you were seeing.

Cheers
Ralf.



On Wed, Dec 10, 2008 at 12:02 AM, Amy <[EMAIL PROTECTED]> wrote:
> --- In flexcoders@yahoogroups.com, "Ralf Bokelberg"
>
> <[EMAIL PROTECTED]> wrote:
>>
>> Hi Amy
>>
>> Afaik this is not possible in Flashplayer. A block of code is always
>> running through without any interuption. Colin Moock has a good
>> chapter of how all this works in his nice AS3 book.
>
> Apparently the code in question didn't read the book to realize what it
> was doing wasn't possibl LOL.
>
> 


Re: [flexcoders] problem with sample flex application with LCDS

2008-12-09 Thread shruti shety
Hi

I have a print statement in the "fill" method of the class which extends 
AbstractAssembler.Thats not getting printed on the console.
I dont get any errors also. When i click on the button the screen just 
refreshes. 

Thanks,
Radhika

--- On Wed, 12/10/08, Brendan Meutzner <[EMAIL PROTECTED]> wrote:
From: Brendan Meutzner <[EMAIL PROTECTED]>
Subject: Re: [flexcoders] problem with sample flex application with LCDS
To: flexcoders@yahoogroups.com
Date: Wednesday, December 10, 2008, 12:40 PM











 Can you elaborate a bit on what you mean by "not getting called"?  
Where is the failure occurring?  

Brendan

On Wed, Dec 10, 2008 at 12:58 AM, shruti shety  wrote:


















Hi,

I am working on a sample application with flex (and LCDS
data services) and have
been experimenting with directly calling the fill method
(extending AbstractAssembler) as a way of poking data into a
server-side DB. Every time I try to run my test case fill is not
getting called . I'd appreciate any pointers as to where I'm going
wrong...

I am directly using the lcds-sample. war, in that testdrive-dataservi ce code 
Sorry for the lengthy code attach.

my mxml:

http://www.adobe. com/2006/ mxml" xmlns="*" 
backgroundColor="#FF">


    
     
    
    
    
    


        
            
            


            
            
            


        
    
    
     
    


ProductAssembler. java extends AbstractAssembler


 * * * *

package flex.samples. product;

import java.util.List;
import java.util.Collectio n;
import java.util.Map;


import flex.data.assembler s.AbstractAssemb ler;



public class ProductAssembler extends AbstractAssembler {

    public Collection fill(List fillArgs)  {

        List list = new ArrayList();    
        System.out.println(" in service");


        return list;
        
    }

    

    public void createItem(Object item)  {
    
    }

    
    
}

 * * * * * * **


Product.as

package
{
    [Managed]
    [RemoteClass( alias="flex.samples. product.Product")]
    public class Product
    {
        public function Product()
        {
        }



        public var productId:int; 

        public var name:String;

        public var description: String;

        public var image:String;

        public var category:String;

        public var price:Number;



        public var qtyInStock:int;

    }
}
 * * * * *

package flex.samples. product;
import java.io.Serializabl e;

public class Product implements Serializable {



    static final long serialVersionUID = 103844514947365244L ;
    
    private int productId;
    private String name;
    private String description;
    private String image;
    private String category;


    private double price;
    private int qtyInStock;
    
    public Product() {
        
    }
    
   
public Product(int productId, String name, String description, String
image, String category, double price, int qtyInStock) {

        this.productId = productId;
        this.name = name;
        this.description = description;
        this.image = image;
        this.category = category;

        this.price = price;

        this.qtyInStock = qtyInStock;
    }

    public String getCategory( ) {
        return category;
    }
    public void setCategory( String category) {
        this.category = category;
    }


    public String getDescription( ) {
        return description;
    }
    public void setDescription( String description) {
        this.description = description;
    }
    public String getImage() {


        return image;
    }
    public void setImage(String image) {
        this.image = image;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {


        this.name = name;
    }
    public double getPrice() {
        return price;
    }
    public void setPrice(double price) {
        this.price = price;

    }

    public int getProductId( ) {
        return productId;
    }
    public void setProductId( int productId) {
        this.productId = productId;
    }
    public int getQtyInStock( ) {
        return qtyInStock;


    }
    public void setQtyInStock( int qtyInStock) {
        this.qtyInStock = qtyInStock;
    }

}
 * * * * * * ***
data-management- config.xml 



 

    
    flex.samples. product.ProductA ssembler
    application



    
    
    

    
    


    
            flex.samples. product.Product
    
    


  
  





















-- 
Brendan Meutzner
http://www.meutzner .com/blog/



  




 










 

Re: [flexcoders] problem with sample flex application with LCDS

2008-12-09 Thread Brendan Meutzner
 Can you elaborate a bit on what you mean by "not getting called"?  Where is
the failure occurring?

Brendan


On Wed, Dec 10, 2008 at 12:58 AM, shruti shety <[EMAIL PROTECTED]>wrote:

>   Hi,
>
> I am working on a sample application with flex (and LCDS data services) and
> have been experimenting with directly calling the fill method (extending
> AbstractAssembler) as a way of poking data into a server-side DB. Every time
> I try to run my test case fill is not getting called . I'd appreciate any
> pointers as to where I'm going wrong...
>
> I am directly using the lcds-sample.war, in that testdrive-dataservice code
>
> Sorry for the lengthy code attach.
>
> my mxml:
> 
> http://www.adobe.com/2006/mxml"; xmlns="*"
> backgroundColor="#FF">
>
> 
> 
> 
>
>  height="100%">
> 
> 
> 
> 
> 
>  headerText="Description"/>
> 
> 
>
> 
>
> 
>
> ProductAssembler.java extends AbstractAssembler
> 
>
> package flex.samples.product;
>
> import java.util.List;
> import java.util.Collection;
> import java.util.Map;
>
>
> import flex.data.assemblers.AbstractAssembler;
>
> public class ProductAssembler extends AbstractAssembler {
>
> public Collection fill(List fillArgs)  {
>
> List list = new ArrayList();
> System.out.println(" in service");
> return list;
>
> }
>
>
>
> public void createItem(Object item)  {
>
> }
>
>
>
> }
>
> 
> Product.as
>
> package
> {
> [Managed]
> [RemoteClass(alias="flex.samples.product.Product")]
> public class Product
> {
> public function Product()
> {
> }
>
> public var productId:int;
>
> public var name:String;
>
> public var description:String;
>
> public var image:String;
>
> public var category:String;
>
> public var price:Number;
>
> public var qtyInStock:int;
>
> }
> }
> *
>
> package flex.samples.product;
> import java.io.Serializable;
>
> public class Product implements Serializable {
>
> static final long serialVersionUID = 103844514947365244L;
>
> private int productId;
> private String name;
> private String description;
> private String image;
> private String category;
> private double price;
> private int qtyInStock;
>
> public Product() {
>
> }
>
> public Product(int productId, String name, String description, String
> image, String category, double price, int qtyInStock) {
> this.productId = productId;
> this.name = name;
> this.description = description;
> this.image = image;
> this.category = category;
> this.price = price;
> this.qtyInStock = qtyInStock;
> }
>
> public String getCategory() {
> return category;
> }
> public void setCategory(String category) {
> this.category = category;
> }
> public String getDescription() {
> return description;
> }
> public void setDescription(String description) {
> this.description = description;
> }
> public String getImage() {
> return image;
> }
> public void setImage(String image) {
> this.image = image;
> }
> public String getName() {
> return name;
> }
> public void setName(String name) {
> this.name = name;
> }
> public double getPrice() {
> return price;
> }
> public void setPrice(double price) {
> this.price = price;
> }
> public int getProductId() {
> return productId;
> }
> public void setProductId(int productId) {
> this.productId = productId;
> }
> public int getQtyInStock() {
> return qtyInStock;
> }
> public void setQtyInStock(int qtyInStock) {
> this.qtyInStock = qtyInStock;
> }
>
> }
> *
> data-management-config.xml
>
>  
>
> 
> flex.samples.product.ProductAssembler
> application
>
> 
> 
> 
>
> 
> 
> 
> flex.samples.product.Product
> 
> 
>
>  
>



-- 
Brendan Meutzner
http://www.meutzner.com/blog/


RE: [flexcoders] Change Timezone

2008-12-09 Thread Keith Reinfeld
Pratik, 
 
> I would like to know if there is any way to dynamically change the
> timezone in flex.
 
Not literally, no. 
 
> Say suppose we have local time and few check boxes to see time in
> other timezones. When you check and uncheck the check box the time
> changes according to the selected timezone. This would not depend on
> the location of the persons timezone. So persons local timezone may be
> PST but he wants to see the data in EST.
 
To calculate the time elsewhere you have to factor-in the local machine's
timezone offset value. 
I worked out the following for my World Clock last year:  

 
// Local Time 
var lDate:Date = new Date(); 
// Elsewhere Time 
var utcH:Number = -8;// New York: EST 
var utcM:Number = 0; 
var wDate:Date = new Date(lDate.getTime() + (lDate.getTimezoneOffset() *
1000 * 60) + (utcH * 1000 * 60 * 60) + (utcM * 1000 * 60)); 
trace("wDate = "+wDate); 
 
 
Note: 
The GMT value in the trace will still reflect the local machine's timezone.
Just ignore it. The important data are the time and date. 

Going forward you will want to consider the issues presented by Daylight
Saving Time: 
Does the locale of the local machine observe DST? 
Is the locale of the local machine currently in DST? 
Do they observe DST in the designated Elsewhere? 
Is the designated Elsewhere currently in DST? 
Regards, 

-Keith 
http://keithreinfeld.home.comcast.net
 
 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of pratikshah83
Sent: Tuesday, December 09, 2008 7:15 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Change Timezone

Hi Guys, 

I would like to know if there is any way to dynamically change the
timezone in flex. 

Say suppose we have local time and few check boxes to see time in
other timezones. When you check and uncheck the check box the time
changes according to the selected timezone. This would not depend on
the location of the persons timezone. So persons local timezone may be
PST but he wants to see the data in EST. 

There is the timezoneoffset method but that just gives you the offset
of local timezone with respect to UTC.

I hope my issue is clear. 

Any help would be appreciated. 

Thanks
Pratik 
 
<>

[flexcoders] problem with sample flex application with LCDS

2008-12-09 Thread shruti shety
Hi,

I am working on a sample application with flex (and LCDS
data services) and have
been experimenting with directly calling the fill method
(extending AbstractAssembler) as a way of poking data into a
server-side DB. Every time I try to run my test case fill is not
getting called . I'd appreciate any pointers as to where I'm going
wrong...

I am directly using the lcds-sample.war, in that testdrive-dataservice code 
Sorry for the lengthy code attach.

my mxml:

http://www.adobe.com/2006/mxml"; xmlns="*" 
backgroundColor="#FF">

    
     
    
    
    
    

        
            
            

            
            
            

        
    
    
     
    


ProductAssembler.java extends AbstractAssembler



package flex.samples.product;

import java.util.List;
import java.util.Collection;
import java.util.Map;


import flex.data.assemblers.AbstractAssembler;


public class ProductAssembler extends AbstractAssembler {

    public Collection fill(List fillArgs)  {

        List list = new ArrayList();    
        System.out.println(" in service");

        return list;
        
    }

    

    public void createItem(Object item)  {
    
    }

    
    
}



Product.as

package
{
    [Managed]
    [RemoteClass(alias="flex.samples.product.Product")]
    public class Product
    {
        public function Product()
        {
        }


        public var productId:int; 

        public var name:String;

        public var description:String;

        public var image:String;

        public var category:String;

        public var price:Number;


        public var qtyInStock:int;

    }
}
*

package flex.samples.product;
import java.io.Serializable;

public class Product implements Serializable {


    static final long serialVersionUID = 103844514947365244L;
    
    private int productId;
    private String name;
    private String description;
    private String image;
    private String category;

    private double price;
    private int qtyInStock;
    
    public Product() {
        
    }
    
   
public Product(int productId, String name, String description, String
image, String category, double price, int qtyInStock) {

        this.productId = productId;
        this.name = name;
        this.description = description;
        this.image = image;
        this.category = category;
        this.price = price;

        this.qtyInStock = qtyInStock;
    }

    public String getCategory() {
        return category;
    }
    public void setCategory(String category) {
        this.category = category;
    }

    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getImage() {

        return image;
    }
    public void setImage(String image) {
        this.image = image;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {

        this.name = name;
    }
    public double getPrice() {
        return price;
    }
    public void setPrice(double price) {
        this.price = price;
    }

    public int getProductId() {
        return productId;
    }
    public void setProductId(int productId) {
        this.productId = productId;
    }
    public int getQtyInStock() {
        return qtyInStock;

    }
    public void setQtyInStock(int qtyInStock) {
        this.qtyInStock = qtyInStock;
    }

}
*
data-management-config.xml 


 

    
    flex.samples.product.ProductAssembler
    application


    
    
    

    
    

    
            flex.samples.product.Product
    
    


  

Re: [flexcoders] Filtering the List Entries depending upon the text entered in text Input box

2008-12-09 Thread SAAGAR SHETTY
Go through this 
sitehttp://www.adobe.com/devnet/flex/quickstart/accessing_xml_data/
The techniques used here will surely make it easy for you,

Regards,
Saagar Shetty
www.xoriant.com





From: Alex Harui <[EMAIL PROTECTED]>
To: "flexcoders@yahoogroups.com" 
Sent: Wednesday, 10 December, 2008 9:58:24 AM
Subject: RE: [flexcoders] Filtering the List Entries depending upon the text 
entered in text Input box


I’d try using XMLListCollection instead of ArrayCollection
 
From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf 
Of anuj
sharma
Sent: Tuesday, December 09, 2008 5:05 PM
To: [EMAIL PROTECTED] ups.com
Subject: Re: [flexcoders] Filtering the List Entries depending upon the
text entered in text Input box
 
Sorry Guys
I posted another mail in the group. I thought it was working but it is not
going through each node, it is just comparing with the id of the first node of
my XML , Below is the code , I apologize for jumping to the conclusion that it
is working as initially it seems like. I am doing somethign wrong which makes
my code not to loop through each and every node but just matching it with the
id of the first node of my XML,
Please help me guys to resolve this problem

//XML File




monitoring
2.0
location
Camera1
AIR




/*** * **CODE*** * * /
//This is REST CALL
 
 
//THis makes call to server
devicesXML.url="http://"+IP+"/config/devices";;
//Thid function is called when values are retreived
private function devicesXMLHandler( event:ResultEven t):void
{
devicesList = event.result. device;

//Checks every device
for each (var devicesInPool: * in devicesList) {
var deviceName:String = devicesInPool. @id;
//var label:String= devicesInPool. @id; 
devicesInList. push(deviceName) ;
filteredDevices= new ArrayCollection( devicesInList) ; 

nvrsInPoolList. dataProvider = filteredDevices;
filteredDevices. filterFunction= processFilter;
}

//This function calls for assigning label for the entries in the List
box named nvsInPoolList 

private function assignFriendlyName( item:Object) :String
{ 
//Checks every device
for each (var devicesID:* in devicesList) {
var deviceName:String = [EMAIL PROTECTED];
//Checks if the current deviceID matches the current item, if so
it will search its attributes
if(deviceName == item.toString( )) {
var devicesText: XMLList =
devicesID.child("attributes").child("attribute");
//Checks every attribute tag for each device
for each (var attributesFriendlyN ame:* in devicesText) {
//Checks if the attribute name is friendly-name
if(attributesFriend [EMAIL PROTECTED] == 'friendly-name' ) {
var friendlynameText: String = attributesFriendlyN ame.toString( );
return friendlynameText;
} 
}

}
} 
return item.toString( );
} 
//Filtering Data in the Device List
private function processFilter( item:Object) :Boolean
{
return
String(item) .toUpperCase( ).indexOf( filterText. toUpperCase( )) >= 0;
}
//Tracking the typed Camera Name 
private function doChange():void
{
if(txtSearch. text!=null)
{
this.filterText= txtSearch. text;
this.filteredDevice s.refresh( );
} 
} 



 
On Wed, Dec 3, 2008 at 5:31 PM, anuj181 <[EMAIL PROTECTED] com> wrote:
Hi All
This is somehow regarding the question I have asked few weeks back.
Unfortunately I have to stop this task at that time and now need to
work on that. My need is that I have some entries in the List as an
arrayCollection and there is text input box and I like to have list to
filter the data as soon as user starts typing text. I have attached
the so far developed code. I need as soon as user types On, the list
below should only show first entry which is 'One-Device' . I attached
the code but it is not working as I want. This is going to be just my
dummy working prototype and once this module has been made working
then i am going to merge this module into my Main Project.

Also if anyone has any better idea about how to figure this thing out
that will be great and instead of arrayColection if we can achieve the
same function laity that would be helpful too.
Thanks a lot
Anuj 

/*** ***CODE* * * * /

http://www.adobe. com/2006/ mxml" 
layout="absolute"
initialize="init()" 
width="100%" height="100%"
horizontalScrollPol icy="off">








  


  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

[flexcoders] Tilelist image help

2008-12-09 Thread arulmurugan thiagarajan
Hi,

http://www.calsoftgroup.com/samspick/index.html

Using a Tilelist to show a books title, image, description, rating,
authorurl.

The image is not rendered it is different from what I am seeing in a
picture viewer. 
actual image width = 100 and height =150

(Image url
http://www.calsoftgroup.com/samspick/assets/pic2/IndiaFrommidnighttoMilleniumandBeyond_ShashiTharoor.jpg
)

See image of the book India : From Midnight to Millennium and Beyond
under. (Choose History in drop down)

Dono whats the problem.
Pls help.

regards,
Arulmurugan


RE: [flexcoders] Filtering the List Entries depending upon the text entered in text Input box

2008-12-09 Thread Alex Harui
I'd try using XMLListCollection instead of ArrayCollection

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of anuj 
sharma
Sent: Tuesday, December 09, 2008 5:05 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Filtering the List Entries depending upon the text 
entered in text Input box


Sorry Guys
I posted another mail in the group. I thought it was working but it is not 
going through each node, it is just comparing with the id of the first node of 
my XML , Below is the code , I apologize for jumping to the conclusion that it 
is working as initially it seems like. I am doing somethign wrong which makes 
my code not to loop through each and every node but just matching it with the 
id of the first node of my XML,
Please help me guys to resolve this problem

//XML File




monitoring
2.0
location
Camera1
AIR




/**CODE*/
//This is REST CALL


//THis makes call to server
devicesXML.url="http://"+IP+"/config/devices";;
//Thid function is called when values are retreived
private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;

//Checks every device
for each (var devicesInPool:* in devicesList) {
var deviceName:String = [EMAIL PROTECTED];
//var label:[EMAIL PROTECTED];
devicesInList.push(deviceName);
filteredDevices=new ArrayCollection(devicesInList);

nvrsInPoolList.dataProvider = filteredDevices;
filteredDevices.filterFunction=processFilter;
}

//This function calls for assigning label for the entries in the List
box named nvsInPoolList

private function assignFriendlyName(item:Object):String
{
//Checks every device
for each (var devicesID:* in devicesList) {
var deviceName:String = [EMAIL PROTECTED];
//Checks if the current deviceID matches the current item, if so
it will search its attributes
if(deviceName == item.toString()) {
var devicesText:XMLList =
devicesID.child("attributes").child("attribute");
//Checks every attribute tag for each device
for each (var attributesFriendlyName:* in devicesText) {
//Checks if the attribute name is friendly-name
if([EMAIL PROTECTED] == 'friendly-name') {
var friendlynameText:String = attributesFriendlyName.toString();
return friendlynameText;
}
}

}
}
return item.toString();
}
//Filtering Data in the Device List
private function processFilter(item:Object):Boolean
{
return
String(item).toUpperCase().indexOf(filterText.toUpperCase()) >= 0;
}
//Tracking the typed Camera Name
private function doChange():void
{
if(txtSearch.text!=null)
{
this.filterText=txtSearch.text;
this.filteredDevices.refresh();
}
}





On Wed, Dec 3, 2008 at 5:31 PM, anuj181 <[EMAIL PROTECTED]> wrote:
Hi All
This is somehow regarding the question I have asked few weeks back.
Unfortunately I have to stop this task at that time and now need to
work on that. My need is that I have some entries in the List as an
arrayCollection and there is text input box and I like to have list to
filter the data as soon as user starts typing text. I have attached
the so far developed code. I need as soon as user types On, the list
below should only show first entry which is 'One-Device'. I attached
the code but it is not working as I want. This is going to be just my
dummy working prototype and once this module has been made working
then i am going to merge this module into my Main Project.

Also if anyone has any better idea about how to figure this thing out
that will be great and instead of arrayColection if we can achieve the
same function laity that would be helpful too.
Thanks a lot
Anuj

/**CODE/

http://www.adobe.com/2006/mxml";
layout="absolute"
initialize="init()"
width="100%" height="100%"
horizontalScrollPolicy="off">











Re: [flexcoders] Re: Parsley MVC :: some thoughts

2008-12-09 Thread Paul Andrews
Here is a trivial example using dispatchEvent to show the synchronous 
invocation of listeners that could (if badly written) interfere with 
innocuous code.

Normally when the "click to count" button is pressed, the count goes from 1 
to 10.
If the button to enable despatching the event is pressed, when the counter 
reaches 5 an event is despatched. The event handler updates the counter, 
adding 10 to it's value.
The output shows that despatched events do indeed invoke the listeners 
synchronously and as this example shows, the listeners can interfere with 
the smooth running of code if they are badly written.

Trivial example, certainly, but it shows the principle.

Paul


http://www.adobe.com/2006/mxml"; layout="vertical" 
applicationComplete="init()">






 



Re: [flexcoders] AIR app uninstall issue - database stays in applicationStorageDirectory forever?

2008-12-09 Thread Alen Balja
Because they have stored bookmarks, notes and other stuff with their
product. They uninstall the product, install it again and they're still
there. It's marked as critical with their QA and I don't think we could get
away with it. Well, I guess I could tell them that Adobe knows better than
them, and they did this for a reason, but I doubt they'd buy that.

Anyway, looking forward to see some other ugly hack advices if anyone has
similar expereince. Or if someone from Adobe like Alex knows some tricks.




On Tue, Dec 9, 2008 at 1:22 PM, Gregor Kiddie <[EMAIL PROTECTED]> wrote:

>Yeah, solutions to this tend to end up being messy.
>
>
>
> Question is, why do your users consider keeping their settings from one
> install to another a bug?
>
>
>
> Gk.
>
> *Gregor Kiddie*
> Senior Developer
> *INPS*
>
> Tel:   01382 564343
>
> Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ
>
> Registered Number: 1788577
>
> Registered in the UK
>
> Visit our Internet Web site at www.inps.co.uk
>
> The information in this internet email is confidential and is intended
> solely for the addressee. Access, copying or re-use of information in it by
> anyone else is not authorised. Any views or opinions presented are solely
> those of the author and do not necessarily represent those of INPS or any of
> its affiliates. If you are not the intended recipient please contact
> [EMAIL PROTECTED]
>   --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Alen Balja
> *Sent:* 08 December 2008 10:27
>
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] AIR app uninstall issue - database stays in
> applicationStorageDirectory forever?
>
>
>
> Thanks guys, but this still doesn't solve my problem.
>
> Gregor, I understand that Mac users would delete the folder and nothing
> could be run then, but at least I need a workaround to run some code at the
> install time, or first time the application runs after install, is there a
> way to do at least that? Then I could check for any old files and delete
> them, reset prefs, etc.
>
> As user Dan commented in the Oli's blog, I also got the same idea of
> checking the file dates and times in applicationDirectory, if that time is
> less than 1 minute from "now", then it is a fresh install and I need to
> clean up what is in the applicationStorageDirectory. If that date is older,
> that means I'm just running the same already installed application again,
> and I leave everything as is. But as Dan posted, this seems like a very very
> ugly hack.
>
>
> a.
>
>
>
>  On Mon, Dec 8, 2008 at 1:33 PM, Gregor Kiddie <[EMAIL PROTECTED]>
> wrote:
>
> Take a look at Oli Goldman's article on why the AIR app installer doesn't
> clean up after itself.
>
>
>
>
> http://blogs.adobe.com/simplicity/2008/07/why_uninstallers_dont_clean_up_user_files.html
>
>
>
> Gk.
>
> *Gregor Kiddie*
> Senior Developer
> *INPS*
>
> Tel:   01382 564343
>
> Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ
>
> Registered Number: 1788577
>
> Registered in the UK
>
> Visit our Internet Web site at www.inps.co.uk
>
> The information in this internet email is confidential and is intended
> solely for the addressee. Access, copying or re-use of information in it by
> anyone else is not authorised. Any views or opinions presented are solely
> those of the author and do not necessarily represent those of INPS or any of
> its affiliates. If you are not the intended recipient please contact
> [EMAIL PROTECTED]
>   --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Alen Balja
> *Sent:* 08 December 2008 03:34
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] AIR app uninstall issue - database stays in
> applicationStorageDirectory forever?
>
>
>
> I would really appreciate if someone maybe close to Adobe would shed some
> light on the issue. Can it be done, are there some workarounds. It's really
> annoying, we're few days from release and client just found this "bug". The
> bug is that ApplicationStorageDirectory doesn't get deleted on uninstall.
> Hence, all the user's settings remain after he uninstalls the app and
> installs it again. (Plus it's very ugly to have all the files there forever)
>
>
> Not sure if I'm doing something wrong, on the application launch I'm
> copying SQLite database from applicationDirectory to
> applicationStorageDirectory, in order to be able to read and write.
>
> Of course, I check if the database already exists there or not.
>
> var dbFile:File = File.applicationDirectory.
>
> resolvePath("database.db");
>
> var DBDestination:File =
> File.applicationStorageDirectory.resolvePath("db/database.db");
>
>
> if (!DBDestination.exists)
> {
> dbFile.copyTo(DBDestination);
> }
>
> Everything is fine here, up to the point when application is
> uninstalled. Database stays there even after the uninstall and hence
> break

[flexcoders] Re: Parsley MVC :: some thoughts

2008-12-09 Thread Amy
--- In flexcoders@yahoogroups.com, "Paul Andrews" <[EMAIL PROTECTED]> wrote:
>
> 
> - Original Message - 
> From: "Ralf Bokelberg" <[EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, December 09, 2008 3:00 PM
> Subject: Re: [flexcoders] Re: Parsley MVC :: some thoughts
> 
> 
> > Hi Amy
> >
> > Afaik this is not possible in Flashplayer. A block of code is 
always
> > running through without any interuption.
> 
> I think this has been part of the discussion in the thread. While 
it is what 
> I would expect, if dispatching events causes all listening event 
handlers to 
> be called synchronously, it means that any block of code 
dispatching an 
> event is going to be interrupted and potentially "unknown" event 
listeners 
> called during the execution of that code block.
> 
> Here's an interesting scenario:
> 
> If I have a block of code building a data structure and it has an 
object 
> reference to some model. It could be that it encounters some 
situation and 
> dispatches an event. The event handler may then interrogate the 
model, 
> modify the model and control then returns to the executing block 
which is 
> then unaware of the model change and still iterating through the 
model.
> 
> My expectation would be that dispatch event would add the event to 
a queue 
> of events ready to be handled, but those would not be handled until 
the code 
> block had completed.
> 
> In other systems/languages my code blocks would include semaphore 
handling 
> to protect such data structures, but there's no option for me to do 
that in 
> actionscript.
> 
> You may argue that the developer should 'know' what may potentially 
happen 
> when  writing code and despatching events, but in practice who 
knows who may 
> add a new event handler to the application in future and may 
introduce a 
> problem.
> 
> I don't have a problem with all event handlers being called when an 
event is 
> fully despatched, but that's potentially dangerous if it's done in 
the 
> middle of a code block. Anyway it's just a thing to keep in mind. I 
would 
> agree that it's a marginal and unlikely scenario.

Right,  I went back and looked at the code and found that the code 
was calling dispatchEvent.  And then at some point in the code block 
after that (not at the next line, but maybe 2-3 lines later), 
execution would go off to somewhere else that wasn't going to work 
before the other code ran after dispatchEvent.



[flexcoders] SocetMonitor not working as expected

2008-12-09 Thread Geoffrey
Trying out the SocketMonitor and what I'm experiencing is not what I'm 
expecting to happen.  Here's a code snippet:

__sm = new SocketMonitor(HOSTNAME, PORT_NUMBER);
__sm.addEventListener(StatusEvent.STATUS, onNetworkStatusChange);
__sm.start();

The onNetworkStatusChange() method gets called when start() is called.  
I expect that.  It also get's called about 30 seconds after the 
network interface is disabled.  I'm guessing it uses some sort of 
polling, so I guess I expect that.  I really expected it to happen as 
soon as the interface goes down, so to speed up the network status recognition 
I set __sm.pollInterval = 1000.

Once I do that, the only time onNetworkStatusChange() is called is 
when start() is called.  It never gets a StatusEvent... no matter how 
many times I enable/disable the network interface.

Any ideas on why I'm seeing this?

Thanks,
 Geoff



[flexcoders] Change Timezone

2008-12-09 Thread pratikshah83
Hi Guys, 

I would like to know if there is any way to dynamically change the
timezone in flex. 

Say suppose we have local time and few check boxes to see time in
other timezones. When you check and uncheck the check box the time
changes according to the selected timezone. This would not depend on
the location of the persons timezone. So persons local timezone may be
PST but he wants to see the data in EST. 

There is the timezoneoffset method but that just gives you the offset
of local timezone with respect to UTC.

I hope my issue is clear. 

Any help would be appreciated. 

Thanks
Pratik 




RE: [flexcoders] Disable Runtime Binding Warnings

2008-12-09 Thread Tracy Spratt
Those warnings are correctable.

 

Wrap the node expression, which is probably currentItem or data, or
selectedItem which are objects, in the XML() function.

 

text="{XML(myDG.selectedItem).myNode.text()}"

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of stoff0
Sent: Tuesday, December 09, 2008 7:58 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Disable Runtime Binding Warnings

 

Is there anyway to stop binding warnings (or all warnings from being
logged to the console)? I've tried to turn off warnings with compiler
arguments like: 

-compiler.show-binding-warnings=false
-warnings=false

I also tried unchecking "enable warnings" checkbox in flex builder.

It looks like none of these have an effect on "runtime warnings"
(warnings that get logged to the console)

For some background the reason I'm attempting this is because I'm
getting about 200 warnings on some xml binding and it's really slowing
things down for me and probably everyone with the debug player.

Thanks!

 



Re: [flexcoders] Filtering the List Entries depending upon the text entered in text Input box

2008-12-09 Thread anuj sharma
Sorry Guys
I posted another mail in the group. I thought it was working but it is not
going through each node, it is just comparing with the id of the first node
of my XML , Below is the code , I apologize for jumping to the conclusion
that it is working as initially it seems like. I am doing somethign wrong
which makes my code not to loop through each and every node but just
matching it with the id of the first node of my XML,
Please help me guys to resolve this problem

//XML File




monitoring
2.0
location
Camera1
AIR




/**CODE*/
//This is REST CALL


//THis makes call to server
devicesXML.url="http://"+IP+"/config/devices";;
//Thid function is called when values are retreived
private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;

//Checks every device
for each (var devicesInPool:* in devicesList) {
var deviceName:String = [EMAIL PROTECTED];
//var label:[EMAIL PROTECTED];
devicesInList.push(deviceName);
filteredDevices=new ArrayCollection(devicesInList);

nvrsInPoolList.dataProvider = filteredDevices;
filteredDevices.filterFunction=processFilter;
}

//This function calls for assigning label for the entries in the List
box named nvsInPoolList

private function assignFriendlyName(item:Object):String
{
//Checks every device
for each (var devicesID:* in devicesList) {
var deviceName:String = [EMAIL PROTECTED];
//Checks if the current deviceID matches the current item, if so
it will search its attributes
if(deviceName == item.toString()) {
var devicesText:XMLList =
devicesID.child("attributes").child("attribute");
//Checks every attribute tag for each device
for each (var attributesFriendlyName:* in devicesText) {
//Checks if the attribute name is friendly-name
if([EMAIL PROTECTED] == 'friendly-name') {
var friendlynameText:String = attributesFriendlyName.toString();
return friendlynameText;
}
}

}
}
return item.toString();
}
//Filtering Data in the Device List
private function processFilter(item:Object):Boolean
{
return
String(item).toUpperCase().indexOf(filterText.toUpperCase()) >= 0;
}
//Tracking the typed Camera Name
private function doChange():void
{
if(txtSearch.text!=null)
{
this.filterText=txtSearch.text;
this.filteredDevices.refresh();
}
}





On Wed, Dec 3, 2008 at 5:31 PM, anuj181 <[EMAIL PROTECTED]> wrote:

>   Hi All
> This is somehow regarding the question I have asked few weeks back.
> Unfortunately I have to stop this task at that time and now need to
> work on that. My need is that I have some entries in the List as an
> arrayCollection and there is text input box and I like to have list to
> filter the data as soon as user starts typing text. I have attached
> the so far developed code. I need as soon as user types On, the list
> below should only show first entry which is 'One-Device'. I attached
> the code but it is not working as I want. This is going to be just my
> dummy working prototype and once this module has been made working
> then i am going to merge this module into my Main Project.
>
> Also if anyone has any better idea about how to figure this thing out
> that will be great and instead of arrayColection if we can achieve the
> same function laity that would be helpful too.
> Thanks a lot
> Anuj
>
> /**CODE/
> 
> http://www.adobe.com/2006/mxml";
> layout="absolute"
> initialize="init()"
> width="100%" height="100%"
> horizontalScrollPolicy="off">
> 
> 
> 
>  id="DevicesList">
> 
>
>
> 
>
>  
>


[flexcoders] Disable Runtime Binding Warnings

2008-12-09 Thread stoff0
Is there anyway to stop binding warnings (or all warnings from being
logged to the console)? I've tried to turn off warnings with compiler
arguments like: 

-compiler.show-binding-warnings=false
-warnings=false

I also tried unchecking "enable warnings" checkbox in flex builder.

It looks like none of these have an effect on "runtime warnings"
(warnings that get logged to the console)

For some background the reason I'm attempting this is because I'm
getting about 200 warnings on some xml binding and it's really slowing
things down for me and probably everyone with the debug player.

Thanks!



[flexcoders] Re: Locally generated Flex content not working with IE7

2008-12-09 Thread walveranta
I added the local dev server to the trusted sites in IE7 and enabled
basically all JavaScript settings for trusted sites. Then I went on to
disable all installed add-ons, to no avail.

So I reset IE7 (Tools > Ineternet Options > Advanced > Reset > Reset),
then reinstalled the ActiveX Flash player (version 10 from the Flex's
Players folder) and that fixed the problem. Must've been some messed
up configuration or add-on, or a broken/missing component somewhere.




Re: [flexcoders] Filtering working partially, Looping through just the first node of XML.Pls Help

2008-12-09 Thread anuj sharma
Sorry forgot to add text box code

doChange is called the moment user starts entering text in the text input
Thanks for all of your time
Anuj

On Tue, Dec 9, 2008 at 4:10 PM, anuj181 <[EMAIL PROTECTED]> wrote:

>   Hi All
> Guys This is regarding the problem I had few days back. I made
> filtering of the List partially working for my app after taking some
> help from this group, but I realize a bug in my program. I am making
> rest calls to load data in form of XML in List. I need to apply filter
> on this list. Depending upon the text entered in the text box , the
> list should filter. Now my problem is that the filter is working if
> user types the id of my XML node, however I want my code to go through
> all the XML file and checks if the entered text matches the attribute
> named friendly name and will filter depending upon the friendly name.
> Please help me out, Below is the code and I would appreciate if
> someone gives me right direction to make it completely working, Please
> let me know also if the code is not documented correctly to make it
> more sense
> Thanks
> Anuj
> //XML File
> 
> 
> 
> 
> monitoring
> 2.0
> location
> Camera1
> AIR
> 
> 
> 
> 
> /**CODE*/
> //This is REST CALL
>  result="devicesXMLHandler(event)" showBusyCursor="true">
> 
> //THis makes call to server
> devicesXML.url="http://"+IP+"/config/devices";;
> //Thid function is called when values are retreived
> private function devicesXMLHandler(event:ResultEvent):void
> {
> devicesList = event.result.device;
>
> //Checks every device
> for each (var devicesInPool:* in devicesList) {
> var deviceName:String = [EMAIL PROTECTED];
> //var label:[EMAIL PROTECTED];
> devicesInList.push(deviceName);
> filteredDevices=new ArrayCollection(devicesInList);
>
> nvrsInPoolList.dataProvider = filteredDevices;
> filteredDevices.filterFunction=processFilter;
> }
>
> //This function calls for assigning label for the entries in the List
> box named nvsInPoolList
>
> private function assignFriendlyName(item:Object):String
> {
> //Checks every device
> for each (var devicesID:* in devicesList) {
> var deviceName:String = [EMAIL PROTECTED];
> //Checks if the current deviceID matches the current item, if so
> it will search its attributes
> if(deviceName == item.toString()) {
> var devicesText:XMLList =
> devicesID.child("attributes").child("attribute");
> //Checks every attribute tag for each device
> for each (var attributesFriendlyName:* in devicesText) {
> //Checks if the attribute name is friendly-name
> if([EMAIL PROTECTED] == 'friendly-name') {
> var friendlynameText:String = attributesFriendlyName.toString();
> return friendlynameText;
> }
> }
>
> }
> }
> return item.toString();
> }
> //Filtering Data in the Device List
> private function processFilter(item:Object):Boolean
> {
> return
> String(item).toUpperCase().indexOf(filterText.toUpperCase()) >= 0;
> }
> //Tracking the typed Camera Name
> private function doChange():void
> {
> if(txtSearch.text!=null)
> {
> this.filterText=txtSearch.text;
> this.filteredDevices.refresh();
> }
> }
>
>  dragMoveEnabled="true" dragEnabled="true" dropEnabled="true"
> y="105" x="17" height="462" width="294"/>
>
>  
>


[flexcoders] Filtering working partially, Looping through just the first node of XML.Pls Help

2008-12-09 Thread anuj181
Hi All
Guys This is regarding the problem I had few days back. I made
filtering of the List partially working for my app after taking some
help from this group, but I realize a bug in my program. I am making
rest calls to load data in form of XML in List. I need to apply filter
on this list. Depending upon the text entered in the text box , the
list should filter. Now my problem is that the filter is working if
user types the id of my XML node, however I want my code to go through
all the XML file and checks if the entered text matches the attribute
named friendly name and will filter depending upon the friendly name.
Please help me out, Below is the code and I would appreciate if
someone gives me right direction to make it completely working, Please
let me know also if the code is not documented correctly to make it
more sense
Thanks
Anuj
//XML File




monitoring
2.0
location
Camera1
AIR




/**CODE*/
//This is REST CALL


   
//THis makes call to server
devicesXML.url="http://"+IP+"/config/devices";;
//Thid function is called when values are retreived
private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;

//Checks every device
for each (var devicesInPool:* in devicesList) {
var deviceName:String = [EMAIL 
PROTECTED];
//var label:[EMAIL PROTECTED];  

devicesInList.push(deviceName);
filteredDevices=new 
ArrayCollection(devicesInList); 

nvrsInPoolList.dataProvider = filteredDevices;
filteredDevices.filterFunction=processFilter;
}

//This function calls for assigning label for the entries in the List
box named nvsInPoolList 

private function assignFriendlyName(item:Object):String
{   
//Checks every device
for each (var devicesID:* in devicesList) {
var deviceName:String = [EMAIL 
PROTECTED];
//Checks if the current deviceID 
matches the current item, if so
it will search its attributes
if(deviceName == item.toString()) {
var devicesText:XMLList =
devicesID.child("attributes").child("attribute");
//Checks every attribute tag 
for each device
for each (var 
attributesFriendlyName:* in devicesText) {
//Checks if the 
attribute name is friendly-name
if([EMAIL PROTECTED] == 
'friendly-name') {
var 
friendlynameText:String = attributesFriendlyName.toString();
return 
friendlynameText;
}   
}

}
}   
return item.toString();
}   
//Filtering Data in the Device List
private function processFilter(item:Object):Boolean
{
return
String(item).toUpperCase().indexOf(filterText.toUpperCase()) >= 0;
}
//Tracking the typed Camera Name 
private function doChange():void
{
if(txtSearch.text!=null)
{
this.filterText=txtSearch.text;
this.filteredDevices.refresh();
}   
}   





RE: [flexcoders] speed of the "for each" looping

2008-12-09 Thread Alex Harui
They are different animals.  Scenarios where you could choose between 
index-based or property-based iteration don't come to mind.

Also note property-based iteration can perform much more slowly iterating 
proxy-based objects, and do not work on sealed non-dynamic classes.

-Alex

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh 
McDonald
Sent: Tuesday, December 09, 2008 3:51 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] speed of the "for each" looping


*nods*

I find that it's often much easier to read when you use for..in and for 
each..in rather than regular for. And since you need to have a "var current = 
list[i]" or similar as the first line, If you only need an index to display, or 
it's 1-based as opposed to 0-based, using a "for [each]..in" and having the 
first inner line be "++idx" will be easier to read than a bunch of statements 
within your loop that look like:

var current = foo[i+1]

or

msg = "you're at item #" + (i + 1)

If you want to know more about for each and how it works (outside of Arrays at 
least), look into flash.Proxy. The documentation is a little unclear at times 
on Proxy, so I wrote a couple of posts on using it here:

http://flex.joshmcdonald.info/2008/09/using-proxy-class-part-1_04.html
http://flex.joshmcdonald.info/2008/09/using-proxy-class-part-2.html

* IMHO, YMMV, (code) beauty is in the eye of the beholder, etc... =]

-Josh
On Wed, Dec 10, 2008 at 9:37 AM, Maciek Sakrejda <[EMAIL 
PROTECTED]> wrote:
Interesting. I decided to actually try my test above, and on 100
items, the for-each version takes ~50 milliseconds, versus ~25
milliseconds for the explicitly indexed loop. When doing some actual
work in the loop (a trace), the numbers are 41.9 seconds for the
for-each and 41.1 seconds for the indexed for. On a loop with a trace
with 100 items, both forms take ~5 milliseconds. This is rather
unscientific, but I don't have the profiler available (will it ever make
it to Linux, Adobe?).

So yes, it looks like for-each is a lot slower in some cases, but I'll
maintain it still probably won't make a difference unless you've got a
massive loop that does very little, or a deeply nested set of loops.

Consider also the readability and maintainability benefits of a
for-each: unless you need the index, it's just one more place to
introduce bugs when refactoring, and it's cognitive cruft when trying to
follow what's going on.
--
Maciek Sakrejda
Truviso, Inc.
http://www.truviso.com

-Original Message-
From: Alex Harui <[EMAIL PROTECTED]>
Reply-To: flexcoders@yahoogroups.com
To: flexcoders@yahoogroups.com 
mailto:flexcoders@yahoogroups.com>>
Subject: RE: [flexcoders] speed of the "for each" looping
Date: Tue, 9 Dec 2008 12:30:19 -0800

For each should be much slower than a basic iterator as it has to walk
the object's properties.



For each (var p:* in someObject)



And



For (var p:String in SomeObject)



Probably run at the same rate.



From:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On
Behalf Of Cato Paus
Sent: Tuesday, December 09, 2008 5:28 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] speed of the "for each" looping




Hi, all you experts :)

I'm tying to speed up my application and I use a lot of

exsample
for (var i:int = 0; i < 5; i++)
{
trace(i);
}

so is the "for each" looping faster ?








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

   Individual Email | Traditional





--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk



Re: [flexcoders] speed of the "for each" looping

2008-12-09 Thread Josh McDonald
*nods*

I find that it's often much easier to read when you use for..in and for
each..in rather than regular for. And since you need to have a "var current
= list[i]" or similar as the first line, If you only need an index to
display, or it's 1-based as opposed to 0-based, using a "for [each]..in" and
having the first inner line be "++idx" will be easier to read than a bunch
of statements within your loop that look like:

var current = foo[i+1]

or

msg = "you're at item #" + (i + 1)

If you want to know more about for each and how it works (outside of Arrays
at least), look into flash.Proxy. The documentation is a little unclear at
times on Proxy, so I wrote a couple of posts on using it here:

http://flex.joshmcdonald.info/2008/09/using-proxy-class-part-1_04.html
http://flex.joshmcdonald.info/2008/09/using-proxy-class-part-2.html

* IMHO, YMMV, (code) beauty is in the eye of the beholder, etc... =]

-Josh

On Wed, Dec 10, 2008 at 9:37 AM, Maciek Sakrejda <[EMAIL PROTECTED]>wrote:

> Interesting. I decided to actually try my test above, and on 100
> items, the for-each version takes ~50 milliseconds, versus ~25
> milliseconds for the explicitly indexed loop. When doing some actual
> work in the loop (a trace), the numbers are 41.9 seconds for the
> for-each and 41.1 seconds for the indexed for. On a loop with a trace
> with 100 items, both forms take ~5 milliseconds. This is rather
> unscientific, but I don't have the profiler available (will it ever make
> it to Linux, Adobe?).
>
> So yes, it looks like for-each is a lot slower in some cases, but I'll
> maintain it still probably won't make a difference unless you've got a
> massive loop that does very little, or a deeply nested set of loops.
>
> Consider also the readability and maintainability benefits of a
> for-each: unless you need the index, it's just one more place to
> introduce bugs when refactoring, and it's cognitive cruft when trying to
> follow what's going on.
> --
> Maciek Sakrejda
> Truviso, Inc.
> http://www.truviso.com
>
> -Original Message-
> From: Alex Harui <[EMAIL PROTECTED]>
> Reply-To: flexcoders@yahoogroups.com
> To: flexcoders@yahoogroups.com 
> Subject: RE: [flexcoders] speed of the "for each" looping
> Date: Tue, 9 Dec 2008 12:30:19 -0800
>
> For each should be much slower than a basic iterator as it has to walk
> the object's properties.
>
>
>
> For each (var p:* in someObject)
>
>
>
> And
>
>
>
> For (var p:String in SomeObject)
>
>
>
> Probably run at the same rate.
>
>
>
> From:flexcoders@yahoogroups.com <[EMAIL PROTECTED]>[mailto:
> [EMAIL PROTECTED] On
> Behalf Of Cato Paus
> Sent: Tuesday, December 09, 2008 5:28 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] speed of the "for each" looping
>
>
>
>
> Hi, all you experts :)
>
> I'm tying to speed up my application and I use a lot of
>
> exsample
> for (var i:int = 0; i < 5; i++)
> {
> trace(i);
> }
>
> so is the "for each" looping faster ?
>
>
>
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>


-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk


RE: [flexcoders] speed of the "for each" looping

2008-12-09 Thread Maciek Sakrejda
Interesting. I decided to actually try my test above, and on 100
items, the for-each version takes ~50 milliseconds, versus ~25
milliseconds for the explicitly indexed loop. When doing some actual
work in the loop (a trace), the numbers are 41.9 seconds for the
for-each and 41.1 seconds for the indexed for. On a loop with a trace
with 100 items, both forms take ~5 milliseconds. This is rather
unscientific, but I don't have the profiler available (will it ever make
it to Linux, Adobe?).

So yes, it looks like for-each is a lot slower in some cases, but I'll
maintain it still probably won't make a difference unless you've got a
massive loop that does very little, or a deeply nested set of loops.

Consider also the readability and maintainability benefits of a
for-each: unless you need the index, it's just one more place to
introduce bugs when refactoring, and it's cognitive cruft when trying to
follow what's going on.
-- 
Maciek Sakrejda
Truviso, Inc.
http://www.truviso.com

-Original Message-
From: Alex Harui <[EMAIL PROTECTED]>
Reply-To: flexcoders@yahoogroups.com
To: flexcoders@yahoogroups.com 
Subject: RE: [flexcoders] speed of the "for each" looping
Date: Tue, 9 Dec 2008 12:30:19 -0800

For each should be much slower than a basic iterator as it has to walk
the object’s properties.

 

For each (var p:* in someObject)

 

And

 

For (var p:String in SomeObject)

 

Probably run at the same rate.

 

From:flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Cato Paus
Sent: Tuesday, December 09, 2008 5:28 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] speed of the "for each" looping


 

Hi, all you experts :)

I'm tying to speed up my application and I use a lot of

exsample
for (var i:int = 0; i < 5; i++)
{
trace(i);
} 

so is the "for each" looping faster ?


 




[flexcoders] Re: Parsley MVC :: some thoughts

2008-12-09 Thread Amy
--- In flexcoders@yahoogroups.com, "Ralf Bokelberg" 
<[EMAIL PROTECTED]> wrote:
>
> Hi Amy
> 
> Afaik this is not possible in Flashplayer. A block of code is always
> running through without any interuption. Colin Moock has a good
> chapter of how all this works in his nice AS3 book.

Apparently the code in question didn't read the book to realize what it 
was doing wasn't possibl LOL.



RE: [flexcoders] Failed to load policy file from http://localhost:8881/crossdomain.xml

2008-12-09 Thread Alex Harui
Read the Security WhitePaper.  Looks like a SWF is trying to access the host 
server.  Might be an bad assumption in that SWF.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
luvfotography
Sent: Tuesday, December 09, 2008 1:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Failed to load policy file from 
http://localhost:8881/crossdomain.xml


I'm getting this error when I run my program from my FLEX Builder.

Failed to load policy file from http://localhost:8881/crossdomain.xml

Warning: Failed to load policy file from http://localhost:8881/crossdomain.xml
Error: Request for resource at http://localhost:8881 by requestor from
http://s.ytimg.com/yt/swf/cps-vfl67854.swf is denied due to lack of policy file 
permissions.

My program is loading a video from youtube, and results in this error.

Where do I put my crossdomain file??

thanks,



RE: [flexcoders] Re: Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader

2008-12-09 Thread Alex Harui
If you don't own the content, the FCK won't help you.  You'll need to wrap the 
content and implement your own tabbing scheme.  Difficulty Rating 8 out of 10.

You'd need a SWFLoader  subclass that implements IFocusManagerComponent.  It 
would need a keyFocusChange handler that calls preventDefault().

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
aut0poietic
Sent: Tuesday, December 09, 2008 1:34 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Cannot Tab to MovieClips from Flash SWF Loaded with 
SWFLoader


Thanks for the tip Alex. I'm googling now, but I'm curious how this
could be of benefit to me for a MovieClip on stage.

Content designers build the SWF's that my application loads in, which
consists of simple MovieClips, images, vector graphics and some
interactions (like drag/drops or a multiple choice question).

It sounds like I'd have to specify a base class for every movieclip on
stage that implemented IFocusManagerComponent.

Am I far off, or is there some secret sauce in the kit?

--- In flexcoders@yahoogroups.com, Alex 
Harui <[EMAIL PROTECTED]> wrote:
>
> The CS3 entities need to implement IFocusManagerComponent. You
might be able to use the Flash Component Kit to do that
>
> From: flexcoders@yahoogroups.com 
> [mailto:flexcoders@yahoogroups.com]
On Behalf Of aut0poietic
> Sent: Tuesday, December 09, 2008 7:47 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Cannot Tab to MovieClips from Flash SWF Loaded
with SWFLoader
>
>
> Title pretty much says it all:
>
> I have a Flex 3 application which can basically be summed up as a SWF
> player which loads SWF's created in Flash CS3.
>
> When the SWF's are loaded, I can interact with them using the mouse
> (click/mouseover, etc). However, these items cannot be tabbed to.
>
> I've been hacking around on this all morning, without much luck. I've
> ensured that every item in the application either has a tabIndex and
> is .tabEnabled or has tabEnabled=false and tabChildren=true.
>
> I've even resorted to enumerating over the child MovieClips in the swf
> (using swfLoaderInstance.content.getChildAt()) and setting tabEnabled
> and focusRect are both true, and confirming that the tabIndex on these
> mc's was preserved.
>
> I'm at a serious loss as to what to do next -- I can't have
> controls/interactions that the user can't tab to. Am I missing
> something simple? A setting on the SWFLoader? The Application?
>
> Hope someone's had to deal with this before and knows a solution.
>
> Jer
>



RE: [flexcoders] Re: getBitmapData from a scaled display object

2008-12-09 Thread Ryan Graham

Ah, good deal. Glad it worked out!

 

-Ryan

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kyle
Sent: Tuesday, December 09, 2008 3:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: getBitmapData from a scaled display object

 

Ryan I could kiss you right now (thankfully for my sake of my
masculinity the internet will prevent this from happening)! I kep
thinking on what you posted about grabbing the data by referencing the
parent, and then it hit me.. I placed the entire canvas inside of
another container, then called getBitmapData on the parent container
and VOILA! 

THE ANSWER: It appears that in order to grab bitmapdata from a scaled
object and have the scaled size be respected, the object from which
you wish to get the bitmapdata must be the child of another container
object, and you must call getBitmapData on the parent (referencing the
parents width/height/etc in the getBitmapData method). 

Many Thanks!

-Kyle

--- In flexcoders@yahoogroups.com 
, "Ryan Graham" <[EMAIL PROTECTED]> wrote:
>
> 
> Oh, I see... This seems like a bit of a hack, and could probably be
> coded a bit cleaner, but maybe do the drawing from a parent container
> and just set a clipping rectangle equal to the location and size of
the
> scaled object? If it works, I'd be curious to know. Here, the stage
was
> used:
> 
> 
> 
> bitmapdata.draw( Application.application.stage, null, null, null, new
> Rectangle(displayObject2.x, displayObject2.y, displayObject2.width,
> displayObject2.height));
> 
> 
> 
> HTH,
> 
> Ryan
> 
> From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com 
] On
> Behalf Of Kyle
> Sent: Tuesday, December 09, 2008 2:18 PM
> To: flexcoders@yahoogroups.com  
> Subject: [flexcoders] Re: getBitmapData from a scaled display object
> 
> 
> 
> Hey Ryan,
> 
> Thanks for the thought; however, this doesn't solve my problem. The
> problem is this: The children of the canvas that I want to scale up
> are all vector (swf files). If I use a matrix or any other method to
> scale up the graphics after they are in raster format (bitmapdata)
> then the quality will be decreased severely. So what I am trying to
> accomplish is to scale up canvas container, and all of its' children,
> prior to getting the bitmapdata. This way the resulting bitmap will
> not be pixelated or otherwise lose quality. 
> 
> The issues that I am experiencing when using scalex/scaley on the
> canvas container is that the scale of the container and its' children
> is apparently ignored by getBitmapData as the resulting output is at
> the original size of the canvas (prior to it being scaled up). The
> example app that I pasted below should illustrate this issue.
> 
> Any other ideas appreciated.
> 
> Thanks!
> 
> -Kyle
> 
> --- In flexcoders@yahoogroups.com


> , "Ryan Graham"  wrote:
> >
> > 
> > You may have to play with some of the positioning, but use the
second
> > parameter of the bitmapData.draw() function to pass in the object's
> > transform matrix as a start. This should get you closer...
> > 
> > 
> > 
> > bitmapdata.draw( displayObject2, displayObject2.transform.matrix );
> > 
> > 
> > 
> > HTH,
> > 
> > Ryan
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com


> [mailto:flexcoders@yahoogroups.com


> ] On
> > Behalf Of Kyle
> > Sent: Tuesday, December 09, 2008 12:21 PM
> > To: flexcoders@yahoogroups.com 
 
> > Subject: [flexcoders] getBitmapData from a scaled display object
> > 
> > 
> > 
> > 
> > I'm trying to figure out the easiest way to get bitmapdata from a
> > displayobject that has had its scalex/scaley altered. In the test
> > example I have listed below, I have a canvas container that has 3
> > children (swfLoader components). I set the scalex/scaley of the
canvas
> > container to 2 and its' children are scaled up proportionally;
> > however, when I try to get bitmapdata from the canvas, it does not
> > recognize the scaled size of the canvas container and as such when I
> > create a new bitmap using the data it is still at the original size.
> > Any ideas on how I can get bitmapdata that will match the
width/height
> > of the scaled canvas would be greatly appreciated!
> > 
> > 
> > http://www.adobe.com/2006/mxml";
> > layout="absolute" creationComplete="createImage()">
> > 
> > 
> > 
> > 
> >  > backgroundColor="#FF" id="myCanvas">
> > 
> > 
> >
>
http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53
> > 630bb25563ab28da6c9a3968.swf
> > 
> > 
> > 
> >
>
http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b188
> > 8731df7c76

[flexcoders] Re: getBitmapData from a scaled display object

2008-12-09 Thread Kyle
And for anyone that may be running into a similar issue here is a
basic (and somewhat messy) example of how to accomplish what has been
discussed in this thread. I've posted the entire app, so you should be
able to simply copy and paste..




http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="createImage();">







http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53630bb25563ab28da6c9a3968.swf



http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b1888731df7c766a4e274d766b20.swf



http://media.dev.freakatars.com.s3.amazonaws.com/2/0/605299b92bc3993319ceb9490eb52b0f.swf









--- In flexcoders@yahoogroups.com, "Ryan Graham" <[EMAIL PROTECTED]> wrote:
>
> 
> Oh, I see... This seems like a bit of a hack, and could probably be
> coded a bit cleaner, but maybe do the drawing from a parent container
> and just set a clipping rectangle equal to the location and size of the
> scaled object? If it works, I'd be curious to know.  Here, the stage was
> used:
> 
>  
> 
> bitmapdata.draw( Application.application.stage, null, null, null, new
> Rectangle(displayObject2.x, displayObject2.y, displayObject2.width,
> displayObject2.height));
> 
>  
> 
> HTH,
> 
> Ryan
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Kyle
> Sent: Tuesday, December 09, 2008 2:18 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: getBitmapData from a scaled display object
> 
>  
> 
> Hey Ryan,
> 
> Thanks for the thought; however, this doesn't solve my problem. The
> problem is this: The children of the canvas that I want to scale up
> are all vector (swf files). If I use a matrix or any other method to
> scale up the graphics after they are in raster format (bitmapdata)
> then the quality will be decreased severely. So what I am trying to
> accomplish is to scale up canvas container, and all of its' children,
> prior to getting the bitmapdata. This way the resulting bitmap will
> not be pixelated or otherwise lose quality. 
> 
> The issues that I am experiencing when using scalex/scaley on the
> canvas container is that the scale of the container and its' children
> is apparently ignored by getBitmapData as the resulting output is at
> the original size of the canvas (prior to it being scaled up). The
> example app that I pasted below should illustrate this issue.
> 
> Any other ideas appreciated.
> 
> Thanks!
> 
> -Kyle
> 
> --- In flexcoders@yahoogroups.com 
> , "Ryan Graham"  wrote:
> >
> > 
> > You may have to play with some of the positioning, but use the second
> > parameter of the bitmapData.draw() function to pass in the object's
> > transform matrix as a start. This should get you closer...
> > 
> > 
> > 
> > bitmapdata.draw( displayObject2, displayObject2.transform.matrix );
> > 
> > 
> > 
> > HTH,
> > 
> > Ryan
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:flexcoders@yahoogroups.com 
> ] On
> > Behalf Of Kyle
> > Sent: Tuesday, December 09, 2008 12:21 PM
> > To: flexcoders@yahoogroups.com  
> > Subject: [flexcoders] getBitmapData from a scaled display object
> > 
> > 
> > 
> > 
> > I'm trying to figure out the easiest way to get bitmapdata from a
> > displayobject that has had its scalex/scaley altered. In the test
> > example I have listed below, I have a canvas container that has 3
> > children (swfLoader components). I set the scalex/scaley of the canvas
> > container to 2 and its' children are scaled up proportionally;
> > however, when I try to get bitmapdata from the canvas, it does not
> > recognize the scaled size of the canvas container and as such when I
> > create a new bitmap using the data it is still at the original size.
> > Any ideas on how I can get bitmapdata that will match the width/height
> > of the scaled canvas would be greatly appreciated!
> > 
> > 
> > http://www.adobe.com/2006/mxml";
> > layout="absolute" creationComplete="createImage()">
> > 
> > 
> > 
> > 
> >  > backgroundColor="#FF" id="myCanvas">
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53
> > 630bb25563ab28da6c9a3968.swf
> > 
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b188
> > 8731df7c766a4e274d766b20.swf
> > 
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/605299b9
> > 2bc3993319ceb9490eb52b0f.swf
> > 
> > 
> >  > click="createBitmap(event);"/>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > This message is private and confidential. If you have received it in
> error, please notify the sender and remove it from your system.
> >
> 
>  
> 
> 
> 
> This message is private and confidential. If you have received it in
error, please notify the sender and 

[flexcoders] Re: getBitmapData from a scaled display object

2008-12-09 Thread Kyle
Ryan I could kiss you right now (thankfully for my sake of my
masculinity the internet will prevent this from happening)! I kep
thinking on what you posted about grabbing the data by referencing the
parent, and then it hit me.. I placed the entire canvas inside of
another container, then called getBitmapData on the parent container
and VOILA! 

THE ANSWER: It appears that in order to grab bitmapdata from a scaled
object and have the scaled size be respected, the object from which
you wish to get the bitmapdata must be the child of another container
object, and you must call getBitmapData on the parent (referencing the
parents width/height/etc in the getBitmapData method). 


Many Thanks!

-Kyle




--- In flexcoders@yahoogroups.com, "Ryan Graham" <[EMAIL PROTECTED]> wrote:
>
> 
> Oh, I see... This seems like a bit of a hack, and could probably be
> coded a bit cleaner, but maybe do the drawing from a parent container
> and just set a clipping rectangle equal to the location and size of the
> scaled object? If it works, I'd be curious to know.  Here, the stage was
> used:
> 
>  
> 
> bitmapdata.draw( Application.application.stage, null, null, null, new
> Rectangle(displayObject2.x, displayObject2.y, displayObject2.width,
> displayObject2.height));
> 
>  
> 
> HTH,
> 
> Ryan
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Kyle
> Sent: Tuesday, December 09, 2008 2:18 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: getBitmapData from a scaled display object
> 
>  
> 
> Hey Ryan,
> 
> Thanks for the thought; however, this doesn't solve my problem. The
> problem is this: The children of the canvas that I want to scale up
> are all vector (swf files). If I use a matrix or any other method to
> scale up the graphics after they are in raster format (bitmapdata)
> then the quality will be decreased severely. So what I am trying to
> accomplish is to scale up canvas container, and all of its' children,
> prior to getting the bitmapdata. This way the resulting bitmap will
> not be pixelated or otherwise lose quality. 
> 
> The issues that I am experiencing when using scalex/scaley on the
> canvas container is that the scale of the container and its' children
> is apparently ignored by getBitmapData as the resulting output is at
> the original size of the canvas (prior to it being scaled up). The
> example app that I pasted below should illustrate this issue.
> 
> Any other ideas appreciated.
> 
> Thanks!
> 
> -Kyle
> 
> --- In flexcoders@yahoogroups.com 
> , "Ryan Graham"  wrote:
> >
> > 
> > You may have to play with some of the positioning, but use the second
> > parameter of the bitmapData.draw() function to pass in the object's
> > transform matrix as a start. This should get you closer...
> > 
> > 
> > 
> > bitmapdata.draw( displayObject2, displayObject2.transform.matrix );
> > 
> > 
> > 
> > HTH,
> > 
> > Ryan
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:flexcoders@yahoogroups.com 
> ] On
> > Behalf Of Kyle
> > Sent: Tuesday, December 09, 2008 12:21 PM
> > To: flexcoders@yahoogroups.com  
> > Subject: [flexcoders] getBitmapData from a scaled display object
> > 
> > 
> > 
> > 
> > I'm trying to figure out the easiest way to get bitmapdata from a
> > displayobject that has had its scalex/scaley altered. In the test
> > example I have listed below, I have a canvas container that has 3
> > children (swfLoader components). I set the scalex/scaley of the canvas
> > container to 2 and its' children are scaled up proportionally;
> > however, when I try to get bitmapdata from the canvas, it does not
> > recognize the scaled size of the canvas container and as such when I
> > create a new bitmap using the data it is still at the original size.
> > Any ideas on how I can get bitmapdata that will match the width/height
> > of the scaled canvas would be greatly appreciated!
> > 
> > 
> > http://www.adobe.com/2006/mxml";
> > layout="absolute" creationComplete="createImage()">
> > 
> > 
> > 
> > 
> >  > backgroundColor="#FF" id="myCanvas">
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53
> > 630bb25563ab28da6c9a3968.swf
> > 
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b188
> > 8731df7c766a4e274d766b20.swf
> > 
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/605299b9
> > 2bc3993319ceb9490eb52b0f.swf
> > 
> > 
> >  > click="createBitmap(event);"/>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > This message is private and confidential. If you have received it in
> error, please notify the sender and remove it from your system.
> >
> 
>  
> 
> 
> 
> 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] Anything other than a JS alert can delay a window close?

2008-12-09 Thread Tracy Spratt
Use javascript and XMLHTTP to update the database instead of Flex?

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of wkolcz
Sent: Tuesday, December 09, 2008 5:34 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Anything other than a JS alert can delay a window
close?

 

Pretty much what I asked in the subject line. I need Flash to submit to
a database before the window closes and the flash instance dies. 

Don't think that a pop up (alert) is an option for our sites. 

Using JS and ExternalInterface to communicate with flash (AS) to push to
a HTTPRequest data to insert.

ANY ideas? Any?

 



RE: [flexcoders] Re: getBitmapData from a scaled display object

2008-12-09 Thread Ryan Graham

That's weird - the code I posted below looks like it produced the 400 x
400 PNG at near identical quality to the original. In theory, drawing
the 400 x 400 pixel area of the stage that the child has been drawn at
should produce the correct result.  You sure you drew the
application.stage object, and didn't just re-reference the
displayObject2?  Not that you would, but I would like to see if this
technique actually works like it appears to over here. J

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kyle
Sent: Tuesday, December 09, 2008 3:25 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: getBitmapData from a scaled display object

 

Hey Ryan,
That was a great idea, something I definately had not tried yet.
Unfortunately, referencing the child from a parent did not seem to
produce any better results. The issue still stands that the
getBitmapData method (as well as bitmapdata produced by using the
ImageSnapshot class) do not respect the current scale of the
displayobject. So even though the displayObject appears at 400x400 on
the stage (which is scaled up by 2 from 200x200 ), the bitmapdata
copies it at it's original size of 200x200. I just can't figure out
how to get it to respect the scaled size. I would think that there
would be some sort of "apply" method, but I haven't found anything
yet. THERE HAS TO BE AN ANSWER!!! haha.. Thanks again for the help!

--- In flexcoders@yahoogroups.com 
, "Ryan Graham" <[EMAIL PROTECTED]> wrote:
>
> 
> Oh, I see... This seems like a bit of a hack, and could probably be
> coded a bit cleaner, but maybe do the drawing from a parent container
> and just set a clipping rectangle equal to the location and size of
the
> scaled object? If it works, I'd be curious to know. Here, the stage
was
> used:
> 
> 
> 
> bitmapdata.draw( Application.application.stage, null, null, null, new
> Rectangle(displayObject2.x, displayObject2.y, displayObject2.width,
> displayObject2.height));
> 
> 
> 
> HTH,
> 
> Ryan
> 
> From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com 
] On
> Behalf Of Kyle
> Sent: Tuesday, December 09, 2008 2:18 PM
> To: flexcoders@yahoogroups.com  
> Subject: [flexcoders] Re: getBitmapData from a scaled display object
> 
> 
> 
> Hey Ryan,
> 
> Thanks for the thought; however, this doesn't solve my problem. The
> problem is this: The children of the canvas that I want to scale up
> are all vector (swf files). If I use a matrix or any other method to
> scale up the graphics after they are in raster format (bitmapdata)
> then the quality will be decreased severely. So what I am trying to
> accomplish is to scale up canvas container, and all of its' children,
> prior to getting the bitmapdata. This way the resulting bitmap will
> not be pixelated or otherwise lose quality. 
> 
> The issues that I am experiencing when using scalex/scaley on the
> canvas container is that the scale of the container and its' children
> is apparently ignored by getBitmapData as the resulting output is at
> the original size of the canvas (prior to it being scaled up). The
> example app that I pasted below should illustrate this issue.
> 
> Any other ideas appreciated.
> 
> Thanks!
> 
> -Kyle
> 
> --- In flexcoders@yahoogroups.com


> , "Ryan Graham"  wrote:
> >
> > 
> > You may have to play with some of the positioning, but use the
second
> > parameter of the bitmapData.draw() function to pass in the object's
> > transform matrix as a start. This should get you closer...
> > 
> > 
> > 
> > bitmapdata.draw( displayObject2, displayObject2.transform.matrix );
> > 
> > 
> > 
> > HTH,
> > 
> > Ryan
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com


> [mailto:flexcoders@yahoogroups.com


> ] On
> > Behalf Of Kyle
> > Sent: Tuesday, December 09, 2008 12:21 PM
> > To: flexcoders@yahoogroups.com 
 
> > Subject: [flexcoders] getBitmapData from a scaled display object
> > 
> > 
> > 
> > 
> > I'm trying to figure out the easiest way to get bitmapdata from a
> > displayobject that has had its scalex/scaley altered. In the test
> > example I have listed below, I have a canvas container that has 3
> > children (swfLoader components). I set the scalex/scaley of the
canvas
> > container to 2 and its' children are scaled up proportionally;
> > however, when I try to get bitmapdata from the canvas, it does not
> > recognize the scaled size of the canvas container and as such when I
> > create a new bitmap using the data it is still at the original size.
> > Any ideas on how I can get bitmapdata that will match the
widt

[flexcoders] Anything other than a JS alert can delay a window close?

2008-12-09 Thread wkolcz
Pretty much what I asked in the subject line. I need Flash to submit to a 
database before the window closes and the flash instance dies. 

Don't think that a pop up (alert) is an option for our sites. 

Using JS and ExternalInterface to communicate with flash (AS) to push to a 
HTTPRequest data to insert.

ANY ideas? Any?



[flexcoders] Re: getBitmapData from a scaled display object

2008-12-09 Thread Kyle
Hey Ryan,
That was a great idea, something I definately had not tried yet.
Unfortunately, referencing the child from a parent did not seem to
produce any better results. The issue still stands that the
getBitmapData method (as well as bitmapdata produced by using the
ImageSnapshot class) do not respect the current scale of the
displayobject. So even though the displayObject appears at 400x400 on
the stage (which is scaled up by 2 from 200x200 ), the bitmapdata
copies it at it's original size of 200x200. I just can't figure out
how to get it to respect the scaled size. I would think that there
would be some sort of "apply" method, but I haven't found anything
yet. THERE HAS TO BE AN ANSWER!!! haha.. Thanks again for the help!





--- In flexcoders@yahoogroups.com, "Ryan Graham" <[EMAIL PROTECTED]> wrote:
>
> 
> Oh, I see... This seems like a bit of a hack, and could probably be
> coded a bit cleaner, but maybe do the drawing from a parent container
> and just set a clipping rectangle equal to the location and size of the
> scaled object? If it works, I'd be curious to know.  Here, the stage was
> used:
> 
>  
> 
> bitmapdata.draw( Application.application.stage, null, null, null, new
> Rectangle(displayObject2.x, displayObject2.y, displayObject2.width,
> displayObject2.height));
> 
>  
> 
> HTH,
> 
> Ryan
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Kyle
> Sent: Tuesday, December 09, 2008 2:18 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: getBitmapData from a scaled display object
> 
>  
> 
> Hey Ryan,
> 
> Thanks for the thought; however, this doesn't solve my problem. The
> problem is this: The children of the canvas that I want to scale up
> are all vector (swf files). If I use a matrix or any other method to
> scale up the graphics after they are in raster format (bitmapdata)
> then the quality will be decreased severely. So what I am trying to
> accomplish is to scale up canvas container, and all of its' children,
> prior to getting the bitmapdata. This way the resulting bitmap will
> not be pixelated or otherwise lose quality. 
> 
> The issues that I am experiencing when using scalex/scaley on the
> canvas container is that the scale of the container and its' children
> is apparently ignored by getBitmapData as the resulting output is at
> the original size of the canvas (prior to it being scaled up). The
> example app that I pasted below should illustrate this issue.
> 
> Any other ideas appreciated.
> 
> Thanks!
> 
> -Kyle
> 
> --- In flexcoders@yahoogroups.com 
> , "Ryan Graham"  wrote:
> >
> > 
> > You may have to play with some of the positioning, but use the second
> > parameter of the bitmapData.draw() function to pass in the object's
> > transform matrix as a start. This should get you closer...
> > 
> > 
> > 
> > bitmapdata.draw( displayObject2, displayObject2.transform.matrix );
> > 
> > 
> > 
> > HTH,
> > 
> > Ryan
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:flexcoders@yahoogroups.com 
> ] On
> > Behalf Of Kyle
> > Sent: Tuesday, December 09, 2008 12:21 PM
> > To: flexcoders@yahoogroups.com  
> > Subject: [flexcoders] getBitmapData from a scaled display object
> > 
> > 
> > 
> > 
> > I'm trying to figure out the easiest way to get bitmapdata from a
> > displayobject that has had its scalex/scaley altered. In the test
> > example I have listed below, I have a canvas container that has 3
> > children (swfLoader components). I set the scalex/scaley of the canvas
> > container to 2 and its' children are scaled up proportionally;
> > however, when I try to get bitmapdata from the canvas, it does not
> > recognize the scaled size of the canvas container and as such when I
> > create a new bitmap using the data it is still at the original size.
> > Any ideas on how I can get bitmapdata that will match the width/height
> > of the scaled canvas would be greatly appreciated!
> > 
> > 
> > http://www.adobe.com/2006/mxml";
> > layout="absolute" creationComplete="createImage()">
> > 
> > 
> > 
> > 
> >  > backgroundColor="#FF" id="myCanvas">
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53
> > 630bb25563ab28da6c9a3968.swf
> > 
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b188
> > 8731df7c766a4e274d766b20.swf
> > 
> > 
> > 
> >
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/605299b9
> > 2bc3993319ceb9490eb52b0f.swf
> > 
> > 
> >  > click="createBitmap(event);"/>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > This message is private and confidential. If you have received it in
> error, please notify the sender and remove it from your system.
> >
> 
>  
> 
> 
> 
> This message is private and confidential. If you have received it in
error, please notify the sender and remove it from your system.
>




[flexcoders] Re: Custom CheckBox icon?

2008-12-09 Thread oneworld95
Check this out:
http://www.adobe.com/devnet/flex/articles/icon_checkbox.html

-Alex

--- In flexcoders@yahoogroups.com, "tungchau81" <[EMAIL PROTECTED]> wrote:
>
> Do you have an answer for this yet? I am running into the same problem.
> 
> Regards,
> Tung Chau
> --- In flexcoders@yahoogroups.com, "Jason"  wrote:
> >
> > Does anyone know how to set the default 'check' icon of a CheckBox to
> > a different image?  I would like to use an 'x' instead of the 'check'.
> > 
> > The class definition shows that it inherits the 'icon' style from the
> > Button class, but I cannot seem to be able to set the icon attribute
> > like I can with a button.
> > 
> > --jason
> >
>




[flexcoders] Re: Custom CheckBox icon?

2008-12-09 Thread tungchau81
Do you have an answer for this yet? I am running into the same problem.

Regards,
Tung Chau
--- In flexcoders@yahoogroups.com, "Jason" <[EMAIL PROTECTED]> wrote:
>
> Does anyone know how to set the default 'check' icon of a CheckBox to
> a different image?  I would like to use an 'x' instead of the 'check'.
> 
> The class definition shows that it inherits the 'icon' style from the
> Button class, but I cannot seem to be able to set the icon attribute
> like I can with a button.
> 
> --jason
>




RE: [flexcoders] Re: getBitmapData from a scaled display object

2008-12-09 Thread Ryan Graham

Oh, I see... This seems like a bit of a hack, and could probably be
coded a bit cleaner, but maybe do the drawing from a parent container
and just set a clipping rectangle equal to the location and size of the
scaled object? If it works, I'd be curious to know.  Here, the stage was
used:

 

bitmapdata.draw( Application.application.stage, null, null, null, new
Rectangle(displayObject2.x, displayObject2.y, displayObject2.width,
displayObject2.height));

 

HTH,

Ryan

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kyle
Sent: Tuesday, December 09, 2008 2:18 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: getBitmapData from a scaled display object

 

Hey Ryan,

Thanks for the thought; however, this doesn't solve my problem. The
problem is this: The children of the canvas that I want to scale up
are all vector (swf files). If I use a matrix or any other method to
scale up the graphics after they are in raster format (bitmapdata)
then the quality will be decreased severely. So what I am trying to
accomplish is to scale up canvas container, and all of its' children,
prior to getting the bitmapdata. This way the resulting bitmap will
not be pixelated or otherwise lose quality. 

The issues that I am experiencing when using scalex/scaley on the
canvas container is that the scale of the container and its' children
is apparently ignored by getBitmapData as the resulting output is at
the original size of the canvas (prior to it being scaled up). The
example app that I pasted below should illustrate this issue.

Any other ideas appreciated.

Thanks!

-Kyle

--- In flexcoders@yahoogroups.com 
, "Ryan Graham" <[EMAIL PROTECTED]> wrote:
>
> 
> You may have to play with some of the positioning, but use the second
> parameter of the bitmapData.draw() function to pass in the object's
> transform matrix as a start. This should get you closer...
> 
> 
> 
> bitmapdata.draw( displayObject2, displayObject2.transform.matrix );
> 
> 
> 
> HTH,
> 
> Ryan
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com 
] On
> Behalf Of Kyle
> Sent: Tuesday, December 09, 2008 12:21 PM
> To: flexcoders@yahoogroups.com  
> Subject: [flexcoders] getBitmapData from a scaled display object
> 
> 
> 
> 
> I'm trying to figure out the easiest way to get bitmapdata from a
> displayobject that has had its scalex/scaley altered. In the test
> example I have listed below, I have a canvas container that has 3
> children (swfLoader components). I set the scalex/scaley of the canvas
> container to 2 and its' children are scaled up proportionally;
> however, when I try to get bitmapdata from the canvas, it does not
> recognize the scaled size of the canvas container and as such when I
> create a new bitmap using the data it is still at the original size.
> Any ideas on how I can get bitmapdata that will match the width/height
> of the scaled canvas would be greatly appreciated!
> 
> 
> http://www.adobe.com/2006/mxml";
> layout="absolute" creationComplete="createImage()">
> 
> 
> 
> 
>  backgroundColor="#FF" id="myCanvas">
> 
> 
>
http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53
> 630bb25563ab28da6c9a3968.swf
> 
> 
> 
>
http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b188
> 8731df7c766a4e274d766b20.swf
> 
> 
> 
>
http://media.dev.freakatars.com.s3.amazonaws.com/2/0/605299b9
> 2bc3993319ceb9490eb52b0f.swf
> 
> 
>  click="createBitmap(event);"/>
> 
> 
> 
> 
> 
> 
> 
> This message is private and confidential. If you have received it in
error, please notify the sender and remove it from your system.
>

 



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

[flexcoders] Re: Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader

2008-12-09 Thread aut0poietic
Thanks for the tip Alex. I'm googling now, but I'm curious how this
could be of benefit to me for a MovieClip on stage. 

Content designers build the SWF's that my application loads in, which
consists of simple MovieClips, images, vector graphics and some
interactions (like drag/drops or a multiple choice question). 

It sounds like I'd have to specify a base class for every movieclip on
stage that implemented IFocusManagerComponent. 

Am I far off, or is there some secret sauce in the kit?


--- In flexcoders@yahoogroups.com, Alex Harui <[EMAIL PROTECTED]> wrote:
>
> The CS3 entities need to implement IFocusManagerComponent.  You
might be able to use the Flash Component Kit to do that
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of aut0poietic
> Sent: Tuesday, December 09, 2008 7:47 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Cannot Tab to MovieClips from Flash SWF Loaded
with SWFLoader
> 
> 
> Title pretty much says it all:
> 
> I have a Flex 3 application which can basically be summed up as a SWF
> player which loads SWF's created in Flash CS3.
> 
> When the SWF's are loaded, I can interact with them using the mouse
> (click/mouseover, etc). However, these items cannot be tabbed to.
> 
> I've been hacking around on this all morning, without much luck. I've
> ensured that every item in the application either has a tabIndex and
> is .tabEnabled or has tabEnabled=false and tabChildren=true.
> 
> I've even resorted to enumerating over the child MovieClips in the swf
> (using swfLoaderInstance.content.getChildAt()) and setting tabEnabled
> and focusRect are both true, and confirming that the tabIndex on these
> mc's was preserved.
> 
> I'm at a serious loss as to what to do next -- I can't have
> controls/interactions that the user can't tab to. Am I missing
> something simple? A setting on the SWFLoader? The Application?
> 
> Hope someone's had to deal with this before and knows a solution.
> 
> Jer
>




[flexcoders] Re: Item Renderer focus on subcomponent in List

2008-12-09 Thread boilerman1984
Alex,

Thanks a bunch.  Days of frustrated work make you overlook whats
staring you in the face sometimes.  In searching for answers I've
noticed your work and responses across the flex world.  You do
excellent work in you blog and responses helping us 'beginners' out.





[flexcoders] Re: getBitmapData from a scaled display object

2008-12-09 Thread Kyle
Hey Ryan,

Thanks for the thought; however, this doesn't solve my problem. The
problem is this: The children of the canvas that I want to scale up
are all vector (swf files). If I use a matrix or any other method to
scale up the graphics after they are in raster format (bitmapdata)
then the quality will be decreased severely. So what I am trying to
accomplish is to scale up canvas container, and all of its' children,
prior to getting the bitmapdata. This way the resulting bitmap will
not be pixelated or otherwise lose quality. 

The issues that I am experiencing when using scalex/scaley on the
canvas container is that the scale of the container and its' children
is apparently ignored by getBitmapData as the resulting output is at
the original size of the canvas (prior to it being scaled up). The
example app that I pasted below should illustrate this issue.

Any other ideas appreciated.

Thanks!

-Kyle



--- In flexcoders@yahoogroups.com, "Ryan Graham" <[EMAIL PROTECTED]> wrote:
>
> 
> You may have to play with some of the positioning, but use the second
> parameter of the bitmapData.draw() function to pass in the object's
> transform matrix as a start. This should get you closer...
> 
>  
> 
> bitmapdata.draw( displayObject2, displayObject2.transform.matrix );
> 
>  
> 
> HTH,
> 
> Ryan
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Kyle
> Sent: Tuesday, December 09, 2008 12:21 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] getBitmapData from a scaled display object
> 
>  
> 
> 
> I'm trying to figure out the easiest way to get bitmapdata from a
> displayobject that has had its scalex/scaley altered. In the test
> example I have listed below, I have a canvas container that has 3
> children (swfLoader components). I set the scalex/scaley of the canvas
> container to 2 and its' children are scaled up proportionally;
> however, when I try to get bitmapdata from the canvas, it does not
> recognize the scaled size of the canvas container and as such when I
> create a new bitmap using the data it is still at the original size.
> Any ideas on how I can get bitmapdata that will match the width/height
> of the scaled canvas would be greatly appreciated!
> 
> 
> http://www.adobe.com/2006/mxml";
> layout="absolute" creationComplete="createImage()">
> 
> 
> 
> 
>  backgroundColor="#FF" id="myCanvas">
> 
> 
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53
> 630bb25563ab28da6c9a3968.swf
> 
> 
> 
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b188
> 8731df7c766a4e274d766b20.swf
> 
> 
> 
> http://media.dev.freakatars.com.s3.amazonaws.com/2/0/605299b9
> 2bc3993319ceb9490eb52b0f.swf
> 
> 
>  click="createBitmap(event);"/>
> 
> 
> 
>  
> 
> 
> 
> 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] Locally generated Flex content not working with IE7

2008-12-09 Thread Wildbore, Brendon
Sounds like an issue with the javascript in the html template you are using 
rather than an issue with the generated flex swf file.

Check your ie browser javascript settings...


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
walveranta
Sent: Wednesday, 10 December 2008 10:10 a.m.
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Locally generated Flex content not working with IE7


I'm having difficulty with locally generated Flex content not showing
up in IE7. When attempting to view Flex-generated content from a local
dev server in IE7 I get the message: "Alternate HTML content should be
placed here. This content requires the Adobe Flash Player. Get Flash"

The same content works fine in FF3. I've uninstalled the Flash players
using uninstall_flash_player.exe, reinstalled Flex 3.0.2, installed
the included debug versions Flash players
(http://www.mediacollege.com/adobe/flash/player/version/show.html
shows version 9,0,124,0 installed on both IE7 and FF3). Tried also to
uninstall Flash players and to install the latest version (10,0,12,36)
for both browsers. The problem doesn't go away.

Flex content from elsewhere (on the web) works fine in IE7 - just not
locally generated content. The "-use-network" switch should not be
applicable because the development server is separate from my
workstation (but I've tried it with true/false values and it made no
difference).

Any thoughts as to what could be causing the problem, and how I might
be able to resolve it?

Thanks!

Ville



[flexcoders] Locally generated Flex content not working with IE7

2008-12-09 Thread walveranta
I'm having difficulty with locally generated Flex content not showing
up in IE7. When attempting to view Flex-generated content from a local
dev server in IE7 I get the message: "Alternate HTML content should be
placed here. This content requires the Adobe Flash Player. Get Flash"

The same content works fine in FF3. I've uninstalled the Flash players
using uninstall_flash_player.exe, reinstalled Flex 3.0.2, installed
the included debug versions Flash players
(http://www.mediacollege.com/adobe/flash/player/version/show.html
shows version 9,0,124,0 installed on both IE7 and FF3). Tried also to
uninstall Flash players and to install the latest version (10,0,12,36)
for both browsers. The problem doesn't go away.

Flex content from elsewhere (on the web) works fine in IE7 - just not
locally generated content. The "-use-network" switch should not be
applicable because the development server is separate from my
workstation (but I've tried it with true/false values and it made no
difference).

Any thoughts as to what could be causing the problem, and how I might
be able to resolve it? 

Thanks!

Ville




[flexcoders] Failed to load policy file from http://localhost:8881/crossdomain.xml

2008-12-09 Thread luvfotography
I'm getting this error when I run my program from my FLEX Builder.

Failed to load policy file from http://localhost:8881/crossdomain.xml

Warning: Failed to load policy file from http://localhost:8881/crossdomain.xml
Error: Request for resource at http://localhost:8881 by requestor from 
http://s.ytimg.com/yt/swf/cps-vfl67854.swf is denied due to lack of policy file 
permissions.


My program is loading a video from youtube, and results in this error.

Where do I put my crossdomain file?? 

thanks, 



RE: [flexcoders] Re: How to make Flex exchange data with Flash SWF file?

2008-12-09 Thread Tracy Spratt
SWFLoader.content.myPublicMember

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of markflex2007
Sent: Tuesday, December 09, 2008 12:51 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How to make Flex exchange data with Flash SWF
file?

 

Thank.

How to get data from the swf.

Thanks

Mark

 



RE: [flexcoders] getBitmapData from a scaled display object

2008-12-09 Thread Ryan Graham

You may have to play with some of the positioning, but use the second
parameter of the bitmapData.draw() function to pass in the object's
transform matrix as a start. This should get you closer...

 

bitmapdata.draw( displayObject2, displayObject2.transform.matrix );

 

HTH,

Ryan

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kyle
Sent: Tuesday, December 09, 2008 12:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] getBitmapData from a scaled display object

 


I'm trying to figure out the easiest way to get bitmapdata from a
displayobject that has had its scalex/scaley altered. In the test
example I have listed below, I have a canvas container that has 3
children (swfLoader components). I set the scalex/scaley of the canvas
container to 2 and its' children are scaled up proportionally;
however, when I try to get bitmapdata from the canvas, it does not
recognize the scaled size of the canvas container and as such when I
create a new bitmap using the data it is still at the original size.
Any ideas on how I can get bitmapdata that will match the width/height
of the scaled canvas would be greatly appreciated!


http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="createImage()">







http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53
630bb25563ab28da6c9a3968.swf



http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b188
8731df7c766a4e274d766b20.swf



http://media.dev.freakatars.com.s3.amazonaws.com/2/0/605299b9
2bc3993319ceb9490eb52b0f.swf






 



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] Re: Item Renderer focus on subcomponent in List

2008-12-09 Thread Alex Harui
That sounds like you're still calling preventDefault on the keyFocusChange 
event.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
boilerman1984
Sent: Tuesday, December 09, 2008 12:16 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Item Renderer focus on subcomponent in List


I fixed the run time error by writing a function to pass the two text
box variables back to the data provider. (ItemEditEnd="func(event);")
Fixed it. So now I can tab into the List's first component but once
focus is on the first renderer I can only tab and shift between the
two boxes in the first renderer. It's like the focus is stuck there.
Any ideas.

Here is the code I added for the ItemEditEnd function. Not sure if
that messes up tabbing and focus.

---
public function endEditRenderer(event:ListEvent):void {
event.preventDefault();

list.editedItemRenderer.data.first=
Renderer(event.currentTarget.itemEditorInstance).firstName.text);

list.editedItemRenderer.data.last=
Renderer(event.currentTarget.itemEditorInstance).lastName.text;

list.destroyItemEditor();

list.dataProvider.itemUpdated(list.editedItemRenderer);

}



RE: [flexcoders] Please Help: Shift data Up|Down in array/datagrid

2008-12-09 Thread Alex Harui
What do your datastructures look like before and after?

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
cox.blair
Sent: Tuesday, December 09, 2008 4:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Please Help: Shift data Up|Down in array/datagrid


Hi everyone, hope someone can offer a suggestion to solve this, or at
least let me know if it possible within Flex/ActionScript.

Here is my sample data:

Date Var1 Var2
-
Mon 34 45
Tues 67 87
Wed 83 12
Thurs 89 23
Fri 12 98
... ... ...

Lets say there is more data, but this is what is visible at the moment.

Question: How could I adjust the Var2 column by essentially moving it
up or down within its column? So if I moved it down (perhaps adding a
null reference to the first row) 45 would appear in the Tues row,
however Var1 would not be changed. If we were to move it up, the 45
would be removed and the 98 in the Fri row would move to Thurs.

At best, it would be good to be able to do this with a slider control
and have it return to normal without destroying the original data
loaded in the array. I was thinking of a custom filter function,
however could not find any references that indicated it could be used
in this manner. Would IViewCursor be capable of doing this? As long as
the datagrid showed the changes, I would be able to perform the
necessary calculations on the adjusted data - correlation.

Any thoughts whatsoever would be greatly appreciated.

--
Blair



RE: [flexcoders] speed of the "for each" looping

2008-12-09 Thread Alex Harui
For each should be much slower than a basic iterator as it has to walk the 
object's properties.

For each (var p:* in someObject)

And

For (var p:String in SomeObject)

Probably run at the same rate.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cato 
Paus
Sent: Tuesday, December 09, 2008 5:28 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] speed of the "for each" looping


Hi, all you experts :)

I'm tying to speed up my application and I use a lot of

exsample
for (var i:int = 0; i < 5; i++)
{
trace(i);
}

so is the "for each" looping faster ?



RE: [flexcoders] Defining, but not adding to parent in MXML

2008-12-09 Thread Alex Harui
If it doesn't need to truly float, consider using states and 
addChild/removeChild

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael 
Prescott
Sent: Tuesday, December 09, 2008 5:59 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Defining, but not adding to parent in MXML


That's it exactly.  Basically, we have a number of situations where we need to 
add pop-up details to elements in our application, so I thought I'm trying to 
make reusable non-visual component that orchestrates that, like this:




  




So I've dug around in PopUpButton to see how it manages its pop-up, and that 
looks simple enough.  But PopUpButton uses the existence of popUp.parent to 
determine whether it is managing the pop up yet (no parent, and it assumes that 
it isn't) - so it seemed that, along with my not knowing about 
includeInLayout="false", creating the popup control in some sort of parentless 
way was important.

Michael

On Tue, Dec 9, 2008 at 1:33 AM, Josh McDonald <[EMAIL PROTECTED]> wrote:

I think he's intending to use PopupManager, but wants to define it in the same 
file as its container?

On Tue, Dec 9, 2008 at 4:30 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

Why not use tooltip or popup manager to float that thing?  Then it won't be 
clipped and what not



From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On 
Behalf Of Josh McDonald
Sent: Monday, December 08, 2008 5:04 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Defining, but not adding to parent in MXML



That's not exactly what you're after, in this case the object will be added to 
the list of children, it's just not positioned on parent.updateDisplayList() or 
counted during parent.measure().

The only way I can think of off the top of my head to do what you're after is 
wrap it in . Here's a quick example:

http://pastie.textmate.org/private/hjd33kkztkuojpzltd2ylw

You can use  to do thins kind of like this, but  
defines classes,  not interfaces, and IIRC, mxmlc is kinda picky as to where 
it'll let you do it.

-Josh

On Tue, Dec 9, 2008 at 10:53 AM, Michael Prescott <[EMAIL 
PROTECTED]> wrote:

Sweet!  Nice that there's an easy answer.



On Mon, Dec 8, 2008 at 4:47 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote:

includeInLayout="false" (also visible="false", of course)



Tracy





From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On 
Behalf Of Michael Prescott
Sent: Monday, December 08, 2008 4:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Defining, but not adding to parent in MXML



Is it possible to define a component but somehow cause it to be omitted from 
the enclosing component's list of children?  Essentially:


  
  


An obvious question is, "Why are you defining the component there if it's not 
supposed to be a child?"

I've got a datagrid inline item renderer that always shows a (summary) piece of 
information, but I want a pop-up to appear on rollover of the summary.  The 
problem I'm having is that the detail is (of course) added to the container 
that holds the summary, which causes the datagrid cell to blow open too big.


  

  
  

  
  

  


Defining the detail outside the itemrenderer entirely seems one way to go, 
except that this would mean there's only one pop up for all of the rows of the 
data grid.

Can you do this sort of thing with a nested component?


  

  
  

  

  

  

  


Any tips would be appreciated!

Michael





--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk



--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk




RE: [flexcoders] Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader

2008-12-09 Thread Alex Harui
The CS3 entities need to implement IFocusManagerComponent.  You might be able 
to use the Flash Component Kit to do that

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
aut0poietic
Sent: Tuesday, December 09, 2008 7:47 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cannot Tab to MovieClips from Flash SWF Loaded with 
SWFLoader


Title pretty much says it all:

I have a Flex 3 application which can basically be summed up as a SWF
player which loads SWF's created in Flash CS3.

When the SWF's are loaded, I can interact with them using the mouse
(click/mouseover, etc). However, these items cannot be tabbed to.

I've been hacking around on this all morning, without much luck. I've
ensured that every item in the application either has a tabIndex and
is .tabEnabled or has tabEnabled=false and tabChildren=true.

I've even resorted to enumerating over the child MovieClips in the swf
(using swfLoaderInstance.content.getChildAt()) and setting tabEnabled
and focusRect are both true, and confirming that the tabIndex on these
mc's was preserved.

I'm at a serious loss as to what to do next -- I can't have
controls/interactions that the user can't tab to. Am I missing
something simple? A setting on the SWFLoader? The Application?

Hope someone's had to deal with this before and knows a solution.

Jer



RE: [flexcoders] clearing out mx:DateField

2008-12-09 Thread Alex Harui
To clear selection from a list, set selectedIndex = -1

Setting selectedDate = null worked for me.

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


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

Sort of.

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

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

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

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

> From: flexcoders@yahoogroups.com 
> [mailto:flexcoders@yahoogroups.com] On
> Behalf Of Stephen More
> Sent: Tuesday, December 09, 2008 12:18 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] clearing out mx:DateField
>
>
>
> Within flex I have:
> 
>
> Once a user selects a date, I can not clear it out using actionscript.
>
> I have tried:
> effective.selectedDate = null;
> effective.selectedDate = undefined;
> neither one has worked.
>
> How can one clear out the mx:DateField ?
>
> -Thanks
>
> This message is private and confidential. If you have received it in error,
> please notify the sender and remove it from your system.
>



[flexcoders] Re: Item Renderer focus on subcomponent in List

2008-12-09 Thread boilerman1984
I fixed the run time error by writing a function to pass the two text
box variables back to the data provider.  (ItemEditEnd="func(event);")
Fixed it.  So now I can tab into the List's first component but once
focus is on the first renderer I can only tab and shift between the
two boxes in the first renderer.  It's like the focus is stuck there.
Any ideas.  

Here is the code I added for the ItemEditEnd function.  Not sure if
that messes up tabbing and focus.

---
public function endEditRenderer(event:ListEvent):void { 
event.preventDefault();
   
list.editedItemRenderer.data.first=   
Renderer(event.currentTarget.itemEditorInstance).firstName.text);

list.editedItemRenderer.data.last=  
Renderer(event.currentTarget.itemEditorInstance).lastName.text;

list.destroyItemEditor();

list.dataProvider.itemUpdated(list.editedItemRenderer);
  
}



[flexcoders] Re: speed of the "for each" looping

2008-12-09 Thread Cato Paus
Hi and thanks for your deep explanation :) and yes I run the profiler,
and are doing some improvement here and there, the real question is
how the "for each" is working. I have been browsing the internet and
all the bibels on ActionScript 3, but did not found any good
explanation on the matter.


--- In flexcoders@yahoogroups.com, Maciek Sakrejda <[EMAIL PROTECTED]> wrote:
>
> If you're trying to speed up your application, you should use the
> profiler. Something like the difference between a "manually" indexed for
> loop and a for-each loop is almost certain to be trivial.
> 
> If you don't have the profiler, run an ad-hoc perf test by doing
> something like
> 
> // we need to construct something to iterate over:
> var iterations:int = 100;
> var arr:Array = [];
> for (var i:int = 0; i < iterations; i++) arr.push(i);
> var dummy:int = 0;
> 
> var forBeginning:Number = new Date().getTime();
> for (var j:int = 0; j < iterations; j++)
> {
> // we need to do something in the loop so the whole thing
> // is not just optimized out (not sure if FP does this, but
> // it can), but we don't want to use trace() since I/O is
> // relatively expensive compared to the cost of the loop itself
> dummy = arr[j];
> } 
> trace("for loop took " + (new Date().getTime() - forBeginning) + "
> milliseconds");
> 
> var forEachBeginning:Number = new Date().getTime();
> for each (var k:int in arr)
> {
> dummy = k;
> }
> trace("for-each loop took " + (new Date().getTime() - forEachBeginning)
> + " milliseconds");
> 
> That should give you an idea of the difference (but run this many times
> and average it, and vary the order of the loops). Also, keep in mind
> that most of the time, you won't be iterating over a million items.
> Bottlenecks can occur in surprising places (though they're often found
> in common places too, like Container layout code). Don't try to optimize
> things that *seem like* they would be slow without actually confirming
> not only that they *are* slow, but that they are affecting the overall
> speed or responsiveness of your application. It makes no sense to make a
> 10x performance improvement in one part of your code that accounts
> for .01% of your application's CPU usage.
> 
> -- 
> Maciek Sakrejda
> Truviso, Inc.
> http://www.truviso.com
> 
> -Original Message-
> From: Cato Paus <[EMAIL PROTECTED]>
> Reply-To: flexcoders@yahoogroups.com
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] speed of the "for each" looping
> Date: Tue, 09 Dec 2008 13:28:23 -
> 
> Hi, all you experts :)
> 
> I'm tying to speed up my application and I use a lot of
> 
> exsample
> for (var i:int = 0; i < 5; i++)
> {
> trace(i);
> } 
> 
> so is the "for each" looping faster ?
>




RE: [flexcoders] errorTip fontSize break the tooltip? Possible bug?

2008-12-09 Thread Alex Harui
I'd say that's a bug.  Tooltip doesn't re-measure correctly.  Note that it 
would never auto-resize once it did measure correctly since parents size their 
children in Flex so you'd have to size the Tooltip later.

ToolTip basically expects its styles to be set in the errorTip style 
declaration and should evaluate that properly within createToolTip.  You can 
provide an alternative ToolTipClass that handles your situation.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fotis 
Chatzinikos
Sent: Monday, December 08, 2008 5:24 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] errorTip fontSize break the tooltip? Possible bug?


Here you are: (And a screenshot - via mail - have not tried before so do not 
know if attachment work here...)


http://www.adobe.com/2006/mxml"; layout="absolute" 
creationComplete="init()">




.errorTipGreen
{
color: #FF;
fontSize: 11;
fontWeight: "bold";
shadowColor: #00;
borderColor: #00FF00;
borderStyle: "errorTipAbove";
paddingBottom: 4;
paddingLeft: 4;
paddingRight: 4;
paddingTop: 4;
}




On Mon, Dec 8, 2008 at 8:25 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

Can you post an entire test case that is as small as possible?



From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On 
Behalf Of Fotis Chatzinikos
Sent: Monday, December 08, 2008 9:44 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] errorTip fontSize break the tooltip? Possible bug?



bump :-)

Sorry did not get a reply on this... Could somebody test? Alex?

On Thu, Dec 4, 2008 at 1:01 PM, fotis.chatzinikos <[EMAIL 
PROTECTED]> wrote:

Hi, the following works:

.errorTip
{
color: #FF;
/*fontSize: 11;*/
fontWeight: "bold";
shadowColor: #00;
borderColor: #FF;
borderStyle: "errorTipAbove";
paddingBottom: 4;
paddingLeft: 4;
paddingRight: 4;
paddingTop: 4;
}

If I un-comment fontSize, the font gets bigger but the tooltip text
gets outside of the tooltips 'area'. Ie text length is 200 pixels and
tooltips area 150 pixels... Is the tooltip's area calculations
hardcoded to font size 9?

Fotis



--
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],



--
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],



Re: [flexcoders] clearing out mx:DateField

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

Sort of.

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

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

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

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


> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Stephen More
> Sent: Tuesday, December 09, 2008 12:18 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] clearing out mx:DateField
>
>
>
> Within flex I have:
> 
>
> Once a user selects a date, I can not clear it out using actionscript.
>
> I have tried:
> effective.selectedDate = null;
> effective.selectedDate = undefined;
> neither one has worked.
>
> How can one clear out the mx:DateField ?
>
> -Thanks
>
> This message is private and confidential. If you have received it in error,
> please notify the sender and remove it from your system.
> 


RE: [flexcoders] AIR Application - Positioning.

2008-12-09 Thread Wildbore, Brendon
You could find the resolution,subtract the initial width of you app then set 
this to your apps (x,y) coordinates?

Would so something like (pseudo-code):
this.x = Capabilities.screenResolutionX - this.width;
this.x = Capabilities.screenResolutionY - this.height;

I'm not sure this would be the 'best' way of doing so but I struggled to find 
anyway on the web as well




From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Daniel
Sent: Tuesday, 9 December 2008 11:04 p.m.
To: flexcoders@yahoogroups.com
Subject: [flexcoders] AIR Application - Positioning.


Hi,

I have a requirement for an application, it provides extensions based
on a name entry box.

The client would like it to appear as a system tray icon, and when you
click it, the application opens above it. When you find results the
application window stretches upwards to show the results.

My google powers have failed me and I'm unsure on the best way to
tackle this. Two possibilities, I assume, are to make a 100% screen
size transparent application with an area visible in the bottom right
OR just resize the application in the bottom right.

I'm unsure on either at the moment.

Thanks, Dan



Re: [flexcoders] Re: Bug: flash.display.Graphics being removed.

2008-12-09 Thread Nate Beck
It is showing up in the 3.x branch.

On Tue, Dec 9, 2008 at 9:01 AM, flexaustin <[EMAIL PROTECTED]> wrote:

>   In Flex 3.1 framework import flash.display.Graphics isn't showing in
> code hinting.
>
>
> --- In flexcoders@yahoogroups.com ,
> "sunild99" <[EMAIL PROTECTED]> wrote:
> >
> > Usually, when code completion stops working in Flex Builder, it's
> because the I'm editing
> > has an error/omission in it...
> >
> > Sunil
> >
> >
> > --- In flexcoders@yahoogroups.com , li
> wenzhi  wrote:
> > >
> > > in my flex project using flexsdk3.1, while coding in flexbuilder,
> the uicomponent
> > cannot auto hint the graphics attribute after "."
> > > graphics missing in flexsdk3.1?
> > >
> > > --
> > > lwz7512
> > > Ultrapower Flex Team Leader
> > > OpenRIA -- A Window You Exploring RIA World
> > > http://www.rimeeting.cn
> > >
> > >
> > >
> > >
> > > 
> > > From: flexaustin 
> > > To: flexcoders@yahoogroups.com 
> > > Sent: Saturday, December 6, 2008 5:56:11 AM
> > > Subject: [flexcoders] Bug: flash.display.Graphics being removed.
> > >
> > >
> > > Has anyone had this issue? I do the following (using Flex Builder 3
> > > w/ sdk 3.1 and Flash Player 10).
> > >
> > > // BEGIN CODE  - - - - --
> > > import flash.display. Graphics;
> > >
> > > public function get drawGraphics( ):Graphics {
> > > if(_drawing) {
> > > return _drawing.graphics;
> > > } else {
> > > return null;
> > > }
> > > }
> > > // END CODE  - - - - 
> > >
> > > Every 3rd or 4th time I save my file, Flex Builder removes my import
> > > statement then I get t"1046 Type not found..."
> > >
> >
>
>  
>


RE: [flexcoders] clearing out mx:DateField

2008-12-09 Thread Ryan Graham

>> effective.selectedDate = null;

 

This should clear it.  Perhaps the actionscript function containing this
code isn't getting called.

 

HTH,

Ryan

 

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

 

Within flex I have:


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

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

How can one clear out the mx:DateField ?

-Thanks

 



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

[flexcoders] Re: clearing out mx:DateField

2008-12-09 Thread jim.abbott45
Hmm . . . I would think that should work, I've used the
foo.selectedDate = null technique before.

Here's how my technique for clearing out a DateField looks (in this
example: it is filtering a data provider, and 'tomorrowOn' is an
instance of an Object which has a rangeStart property):

startDateField.selectedDate = null; 
startDateField.disabledRanges = new Array();
startDateField.disabledRanges.push(tomorrowOn);
openingDataProvider.refresh();


--- In flexcoders@yahoogroups.com, "Stephen More" <[EMAIL PROTECTED]>
wrote:
>
> Within flex I have:
>  
> 
> Once a user selects a date, I can not clear it out using actionscript.
> 
> I have tried:
>  effective.selectedDate = null;
>  effective.selectedDate = undefined;
> neither one has worked.
> 
> How can one clear out the mx:DateField ?
> 
> -Thanks
>




Re: [flexcoders] Listening for both Mouse Down and Double Click events.

2008-12-09 Thread Brendan Meutzner
There is a double click event you can listen for on UIComponent... just make
sure that doubleClickEnabled is set to true on the instance you're setting
the listener on.

Brendan



On Tue, Dec 9, 2008 at 11:04 AM, flexaustin <[EMAIL PROTECTED]> wrote:

>   Is it possible to listen for both a mouse down and doubleclick events
> without using some sort of timer? On mouse down start timer to listen
> for a another mouse down?
>
> If you listen for a mouse down and in the mouse down handler add
> another listener to listen for some other action is a possibility I
> guess, but would it add the listener in time?
>
> TIA
>
>  
>



-- 
Brendan Meutzner
http://www.meutzner.com/blog/


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

2008-12-09 Thread Seth Hodgson
Agreed, but one caution: Implementing things from scratch on top of 
flash.net.Socket may be an option for some limited use cases, but without the 
direct browser integration it doesn't make for a great general solution (in the 
case of WebDAV, or for general HTTP)

You lose integrated auth (NTLM for instance), security (SSL/certificate 
truststore and UI to manage it), state (cookies - whether you love them or hate 
them), etc. that the Player gets for free when it uses the browser's HTTP 
stack. This stuff turns out to be pretty valuable in practice.

Best,
Seth

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

How exactly do you envision WebDAV being used with flash ?

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

On Tue, Dec 9, 2008 at 2:10 PM, Seth Hodgson  wrote:
> Unfortunately, the Player currently limits the set of allowed HTTP methods
> to just GET and POST.
>
> This means that PUT, DELETE, HEAD, etc. as well as all the WebDAV extension
> methods are not allowed.
>
> Anyone who cares about this area should vote for this bug:
> https://bugs.adobe.com/jira/browse/SDK-12200
> And perhaps add a new bug specifically regarding WebDAV, although support
> for that would definitely be lower priority.
>
> As a workaround for core HTTP methods, you could use the proxy service in
> BlazeDS or LCDS which does supports all the core methods (mod PUT apparently
> - not sure why that one's not included, possibly a doc error). We use
> HTTPClient internally in the proxy service, and this library doesn't support
> WebDAV extension methods so you'd still be out of luck with WebDAV
> integration there as well.
>
> Best,
> Seth
>
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of marty_martian
> Sent: Tuesday, December 09, 2008 7:35 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] WebDAV and Flex - Any sample code or opensource
> widgets available . . ?
>
> I have searched through the archives for this user group but see very
> little discussion on WebDAV with Flex. It looks like some folks have
> been trying to do it as far back as 2006 but no samples or pointers to
> samples or open source widgets have been posted.
>
> Related to this, can anyone share:
>
> - samples
> - pointers to samples
> - open source widgets
>
> Most Grateful,
>
> Christopher
>



[flexcoders] getBitmapData from a scaled display object

2008-12-09 Thread Kyle

I'm trying to figure out the easiest way to get bitmapdata from a
displayobject that has had its scalex/scaley altered. In the test
example I have listed below, I have a canvas container that has 3
children (swfLoader components). I set the scalex/scaley of the canvas
container to 2 and its' children are scaled up proportionally;
however, when I try to get bitmapdata from the canvas, it does not
recognize the scaled size of the canvas container and as such when I
create a new bitmap using the data it is still at the original size.
Any ideas on how I can get bitmapdata that will match the width/height
of the scaled canvas would be greatly appreciated!






http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="createImage()">







http://media.dev.freakatars.com.s3.amazonaws.com/2/0/2d78ad53630bb25563ab28da6c9a3968.swf



http://media.dev.freakatars.com.s3.amazonaws.com/2/0/5a97b1888731df7c766a4e274d766b20.swf



http://media.dev.freakatars.com.s3.amazonaws.com/2/0/605299b92bc3993319ceb9490eb52b0f.swf










RE: [flexcoders] huge AMF messages

2008-12-09 Thread Seth Hodgson
If you sent these in a RemoteObject call, that 10MB worth of data would go to 
the server in the body of a single HTTP POST. No progress events, and depending 
on the receiving server it may enforce size limits on body content of HTTP 
requests but they'd likely be higher than 10MB.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robin 
Burrer
Sent: Tuesday, December 09, 2008 4:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] huge AMF messages

Hi all,

I planning to build an  AIR application. In this application the user can 
create libraries that consist of multiple value Entry objects.

Each EntryVO should look like this (there will be more properties of course) :

package vo
{
[RemoteClass(alias="vo.EntryVO")]

import flash.net.registerClassAlias;
import flash.utils.ByteArray;

public class EntryVO
{
[Bindable]
public var image_data:ByteArray;

[Bindable]
public var image_name:String;


public static  function register():void
{
registerClassAlias("vo.EntryVO", EntryVO);
}

}

}


To simplify the uploading and downloading process I want to transfer images as 
ByteArrays to a .NetBackend.
My question: What are my limitations here file size wise?  Let's say I have 10 
EntryVO. An each of these
has an 1 MB byte array embedded.

That
means that my libraryVO (10 x 1 MB EntryVO)  would have a file size of 10 MB.

Will this work at all? Is there a progress event for remote operations? I guess 
it will take a while to transfer
a 10 MB AMF message.


Thanks for any input!


Cheers

Robin



[flexcoders] clearing out mx:DateField

2008-12-09 Thread Stephen More
Within flex I have:
 

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

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

How can one clear out the mx:DateField ?

-Thanks


Re: [flexcoders] XML Decoding

2008-12-09 Thread Richard Rodseth
This is unfortunate.
I got tired of custom XML decoding and wanted to use SimpleXMLDecoder +
Darron Schall's ObjectTranslator.
But SimpleXMLDecoder expects an XMLNode not an XML or XMLList

The technique described here is a possibility (perhaps my best option),
except I don't wish to decode the entire XML returned at once:

http://booleanbetrayal.com/2007/05/18/httpservice-xmldecode-objecttranslator-and-rabidsquirrels/

Converting an XML  to an XMLDocument via a string seems like a really bad
example to show people:

http://blog.flexexamples.com/2007/09/19/converting-xml-to-objects-using-the-flex-simplexmldecoder-class/

Any good new solutions out there?


On Fri, Aug 15, 2008 at 7:35 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

>I recommend custom conversion whether with static factory methods or
> something more brute force, although it might depend a bit on whether you're
> round-tripping the xml.  If you're not, and are going to be hitting
> attributes in the nodes frequently, it will probably pay to convert the node
> from xml to class instance, especially if you don't need all of the
> attributes.  Some webservices return a lot of data per-item that I'm just
> going to ignore and a generic XML walker iterates all the nodes and
> attributes while a custom one can pick and choose the few things it might
> need.
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Richard Rodseth
> *Sent:* Friday, August 15, 2008 5:07 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] XML Decoding
>
>
>
> Not yet, though I saw a reference to that in my Googling. I think I'm just
> going to hold my nose gently and make static factory methods that take an
> XML argument. I've been experimenting with the XML-backed idea and that's
> not too bad either.
>
> Harder to switch between XML and AMF I guess, but KISS applies too. Unless
> there's a good library out there yet to be revealed.
>
> On Fri, Aug 15, 2008 at 5:03 PM, Tracy Spratt <[EMAIL PROTECTED]>
> wrote:
>
> Have you looked at the Flex 3 functionality that reads the webservice wsdl
> and generates code for strongly typed access?
>
>
>
> It was way too complicated for my needs but might help answer your
> questions.
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Richard Rodseth
> *Sent:* Friday, August 15, 2008 5:12 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] XML Decoding
>
>
>
> What's the latest and greatest on XML Decoding?
>
> Reading the blogs and docs, it looks as though SimpleXMLDecoder +
> ObjectTranslator is one approach, but seems to rely on (deprecated?)
> XMLDocument and is not schema-aware.
>
> I've also considered defining some interfaces and providing XML-backed
> implementations that would point back to the nodes in the original DOM,
> perhaps with binding support and caching of the typed objects. But I think
> I'd just prefer a nice clean way to convert the whole structure to typed
> objects, and then throw the XML away.
>
> Any recommendations?
>
>
>
>  
>


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

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

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


On Tue, Dec 9, 2008 at 2:10 PM, Seth Hodgson  wrote:
> Unfortunately, the Player currently limits the set of allowed HTTP methods
> to just GET and POST.
>
> This means that PUT, DELETE, HEAD, etc. as well as all the WebDAV extension
> methods are not allowed.
>
> Anyone who cares about this area should vote for this bug:
> https://bugs.adobe.com/jira/browse/SDK-12200
> And perhaps add a new bug specifically regarding WebDAV, although support
> for that would definitely be lower priority.
>
> As a workaround for core HTTP methods, you could use the proxy service in
> BlazeDS or LCDS which does supports all the core methods (mod PUT apparently
> - not sure why that one's not included, possibly a doc error). We use
> HTTPClient internally in the proxy service, and this library doesn't support
> WebDAV extension methods so you'd still be out of luck with WebDAV
> integration there as well.
>
> Best,
> Seth
>
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of marty_martian
> Sent: Tuesday, December 09, 2008 7:35 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] WebDAV and Flex - Any sample code or opensource
> widgets available . . ?
>
> I have searched through the archives for this user group but see very
> little discussion on WebDAV with Flex. It looks like some folks have
> been trying to do it as far back as 2006 but no samples or pointers to
> samples or open source widgets have been posted.
>
> Related to this, can anyone share:
>
> - samples
> - pointers to samples
> - open source widgets
>
> Most Grateful,
>
> Christopher
> 


RE: [flexcoders] JSP taglib FLEX 3

2008-12-09 Thread Seth Hodgson
You need to merge the entire web tier compiler WAR with your existing WAR. If 
you just move random jars over chances are good you'll miss some dependencies.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of virchete
Sent: Tuesday, December 02, 2008 6:21 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] JSP taglib FLEX 3

I am trying to use the jsp tag library into a very simple jsp:

<%@ taglib uri="FlexTagLib" prefix="mm" %>

Introduction
This is an example of writing MXML in a JSP.
My App

http://www.adobe.com/2006/mxml";>







I have a Java project that uses STRUTS to redirect. Well the problem
is that, although I have included the flex-bootstrap.jar,
flex-bootstrap-jsp.jar, flex-webtier.jar and flex-webtier-jsp.jar I
always receive the same exception in the explorer or mozilla navigator:

java.lang.NullPointerException
flex.bootstrap.BootstrapTag.(BootstrapTag.java:24)
flex.bootstrap.BootstrapBodyTag.(BootstrapBodyTag.java:14)
flex.webtier.server.j2ee.jsp.MxmlTagImpl.(MxmlTagImpl.java:2)

I am using Tomcat 6 server and I receive always the following trace:

EVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to read TLD
"META-INF/taglib.tld" from JAR file
"file:/C:/google2/MapasOpodo/build/web/WEB-INF/lib/flex-bootstrap.jar": 
java.lang.NullPointerException
at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:181)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:182)
at
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
...
...
...

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at flex.bootstrap.BootstrapTag.(BootstrapTag.java:24)
at
flex.bootstrap.BootstrapBodyTag.(BootstrapBodyTag.java:14)

Well If you need something more (the source code) don't doubt to ask
me. I am so sorry for having to find help, but I have lost all the day
of work today, and if you could help me...

Many Thanks
David Virgil.



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

2008-12-09 Thread Seth Hodgson
Unfortunately, the Player currently limits the set of allowed HTTP methods to 
just GET and POST.

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

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

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

Best,
Seth

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

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

Related to this, can anyone share:

- samples
- pointers to samples
- open source widgets

Most Grateful,

Christopher


RE: [flexcoders] Call Flex from JavaScript

2008-12-09 Thread Seth Hodgson
Not that I'm aware of. Javascript alert is the only way to block a page close, 
and even then only until the user clicks OK. The various close-related events 
in Javascript exhibit subtle differences across browsers/versions and allowing 
a script to force a page to remain open (for any length of time 
programmatically including potentially indefinitely) would be a serious 
security and usability issue.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz
Sent: Tuesday, December 09, 2008 10:40 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Call Flex from JavaScript

Unfortunately that is not an option. This is a video player tracking system on 
a very public landing page.

Would onbeforeunload work better? Is there a way to just delay the closing of a 
page before it happens (behind the scenes)?

Any other javascript events that would work better?

From: Seth Hodgson <[EMAIL PROTECTED]>
Sent: Tuesday, December 09, 2008 10:32 AM
To: "flexcoders@yahoogroups.com" 
Subject: RE: [flexcoders] Call Flex from JavaScript
You need to pop a Javascript alert in your trackClosing() method to keep the 
browser from closing until the user clicks the OK button.

This technique is a hack, but an alert generally leads to a long enough delay 
in user interaction (say a second or two) to finish making your call into the 
Player before the browser process exits.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz
Sent: Tuesday, December 09, 2008 10:26 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Call Flex from JavaScript

Based on that and other examples, I tried this:


window.onunload = trackClosing;
function trackClosing(){
document.getElementById("FXVideo").tagWithClosed();
}



In my constructor I have:
if (ExternalInterface.available){
ExternalInterface.addCallback("tagWithClosed",windowClosed);
}

It doesn't seem to work. Any ideas on what I am doing wrong?


From: Seth Hodgson <[EMAIL PROTECTED]>
Sent: Tuesday, December 09, 2008 9:50 AM
To: "flexcoders@yahoogroups.com" 
Subject: RE: [flexcoders] Call Flex from JavaScript
This page in the LCDS docset describes this specifically: 
http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconnections_4.html#1074309

The scenario in the docs is dealing with notifying the server that the client 
is going away, in order to short-circuit the slower normal notification based 
on server session timeout. But you could use the same technique to achieve 
other things as well.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz
Sent: Monday, December 08, 2008 6:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Call Flex from JavaScript

Using a set up in my ActionScript of:
ExternalInterface.addCallback("tagWithClosed",windowClosed);

How can I write a JavaScript function that calls 'tagWithClosed' to Flex when 
the user closes the window (window.close() ) or when they leave for another 
page?






RE: [flexcoders] Call Flex from JavaScript

2008-12-09 Thread wkolcz
Unfortunately that is not an option. This is a video player tracking system on 
a very public landing page. 

Would onbeforeunload work better? Is there a way to just delay the closing of a 
page before it happens (behind the scenes)?

Any other javascript events that would work better?


From: Seth Hodgson <[EMAIL PROTECTED]>
Sent: Tuesday, December 09, 2008 10:32 AM
To: "flexcoders@yahoogroups.com" 
Subject: RE: [flexcoders] Call Flex from JavaScript 

You need to pop a Javascript alert in your trackClosing() method to keep the 
browser from closing until the user clicks the OK button.

This technique is a hack, but an alert generally leads to a long enough delay 
in user interaction (say a second or two) to finish making your call into the 
Player before the browser process exits.

Best,

Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz

Sent: Tuesday, December 09, 2008 10:26 AM

To: flexcoders@yahoogroups.com

Subject: RE: [flexcoders] Call Flex from JavaScript

Based on that and other examples, I tried this:



window.onunload = trackClosing;

function trackClosing(){

document.getElementById("FXVideo").tagWithClosed();

}



In my constructor I have:

if (ExternalInterface.available){

ExternalInterface.addCallback("tagWithClosed",windowClosed);

}

It doesn't seem to work. Any ideas on what I am doing wrong?



From: Seth Hodgson <[EMAIL PROTECTED]>

Sent: Tuesday, December 09, 2008 9:50 AM

To: "flexcoders@yahoogroups.com" 

Subject: RE: [flexcoders] Call Flex from JavaScript

This page in the LCDS docset describes this specifically: 
http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconnections_4.html#1074309

The scenario in the docs is dealing with notifying the server that the client 
is going away, in order to short-circuit the slower normal notification based 
on server session timeout. But you could use the same technique to achieve 
other things as well.

Best,

Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz

Sent: Monday, December 08, 2008 6:28 PM

To: flexcoders@yahoogroups.com

Subject: [flexcoders] Call Flex from JavaScript

Using a set up in my ActionScript of:

ExternalInterface.addCallback("tagWithClosed",windowClosed);

How can I write a JavaScript function that calls 'tagWithClosed' to Flex when 
the user closes the window (window.close() ) or when they leave for another 
page?





RE: [flexcoders] Call Flex from JavaScript

2008-12-09 Thread Seth Hodgson
You need to pop a Javascript alert in your trackClosing() method to keep the 
browser from closing until the user clicks the OK button.

This technique is a hack, but an alert generally leads to a long enough delay 
in user interaction (say a second or two) to finish making your call into the 
Player before the browser process exits.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz
Sent: Tuesday, December 09, 2008 10:26 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Call Flex from JavaScript

Based on that and other examples, I tried this:


window.onunload = trackClosing;
function trackClosing(){
document.getElementById("FXVideo").tagWithClosed();
}



In my constructor I have:
if (ExternalInterface.available){
ExternalInterface.addCallback("tagWithClosed",windowClosed);
}

It doesn't seem to work. Any ideas on what I am doing wrong?



From: Seth Hodgson <[EMAIL PROTECTED]>
Sent: Tuesday, December 09, 2008 9:50 AM
To: "flexcoders@yahoogroups.com" 
Subject: RE: [flexcoders] Call Flex from JavaScript
This page in the LCDS docset describes this specifically: 
http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconnections_4.html#1074309

The scenario in the docs is dealing with notifying the server that the client 
is going away, in order to short-circuit the slower normal notification based 
on server session timeout. But you could use the same technique to achieve 
other things as well.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz
Sent: Monday, December 08, 2008 6:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Call Flex from JavaScript

Using a set up in my ActionScript of:
ExternalInterface.addCallback("tagWithClosed",windowClosed);

How can I write a JavaScript function that calls 'tagWithClosed' to Flex when 
the user closes the window (window.close() ) or when they leave for another 
page?






[flexcoders] Re: Item Renderer focus on subcomponent in List

2008-12-09 Thread boilerman1984
I believe I found the problem.  I need to rewrite an event to return
multiple values from the item editor instead of the default 'text'
value.  I'll work on this and the tab should work I'm guessing. If it
does not I will report back.  Thanks for the help again.



RE: [flexcoders] Call Flex from JavaScript

2008-12-09 Thread wkolcz
Based on that and other examples, I tried this:


window.onunload = trackClosing;
function trackClosing(){
document.getElementById("FXVideo").tagWithClosed();
}



In my constructor I have:
if (ExternalInterface.available){ 
ExternalInterface.addCallback("tagWithClosed",windowClosed);
}

It doesn't seem to work. Any ideas on what I am doing wrong?


From: Seth Hodgson <[EMAIL PROTECTED]>
Sent: Tuesday, December 09, 2008 9:50 AM
To: "flexcoders@yahoogroups.com" 
Subject: RE: [flexcoders] Call Flex from JavaScript 

This page in the LCDS docset describes this specifically: 
http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconnections_4.html#1074309

The scenario in the docs is dealing with notifying the server that the client 
is going away, in order to short-circuit the slower normal notification based 
on server session timeout. But you could use the same technique to achieve 
other things as well.

Best,

Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz

Sent: Monday, December 08, 2008 6:28 PM

To: flexcoders@yahoogroups.com

Subject: [flexcoders] Call Flex from JavaScript

Using a set up in my ActionScript of:

ExternalInterface.addCallback("tagWithClosed",windowClosed);

How can I write a JavaScript function that calls 'tagWithClosed' to Flex when 
the user closes the window (window.close() ) or when they leave for another 
page?





[flexcoders] Automating Flex Modules

2008-12-09 Thread Denis
Hi everyone,

We have a Flex app that generates various charts that also need to 
find their way into printed reports. While we offer on-line 
functionality to export displayed charts and convert them into 
bitmaps, we also need to allow users to generate the preconfigured 
charts without displaying the flash component that generates them in 
the browser. In other words, we need to be able to generate the charts 
on the server.

Are there components that allow to open a flash file from the server 
and interact with it? Would AIR be helpful with this?

Any kind of guidance or direction would be greatly appreciated.

Regard,
Denis



Re: [flexcoders] Re: Parsley MVC :: some thoughts

2008-12-09 Thread Paul Andrews

- Original Message - 
From: "Ralf Bokelberg" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, December 09, 2008 3:00 PM
Subject: Re: [flexcoders] Re: Parsley MVC :: some thoughts


> Hi Amy
>
> Afaik this is not possible in Flashplayer. A block of code is always
> running through without any interuption.

I think this has been part of the discussion in the thread. While it is what 
I would expect, if dispatching events causes all listening event handlers to 
be called synchronously, it means that any block of code dispatching an 
event is going to be interrupted and potentially "unknown" event listeners 
called during the execution of that code block.

Here's an interesting scenario:

If I have a block of code building a data structure and it has an object 
reference to some model. It could be that it encounters some situation and 
dispatches an event. The event handler may then interrogate the model, 
modify the model and control then returns to the executing block which is 
then unaware of the model change and still iterating through the model.

My expectation would be that dispatch event would add the event to a queue 
of events ready to be handled, but those would not be handled until the code 
block had completed.

In other systems/languages my code blocks would include semaphore handling 
to protect such data structures, but there's no option for me to do that in 
actionscript.

You may argue that the developer should 'know' what may potentially happen 
when  writing code and despatching events, but in practice who knows who may 
add a new event handler to the application in future and may introduce a 
problem.

I don't have a problem with all event handlers being called when an event is 
fully despatched, but that's potentially dangerous if it's done in the 
middle of a code block. Anyway it's just a thing to keep in mind. I would 
agree that it's a marginal and unlikely scenario.

Paul


>Colin Moock has a good
> chapter of how all this works in his nice AS3 book.
>
> Cheers
> Ralf.
>
>
>
> On Tue, Dec 9, 2008 at 3:44 PM, Amy <[EMAIL PROTECTED]> wrote:
>
>> I actually had this very thing happen in my code a couple of weeks
>> ago. I normally expect that the code in a function will all run as a
>> block unless, of course, I'm calling out to another function. But in
>> one case, one of the statements I was using (addEventListener, I
>> think), opened up enough of a timing "hole" in my code that some
>> other code (not the function that was being added in the event
>> listener, which might have been partially understandable) ran
>> unexpectedly at that point. The only solution I found was to make
>> sure I put all of the other code that _had_ to run in that block
>> before anything else happened above the addEventListener code.
>>
>> -Amy
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups 
> Links
>
>
>



[flexcoders] Re: How to make Flex exchange data with Flash SWF file?

2008-12-09 Thread markflex2007
Thank.

How to get data from the swf.

Thanks

Mark



RE: [flexcoders] Call Flex from JavaScript

2008-12-09 Thread Seth Hodgson
This page in the LCDS docset describes this specifically: 
http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconnections_4.html#1074309

The scenario in the docs is dealing with notifying the server that the client 
is going away, in order to short-circuit the slower normal notification based 
on server session timeout. But you could use the same technique to achieve 
other things as well.

Best,
Seth


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz
Sent: Monday, December 08, 2008 6:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Call Flex from JavaScript

Using a set up in my ActionScript of:
ExternalInterface.addCallback("tagWithClosed",windowClosed);

How can I write a JavaScript function that calls 'tagWithClosed' to Flex when 
the user closes the window (window.close() ) or when they leave for another 
page?



[flexcoders] RE: services-config.xml: compc or just mxmlc?

2008-12-09 Thread Seth Hodgson
Hi Maciek,

I don't have any practical experience with attempting to compile service config 
and associated classes into modules and I don't know whether compc would 
support it or not, but based on some informal discussions with Alex and Jeff I 
wouldn't recommend it.

The core issue is that AMF serialization mappings (client to server class 
aliases) within Flash Player aren't scoped per module or even app domain as 
loaded classes are - unfortunately they're scoped to a security domain (broader 
scope). This means that if the root swf loads two or more modules (each will be 
loaded in its own child ApplicationDomain by default), where these modules bake 
in overlapping sets of classes that use [RemoteClass] metadata things won't 
work. The modules will effectively trample each other's registered class 
aliases to point to their respective local classes. Say you have a class Foo 
([RemoteClass(alias="com.Foo")]), that you've compiled into both modules. You 
now have two separate class defs on the client (one per module/sub app domain), 
but only one alias registered (scoped to the security domain both of these app 
domains belong to). When the loosing module receives a Foo off the network it 
will fail to deserialize correctly because the alias mapping points to the 
class def in the other module, which this module doesn't have access to.

I think the best approach for now is to place your service config and all 
shared classes with [RemoteClass] metadata into your root swf, and then expose 
this to your modules through a controlled API - say a registry of network 
services or operations the modules can use. You may be able to get away with 
keeping non-shared classes with [RemoteClass] metadata in specific modules, but 
I haven't tried that.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Maciek 
Sakrejda
Sent: Sunday, December 07, 2008 9:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] services-config.xml: compc or just mxmlc?

Does compc care about the contents of the services-config.xml file? If I 
compile a .swc component with compc with one set of services defined, but then 
change the services-config.xml file and build a .swf with mxmlc, are the mxmlc 
service definitions used for everything? Is it some weird combination? I know I 
can probably poke at this through experimentation, but the docs explicitly 
*don't* list service-config as an option that does not apply to compc, so I was 
curious.

-Maciek



[flexcoders] Re: Invoking Flex fuction from Javascript for close.window

2008-12-09 Thread Anthony DeBonis
With ExternalInterface.call you can inject JavaScript into the wrapper 
document.

if ( ExternalInterface.available ) {
ExternalInterface.call('alert("TEST")'); 
}
A good example of what your talking about is here thanks to Greg Jessup

http://gregjessup.com/flex-3-catch-browser-exit-or-close-event-using-
javascript-and-externalinterface/




RE: [flexcoders] Re: Deployment of Flex Application in IIS

2008-12-09 Thread Tracy Spratt
Yes, this symptom usually means a security a security problem.

 

Put a crossdomain.xml file in ..\inetpub\wwwroot.

 

This example below is wide open and you might want to tighten it down
once you get things working.

Tracy

 


http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd";>

  



  




From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nathanpdaniel
Sent: Tuesday, December 09, 2008 9:42 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Deployment of Flex Application in IIS

 

That issue has more to do with how you load data than the fact that 
you're using IIS. You should look into the security issues involved 
with loading external data to start with.

--- In flexcoders@yahoogroups.com 
, "srik_kanth_g" <[EMAIL PROTECTED]> 
wrote:
>
> Hi, 
> 
> I am trying to deploy a small Flex application in IIS, but I could 
not 
> succed. 
> 
> I have installed Flex Bulider 3 in Server and deployed code into 
> WWWRoot under InetPub folder. when I tried to browse the .html 
page,it 
> did not fetch any data from the database, just displayed empty 
charts.
> 
> Actually, I am new to flex so I am not able to fix this issues. 
> 
> could anyone please let me know how to deploy the flex application?
> 
> Thank you
> 
> Srikanth
>

 



Re: [flexcoders] How to wite a javascript that calls to ActionScript

2008-12-09 Thread wkolcz
Sorry about that. Its not really my fault. Its the flexcoder list system.
Actually I emailed one at 5pm yesterdays, waited for it to show up but it 
didnt. 
So I sent another one about 8:30 pm, it didn't show up either. 
Then I sent one this morning and it didn't show up for an hour (when all 3 
showed up).


From: "Fidel Viegas" <[EMAIL PROTECTED]>
Sent: Tuesday, December 09, 2008 8:35 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] How to wite a javascript that calls to ActionScript 

On Tue, Dec 9, 2008 at 2:07 PM, wkolcz <[EMAIL PROTECTED]> wrote:

> Can someone show me how to write a javascript function that calls to a

> Flex/AS function before a browser window closes?

>

> In my AS contructor I have:

> if (ExternalInterface.available)

> ExternalInterface.addCallback("tagWithClosed",windowClosed);

>

> I tried something like this, but I don't know how to actually invoke the

> correct function name. The swf is FXVideo.swf, the swf id is FXVideo and the

> .as file is FXVideo.as:

> 

> window.onbeforeunload = closingWindow;

> function closingWindow()

> {

>FXVideo.tagWithClosed();

> }

> 

>

> I would greatly appreciate it if someone could help me write this. Project

> due tomorrow.

Hi wkolcz,

try not to post the same message more than once. If people don't take

the time to answer it is because the information is easily available

on the net. What you are asking is easily found on google. Here is

what I found doing a search on flex + javascript:

http://blog.paranoidferret.com/?p=25

Good luck, and try to search on google before posting your question.

It is faster than waiting for someone to reply.

All the best,

Fidel.




RE: [flexcoders] Error while accessing LCDS fill method

2008-12-09 Thread Seth Hodgson
If this hasn't been resolved, a snippet of your server log file with Message.* 
and Debug.* debug logging enabled, leading up to and through this error would 
be useful to see, as well as knowing what version of the LCDS you're running.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
shruti.sheety
Sent: Tuesday, December 02, 2008 10:22 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Error while accessing LCDS fill method

Hi,

I have recently upgraded from Flex2 (FDS) to Flex3(LCDS and have my
application which runs on Flex sdk3.2 -LCDS with carringom MVC.
The problem i am having is when i refresh the page it is saying

AbstractAssembler.fill: Cannot find service class...
DataService.onFault: event=[FaultEvent fault=[RPC Fault
faultString="The fill method with parameters '[a,b,c]] (class:
java.util.Arrays$ArrayList)' and destination 'cp_ds' returned null."
faultCode="Server.Processing" faultDetail="null"]
messageId="32B99043-830F-956D-4897-38293069CDA1" type="fault"
bubbles=false cancelable=true eventPhase=2]

It is only when i refresh the page i have this error. When i access
the page the first time its fine.Also i have made sure that the
service class is in place.
Please suggest.

Thanks,
Shruti


[flexcoders] Re: Item Renderer focus on subcomponent in List

2008-12-09 Thread boilerman1984
I took your example with the DataGrid and slightly modified it to
extend a List.  The example correctly shows a list and correctly tabs
into the first itemRenderer ( rendererIsEditor="true" and the
MultiField editor is the Renderer).  The shift works to tab back out
of the first item as well.  The error comes when i reach the lastname
text box on the first editor and want to go to the second one.  It
throws a runtime error below.

---
 ReferenceError: Error #1069: Property text not found on
DataGridMultiFieldEditor and there is no default value.
at
mx.controls::List/itemEditorItemEditEndHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:2609]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156]
at
mx.controls::List/endEdit()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:2181]
at
mx.controls::List/deactivateHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:2397]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156]
at
mx.controls::List/endEdit()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:2181]
at
mx.controls::List/commitEditedItemPosition()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:1893]
at
mx.controls::List/updateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\List.as:1013]
at
mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3279]
at
mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:605]
at
mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:678]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at
mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8565]
at
mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8508]




[flexcoders] Listening for both Mouse Down and Double Click events.

2008-12-09 Thread flexaustin
Is it possible to listen for both a mouse down and doubleclick events
without using some sort of timer?  On mouse down start timer to listen
for a another mouse down?

If you listen for a mouse down and in the mouse down handler add
another listener to listen for some other action is a possibility I
guess, but would it add the listener in time?

TIA



Re: [flexcoders] speed of the "for each" looping

2008-12-09 Thread Maciek Sakrejda
If you're trying to speed up your application, you should use the
profiler. Something like the difference between a "manually" indexed for
loop and a for-each loop is almost certain to be trivial.

If you don't have the profiler, run an ad-hoc perf test by doing
something like

// we need to construct something to iterate over:
var iterations:int = 100;
var arr:Array = [];
for (var i:int = 0; i < iterations; i++) arr.push(i);
var dummy:int = 0;

var forBeginning:Number = new Date().getTime();
for (var j:int = 0; j < iterations; j++)
{
// we need to do something in the loop so the whole thing
// is not just optimized out (not sure if FP does this, but
// it can), but we don't want to use trace() since I/O is
// relatively expensive compared to the cost of the loop itself
dummy = arr[j];
} 
trace("for loop took " + (new Date().getTime() - forBeginning) + "
milliseconds");

var forEachBeginning:Number = new Date().getTime();
for each (var k:int in arr)
{
dummy = k;
}
trace("for-each loop took " + (new Date().getTime() - forEachBeginning)
+ " milliseconds");

That should give you an idea of the difference (but run this many times
and average it, and vary the order of the loops). Also, keep in mind
that most of the time, you won't be iterating over a million items.
Bottlenecks can occur in surprising places (though they're often found
in common places too, like Container layout code). Don't try to optimize
things that *seem like* they would be slow without actually confirming
not only that they *are* slow, but that they are affecting the overall
speed or responsiveness of your application. It makes no sense to make a
10x performance improvement in one part of your code that accounts
for .01% of your application's CPU usage.

-- 
Maciek Sakrejda
Truviso, Inc.
http://www.truviso.com

-Original Message-
From: Cato Paus <[EMAIL PROTECTED]>
Reply-To: flexcoders@yahoogroups.com
To: flexcoders@yahoogroups.com
Subject: [flexcoders] speed of the "for each" looping
Date: Tue, 09 Dec 2008 13:28:23 -

Hi, all you experts :)

I'm tying to speed up my application and I use a lot of

exsample
for (var i:int = 0; i < 5; i++)
{
trace(i);
} 

so is the "for each" looping faster ?




 




[flexcoders] Re: Bug: flash.display.Graphics being removed.

2008-12-09 Thread flexaustin
In Flex 3.1 framework import flash.display.Graphics isn't showing in
code hinting.



--- In flexcoders@yahoogroups.com, "sunild99" <[EMAIL PROTECTED]> wrote:
>
> Usually, when code completion stops working in Flex Builder, it's
because the I'm editing 
> has an error/omission in it...
> 
> Sunil
> 
> 
> --- In flexcoders@yahoogroups.com, li wenzhi  wrote:
> >
> > in my flex project using flexsdk3.1, while coding in flexbuilder,
the uicomponent 
> cannot auto hint the graphics attribute after "."
> > graphics missing in flexsdk3.1?
> > 
> >  --
> > lwz7512
> > Ultrapower Flex Team Leader
> > OpenRIA -- A Window You Exploring RIA World
> > http://www.rimeeting.cn
> > 
> > 
> > 
> > 
> > 
> > From: flexaustin 
> > To: flexcoders@yahoogroups.com
> > Sent: Saturday, December 6, 2008 5:56:11 AM
> > Subject: [flexcoders] Bug: flash.display.Graphics being removed.
> > 
> > 
> > Has anyone had this issue?  I do the following (using Flex Builder 3
> > w/ sdk 3.1 and Flash Player 10).
> > 
> > // BEGIN CODE  - - - - --
> > import flash.display. Graphics;
> > 
> > public function get drawGraphics( ):Graphics {
> > if(_drawing) {
> > return _drawing.graphics;
> > } else {
> > return null;
> > }
> > }
> > // END CODE  - - - - 
> > 
> > Every 3rd or 4th time I save my file, Flex Builder removes my import
> > statement then I get t"1046 Type not found..."
> >
>




[flexcoders] Problems with locale different to en_US when building an swf file using Ant

2008-12-09 Thread taze170171
Hello!

We have a problem when building the swf file with a locale different 
to en_US. We use the following ant code for building:

additional.compiler.arguments=-services ".../services-config.xml" -
locale=de_AT -source-path=./locale/{locale}


 





  







 

When using the locale en_US everything works fine. If we change the 
locale within the additional.compiler.arguments to de_AT no swf is 
created. But there is also no error message!

We are using SDK 3.2.0. Locale de_AT has been created by calling:
copylocale en_US de_AT

Within Flex Builder the build works with the de_AT locale!

Can anybody help?

Thanks in advance,
Taze



Re: [flexcoders] How to wite a javascript that calls to ActionScript

2008-12-09 Thread Fidel Viegas
On Tue, Dec 9, 2008 at 2:07 PM, wkolcz <[EMAIL PROTECTED]> wrote:
> Can someone show me how to write a javascript function that calls to a
> Flex/AS function before a browser window closes?
>
> In my AS contructor I have:
> if (ExternalInterface.available)
> ExternalInterface.addCallback("tagWithClosed",windowClosed);
>
> I tried something like this, but I don't know how to actually invoke the
> correct function name. The swf is FXVideo.swf, the swf id is FXVideo and the
> .as file is FXVideo.as:
> 
> window.onbeforeunload = closingWindow;
> function closingWindow()
> {
>FXVideo.tagWithClosed();
> }
> 
>
> I would greatly appreciate it if someone could help me write this. Project
> due tomorrow.

Hi wkolcz,

try not to post the same message more than once. If people don't take
the time to answer it is because the information is easily available
on the net. What you are asking is easily found on google. Here is
what I found doing a search on flex + javascript:

http://blog.paranoidferret.com/?p=25

Good luck, and try to search on google before posting your question.
It is faster than waiting for someone to reply.

All the best,

Fidel.


[flexcoders] Re: errorTip fontSize break the tooltip? Possible bug?

2008-12-09 Thread valdhor
How about a work around:

 private function init():void
 {
 var toolTipString:String = "You need to save your
changes!";
 saveTip =
ToolTipManager.createToolTip(toolTipString,50,50) as ToolTip;
 saveTip.setStyle("styleName", "errorTipGreen");
 var TLM:TextLineMetrics =
saveTip.measureText(saveTip.text);
 var paddingLeftPx:int = saveTip.getStyle("paddingLeft")
as int;
 var paddingRightPx:int =
saveTip.getStyle("paddingRight") as int;
 saveTip.width = TLM.width + 2 * paddingLeftPx + 2 *
paddingRightPx;
 }

HTH


Steve

--- In flexcoders@yahoogroups.com, "Fotis Chatzinikos"
<[EMAIL PROTECTED]> wrote:
>
> Here you are: (And a screenshot - via mail - have not tried before so
do not
> know if attachment work here...)
>
> 
> http://www.adobe.com/2006/mxml";
layout="absolute"
> creationComplete="init()">
> 
> 
> 
> 
> .errorTipGreen
> {
> color: #FF;
> fontSize: 11;
> fontWeight: "bold";
> shadowColor: #00;
> borderColor: #00FF00;
> borderStyle: "errorTipAbove";
> paddingBottom: 4;
> paddingLeft: 4;
> paddingRight: 4;
> paddingTop: 4;
> }
>
> 
> 
>
>
> On Mon, Dec 8, 2008 at 8:25 PM, Alex Harui [EMAIL PROTECTED] wrote:
>
> >Can you post an entire test case that is as small as possible?
> >
> >
> >
> > *From:* flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] *On
> > Behalf Of *Fotis Chatzinikos
> > *Sent:* Monday, December 08, 2008 9:44 AM
> > *To:* flexcoders@yahoogroups.com
> > *Subject:* Re: [flexcoders] errorTip fontSize break the tooltip?
Possible
> > bug?
> >
> >
> >
> > bump :-)
> >
> > Sorry did not get a reply on this... Could somebody test? Alex?
> >
> > On Thu, Dec 4, 2008 at 1:01 PM, fotis.chatzinikos <
> > [EMAIL PROTECTED] wrote:
> >
> > Hi, the following works:
> >
> > .errorTip
> > {
> > color: #FF;
> > /*fontSize: 11;*/
> > fontWeight: "bold";
> > shadowColor: #00;
> > borderColor: #FF;
> > borderStyle: "errorTipAbove";
> > paddingBottom: 4;
> > paddingLeft: 4;
> > paddingRight: 4;
> > paddingTop: 4;
> > }
> >
> > If I un-comment fontSize, the font gets bigger but the tooltip text
> > gets outside of the tooltips 'area'. Ie text length is 200 pixels
and
> > tooltips area 150 pixels... Is the tooltip's area calculations
> > hardcoded to font size 9?
> >
> > Fotis
> >
> >
> >
> >
> > --
> > Fotis Chatzinikos, Ph.D.
> > Founder,
> > Phinnovation
> > [EMAIL PROTECTED],
> >
> >
> >
>
>
>
> --
> Fotis Chatzinikos, Ph.D.
> Founder,
> Phinnovation
> [EMAIL PROTECTED],
>



[flexcoders] Re: How to make Flex exchange data with Flash SWF file?

2008-12-09 Thread aut0poietic
--- In flexcoders@yahoogroups.com, "markflex2007" <[EMAIL PROTECTED]>
wrote:
>
> Please give me a general idea or some urls.
> 
> Thanks a lot
> 
> Mark
>

Doing this now: If you're using a Flash 9/10 file in Flex 3 and in the
same domain, you can load the SWF into a SWFLoader control, and once
loaded, the SWF is in the ".content" property of the SWFLoader. 

So say you wanted to call the "setMyText(text)" method of your swf,
once the swf is loaded, you can simply call
MovieClip(swfLoaderInstance.content).setMyText("hello from Flex") ;

Google livedocs for SWFLoader for more information. 





[flexcoders] Cannot Tab to MovieClips from Flash SWF Loaded with SWFLoader

2008-12-09 Thread aut0poietic
Title pretty much says it all:

I have a Flex 3 application which can basically be summed up as a SWF
player which loads SWF's created in Flash CS3. 

When the SWF's are loaded, I can interact with them using the mouse
(click/mouseover, etc). However, these items cannot be tabbed to. 

I've been hacking around on this all morning, without much luck. I've
ensured that every item in the application either has a tabIndex and
is .tabEnabled or has tabEnabled=false and tabChildren=true. 

I've even resorted to enumerating over the child MovieClips in the swf
(using swfLoaderInstance.content.getChildAt()) and setting tabEnabled
and focusRect are both true, and confirming that the tabIndex on these
mc's was preserved. 

I'm at a serious loss as to what to do next -- I can't have
controls/interactions that the user can't tab to. Am I missing
something simple? A setting on the SWFLoader? The Application?

Hope someone's had to deal with this before and knows a solution.

Jer



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

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

Related to this, can anyone share:

  - samples 
  - pointers to samples 
  - open source widgets 

Most Grateful,

Christopher 



[flexcoders] Digest Authentification in Flex

2008-12-09 Thread Christoph Pingel

Hello,

I'm trying to wrap my head around digest authentification in Flex.

The point is, using a proxy is not an option. Using the HTTPService  
object, Base authentification is straightforward,

I just add the required headers.

Now, in the case of Digest auth, the problem is that the Server first  
sends an 401 unauthorized message, together with some initial values  
(nonce, qop) that have to be used later on in negotiating.


The big question: how do I access these values? There are Flash/Flex  
classes that support digest authentification (although via proxy), so  
that shouldn't be a fundamental problem. However, I don't know how,  
and some posts on the web seem to imply that the Flash player *can't*  
access HTTP headers - but I can't believe this, since digest auth (by  
any flash or mx class) simply requires access to the nonce and qop  
values in the HTTP headers.


May someone please shed some light on this issue.

TIA,
best regards,
Christoph




[flexcoders] How to make Flex exchange data with Flash SWF file?

2008-12-09 Thread markflex2007
Please give me a general idea or some urls.

Thanks a lot

Mark 



Re: [flexcoders] Re: Parsley MVC :: some thoughts

2008-12-09 Thread Ralf Bokelberg
Hi Amy

Afaik this is not possible in Flashplayer. A block of code is always
running through without any interuption. Colin Moock has a good
chapter of how all this works in his nice AS3 book.

Cheers
Ralf.



On Tue, Dec 9, 2008 at 3:44 PM, Amy <[EMAIL PROTECTED]> wrote:

> I actually had this very thing happen in my code a couple of weeks
> ago. I normally expect that the code in a function will all run as a
> block unless, of course, I'm calling out to another function. But in
> one case, one of the statements I was using (addEventListener, I
> think), opened up enough of a timing "hole" in my code that some
> other code (not the function that was being added in the event
> listener, which might have been partially understandable) ran
> unexpectedly at that point. The only solution I found was to make
> sure I put all of the other code that _had_ to run in that block
> before anything else happened above the addEventListener code.
>
> -Amy


Re: [flexcoders] vertical scrollbar problems...Please help i am freaking out :-)

2008-12-09 Thread Fotis Chatzinikos
Oups, isn't it funny when you mail the list after hours of head banging (on
a wall not just rocking :-) and then solve it in the next half an hour...?

I had everything wrapped in a 'parent' viewstack which i forgot to enable
its resizeToContent flag...

Works now...


On Tue, Dec 9, 2008 at 3:56 PM, Fotis Chatzinikos <
[EMAIL PROTECTED]> wrote:

> Does anyone know if there is a way to tell the viewstack to recalculate its
> height? (Should not it do that automatically?)
>
>
> On Tue, Dec 9, 2008 at 3:31 PM, Luciano Manerich Junior <
> [EMAIL PROTECTED]> wrote:
>
>>   Got that same issue few days ago..
>>
>> Ive just swap the Panels, putting the higher first... Not that good
>> solution, but, it has no problems for me.
>>
>> What you could try is, add canvas as child of the viewStack and panels as
>> child of the canvas, resulting in a vertical scroll inside the canvas, not
>> on the view stack.
>>
>> Set canvas to use full width and height...
>>
>> Not a solution, just a work around.
>>
>> -Mensagem original-
>> De: flexcoders@yahoogroups.com  [mailto:
>> flexcoders@yahoogroups.com ] Em nome de
>> fotis.chatzinikos
>> Enviada em: terça-feira, 9 de dezembro de 2008 11:10
>> Para: flexcoders@yahoogroups.com 
>> Assunto: [flexcoders] vertical scrollbar problems...Please help i am
>> freaking out :-)
>>
>>
>> Hello all, I do not know how many hours i have spend playing around with
>> scroll policies, heights, tops and bottoms...but still no solution.
>>
>> The application layout is the following:
>>
>> HBOX
>> LEFT VBOX
>> RIGHT VBOX
>> --PANEL
>> --VIEW STACK
>> PANEL 1 (lets say 200 pixels height) PANEL 2 (lets say 500
>> pixels height)
>>
>> Initialy, The viewstack show Panel 1, and when i play with smaller screen
>> sizes, ie make firefox smaller than my monitor's full height a vertical
>> scroll bar appears correctly (when panel 1 bottom reaches the bottom of the
>> browser window)...
>>
>> The problem appears when i switch to the second panel in the viewstack
>> (selectedIndex==1). The scrollbar appears and disappears, but it seems that
>> the measuredHeight is wrong! The scrollbar only appears when the screen
>> becomes less than the height of the first panel which is 300 pixels less
>> height than the second panel making the application not usable as 300 pixels
>> of panel 2 are hidden...
>>
>> Does it pop any ideas? The viewstack's resizeToContent is true...
>>
>> Thanks,
>> Fotis
>>
>> 
>>
>> --
>> Flexcoders Mailing List
>> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>> Alternative FAQ location:
>> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
>>  Search Archives:
>> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
>> Links
>>
>>  
>>
>
>
>
> --
> Fotis Chatzinikos, Ph.D.
> Founder,
> Phinnovation
> [EMAIL PROTECTED],
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],


[flexcoders] Re: Does anyone know ANYTHING about AS Webservices?

2008-12-09 Thread valdhor
The following works for me:


http://www.adobe.com/2006/mxml";
creationComplete="onCreationComplete()">
 
 
 
 


Now, I did have to update my crossdomain.xml file to:


http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd";>

   
 
 
 
   


Also, I had to add my bin-debug folder to the list in the Global
Security Settings Panel at:
http://www.macromedia.com/support/documentation/en/flashplayer/help/sett\
ings_manager04.html.

Perhaps you could post the WSDL and I can give it a try here.


HTH



Steve


--- In flexcoders@yahoogroups.com, "wkolcz" <[EMAIL PROTECTED]> wrote:
>
> I put the webservice so it creates a public instance ready for use.
>
> public var webService:WebService = new WebService();
> public var trackInfo:Object = new Object();
> public var myTimer:Timer = new Timer(0);
>
> I then change the code to:
>
> private function wsdlLoaded(event:LoadEvent):void {
> Alert.show("Web Service Loaded and Ready", "Service Status");
> webService.countIt(trackInfo);
> webService.addEventListener(FaultEvent.FAULT, alertFault);
>
> }
>
> private function stop_onClick(event:MouseEvent):void {
> myTimer.stop()
> trackInfo.addOne = 1 ;
> trackInfo.duration =  myTimer.currentCount;
> trackInfo.action = "Video Stopped";
> trackInfo.source = source;
> webService.wsdl =
"https://ummciisdevweb22.umich.edu/videotracking/trackerDAO.cfc?wsdl";;
> webService.loadWSDL();
> webService.addEventListener(LoadEvent.LOAD, wsdlLoaded);
> stop();
> playPressed = false;
> }
>
> It loads the WSDL and the Alert pops up, but still cant get it to the
database. Now I am getting:
>
> faultCode:DecodingError
> faultString:'SOAP Response cannot be decoded.
> Raw response: ' faultDetail:'null'
>
> 
> From: "Tracy Spratt" [EMAIL PROTECTED]
> Sent: Monday, December 08, 2008 10:08 AM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Does anyone know ANYTHING about AS
Webservices?
>
> First, loadWSDL() is asynchronous.  You
> need to wait for the LoadEvent.LOAD event before attempting to call an
> operation.   Also, declare and use a result Handler in
> addition to the fault handler.   Tracy
> 
>  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of wkolcz
> Sent: Monday, December 08, 2008
> 12:34 PM
> To:flexcoders@yahoogroups.com
> Subject: [flexcoders] Does anyone
> know ANYTHING about AS Webservices?
>
> I created
> a simple web service using ColdFusion CFC. It takes a struct and
inserts the
> info into the database. Works fine from a direct call using CF's
createObject("webservice")
> so I know it works...
>
> However in AS, I am getting this error:
>
> faultCode:DecodingError faultString:'SOAP Response cannot be decoded.
> Raw response: ' faultDetail:'null'
>
> Here is my Web Service Script:
>
> var ws:WebService = new WebService();
>
> ws.wsdl =
"https://ummciisdevweb22.umich.edu/videotracking/trackerDAO.cfc?wsdl";;
>
> ws.addEventListener(FaultEvent.FAULT, alertFault);
>
> ws.loadWSDL();
>
> ws.countIt({trackData:trackInfo});
>
> I have looked at 100 different examples and none of them work. Does
ANYONE know
> how I can get this to work? I have a Wednesday deadline to get this
thing to work.
>



[flexcoders] Re: Parsley MVC :: some thoughts

2008-12-09 Thread Amy
--- In flexcoders@yahoogroups.com, "Paul Andrews" <[EMAIL PROTECTED]> wrote:
>
> Jules, I confess I actually misread your original post - I had 
anticipated 
> that when an event is despatch it wouldn't be actioned until the 
current 
> code section had been completed then the player would act upon 
events 
> awaiting despatch.
> 
> On the face of it, if events are despatched and all handlers 
invoked 
> synchronously before the next statement runs then there's an 
opportunity for 
> an unexpected race condition if handlers are updating the same data 
> structures as the code that despatched the event. Like you I would 
be 
> surprised at this behaviour and I might try and check that out for 
myself 
> later today.
> 
> So you are right my comments don't match your findings. I don't 
have a 
> problem with the event despatcher invoking all handlers for an 
event in 
> sequence - event handling has a predefined order through the 
display list, 
> but there's no guarantee that multiple handlers at the same place 
in the 
> hierarchy will be invoked in a set sequence.
> 
> I'm somewhat surprised at your assertion that despatching an event 
will 
> invoke handlers for that event synchronously - it would be 
interesting to 
> get a better handle on this from someone who knows thelow-level 
mechanism 
> more intimately than I do. My event handling code doesn't 
anticipate that 
> despatched events are handled syncronously and as i've already 
said, there's 
> always a danger of an unexpected race condition if that were true.
> 
> In my previous life writing a lot of code running on multiprocessor 
systems 
> we took great care to control asynchronous behaviour and to protect 
data 
> structures from multiple updates using semaphores. In a faux system 
like the 
> flash player, there isn't true concurrency, but if what you say is 
true 
> there would be a real potential of getting an unwanted side-effect 
since 
> effectively shared data structures would be open to being updated 
> unexpectedly whenever an event is despatched.
> 
> So, I'm kinda with you.

I actually had this very thing happen in my code a couple of weeks 
ago.  I normally expect that the code in a function will all run as a 
block unless, of course, I'm calling out to another function.  But in 
one case, one of the statements I was using (addEventListener, I 
think), opened up enough of a timing "hole" in my code that some 
other code (not the function that was being added in the event 
listener, which might have been partially understandable) ran 
unexpectedly at that point.  The only solution I found was to make 
sure I put all of the other code that _had_ to run in that block 
before anything else happened above the addEventListener code.

-Amy



[flexcoders] Re: Deployment of Flex Application in IIS

2008-12-09 Thread nathanpdaniel
That issue has more to do with how you load data than the fact that 
you're using IIS.  You should look into the security issues involved 
with loading external data to start with.

--- In flexcoders@yahoogroups.com, "srik_kanth_g" <[EMAIL PROTECTED]> 
wrote:
>
> Hi, 
> 
> I am trying to deploy a small Flex application in IIS, but I could 
not 
> succed. 
> 
> I have installed Flex Bulider 3 in Server and deployed code into 
> WWWRoot under InetPub folder. when I tried to browse the .html 
page,it 
> did not fetch any data from the database, just displayed empty 
charts.
> 
> Actually, I am new to flex so I am not able to fix this issues. 
> 
> could anyone please let me know how to deploy the flex application?
> 
> Thank you
> 
> Srikanth
>




Re: [flexcoders] Parsley MVC :: some thoughts

2008-12-09 Thread Jules Suggate
Hi Ralf,

That's my understanding now too. What I'm slowly coming to terms with
are the facts you so lucidly summarise below :)

I (and I think Paul too) had always assumed that control returned from
the dispatchEvent function immediately. I'm still a little bit shocked
about it. In this light, dispatchEvent just routes function calls
through a common object.

It's too early to say whether it'll make much difference to how I code in Flex.

I hate stories that end with a deus ex machina :)

On Wed, Dec 10, 2008 at 02:47, Ralf Bokelberg <[EMAIL PROTECTED]> wrote:
> I'm confused. Let's clarify what we are talking about.
>
> The event dispatching is fully synchronous.
> If you call dispatchEvent, all event handlers are called, before the
> next statement is executed.
>
> Some processes (eg loading something from the backend or a timer)
> dispatch events in an asynchronous manner. So they call dispatchEvent
> at some unknown point in time
>
> I think, this is how it works.
>
> Cheers
> Ralf.
>
> On Tue, Dec 9, 2008 at 10:27 AM, Paul Andrews <[EMAIL PROTECTED]> wrote:
>> Jules, I confess I actually misread your original post - I had anticipated
>> that when an event is despatch it wouldn't be actioned until the current
>> code section had been completed then the player would act upon events
>> awaiting despatch.
>>
>> On the face of it, if events are despatched and all handlers invoked
>> synchronously before the next statement runs then there's an opportunity
>> for
>> an unexpected race condition if handlers are updating the same data
>> structures as the code that despatched the event. Like you I would be
>> surprised at this behaviour and I might try and check that out for myself
>> later today.
>>
>> So you are right my comments don't match your findings. I don't have a
>> problem with the event despatcher invoking all handlers for an event in
>> sequence - event handling has a predefined order through the display list,
>> but there's no guarantee that multiple handlers at the same place in the
>> hierarchy will be invoked in a set sequence.
>>
>> I'm somewhat surprised at your assertion that despatching an event will
>> invoke handlers for that event synchronously - it would be interesting to
>> get a better handle on this from someone who knows thelow-level mechanism
>> more intimately than I do. My event handling code doesn't anticipate that
>> despatched events are handled syncronously and as i've already said,
>> there's
>> always a danger of an unexpected race condition if that were true.
>>
>> In my previous life writing a lot of code running on multiprocessor
>> systems
>> we took great care to control asynchronous behaviour and to protect data
>> structures from multiple updates using semaphores. In a faux system like
>> the
>> flash player, there isn't true concurrency, but if what you say is true
>> there would be a real potential of getting an unwanted side-effect since
>> effectively shared data structures would be open to being updated
>> unexpectedly whenever an event is despatched.
>>
>> So, I'm kinda with you.
>>
>> Paul
>>
>> - Original Message -
>> From: "Jules Suggate" <[EMAIL PROTECTED]>
>> To: 
>> Sent: Tuesday, December 09, 2008 8:55 AM
>> Subject: Re: [flexcoders] Parsley MVC :: some thoughts
>>
>>> How can something be asynchronous but not concurrent? Asynchronous
>>> means that control returns from the function call immediately although
>>> the transaction triggered by the call may still be ongoing. To me,
>>> that absolutely *requires* concurrency, even if it's simulated through
>>> a timeslicing scheduler or some such.
>>>
>>> I'm pretty sure for something to be asynchronous there has to be some
>>> sort of interleaving.
>>>
>>> That's the whole point of what I just realised: there is no such
>>> interleaving within the Flex framework. Event dispatch in Flex/Flash
>>> is a *blocking* operation. There's no scheduler or anything within the
>>> event bus. Maybe your handlers will make calls to a truly asynchronous
>>> API like network calls or something, but until they make that call and
>>> return control to the code that dispatched the event, the next line of
>>> code in your event producer object will *not* execute.
>>>
>>> I'm just freaked out that I never realised this. How have my
>>> applications even been *usable* until now?!?!? Pure luck and good
>>> API design from Adobe/Macromedia.
>>>
>>> Cheers to the Player team!
>>>
>>> On Tue, Dec 9, 2008 at 03:02, Paul Andrews <[EMAIL PROTECTED]> wrote:
 They are asynchronous but they aren't concurrent.

 Paul

 - Original Message -
 From: "Jules Suggate" <[EMAIL PROTECTED]>
 To: 
 Sent: Monday, December 08, 2008 1:59 PM
 Subject: Re: [flexcoders] Parsley MVC :: some thoughts

>  head explodes heh!
>
> I have been happily thinking the whole time that events really *are*
> asynchronous, but that's obviously not true. Reality check...
>
> Thanks gu

Re: [flexcoders] Drag and Drop into a Popup Window

2008-12-09 Thread Reto M. Kiefer
Hello Alex,

thanks for your answer!

it was my fault. I didn't specified the proper event handlers in the
drop target. It's working quite fine now.

Sorry for the disturbance..

Cheers

Reto

2008/12/8 Alex Harui <[EMAIL PROTECTED]>:
> What didn't work?  Post a mini-example.
>
>
>
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Reto M. Kiefer
> Sent: Monday, December 08, 2008 1:25 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Drag and Drop into a Popup Window
>
>
>
> Dear all,
>
> I want to drag and drop data from the main application into field in a
> popup window.
>
> The usual handling of dragEnter and dragDrop doesn't work.
>
> Any hints / links on how to enable drag and drop into a popup window
> is highly appreciated.
>
> Thanks in advance
>
> Reto
>
> 


[flexcoders] Socket and Pop3

2008-12-09 Thread quantum_ohm
Hi All !

I'm building a POP3 mail client in AIR, and can't figure out how to
dispatch events (or where ) to send all the commands one after each
other in a unique same shot.

For now I have to send them individually like :
USER 
then when I have the response
PASS 
then
STAT
then
RETR and so on... As the server needs to send a response
before the AIR client can send another command.
I think this is a kind of Synchronous/Asynchronous issue
that I have some trouble to understand...

is there any way to do that ?

Thx for help :-)



  1   2   >