Re: [flexcoders] Re: SecurityError

2008-12-13 Thread Rick Winscot
So back to the second question ­ your security? The kind of communication
you describe requires crossdomain permissions ­ is this in place?

http://www.adobe.com/products/flashplayer/security/

Rick Winscot


On 12/14/08 1:42 AM, "dialogtmp"  wrote:

>  
>  
> 
> 
> I tried to set allowscriptaccess=always,but it still occured  Error
> #2060.
> 
> I try to search some information, but I don't find the solution
> until now.
> 
> --- In flexcoders@yahoogroups.com  , Rick
> Winscot 
> wrote:
>> >
>> > Ok ?I think I get what you are doing... Which essentially amounts
> to
>> > cross-site scripting. Have you tried the allowscriptaccess
> parameter? What
>> > is your security configuration?
>> > 
>> > Rick Winscot
>> > 
>> > 
>> > On 12/13/08 10:20 PM, "dialogtmp"  wrote:
>> > 
>>> > >  
>>> > >  
>>> > > 
>>> > > 
>>> > > thaks Rick :)
>>> > > 
>>> > > About my flex page,at the first,it will wait another page
>>> > > development by javascript pass the parameter.
>>> > > 
>>> > > And then the flex page accroding to the parameter to parse html .
>>> > > 
>>> > > Finally, passing the result of html parsing back to the
> javascript
>>> > > page.
>>> > > 
>>> > > dialogtmp
>>> > > 
>>> > > --- In flexcoders@yahoogroups.com 
>>>  40yahoogroups.com> , Rick
>>> > > Winscot 
>>> > > wrote:
> > >> >
> > >> > There may be bad news on the horizon. There was a way to get
>>> > > around this a
> > >> > while ago by adjusting the Œallowscriptaccess?parameter in
> your
>>> > > html output
> > >> > to Œalways.?If you¹ve already tried this without success...
> then
>>> > > you are
> > >> > probably hitting crossdomain issues. Flash knows what Œpage?
> it is
>>> > > on and
> > >> > where it is being accessed from ?if what you are doing
> violates a
> > >> > crossdomain policy I can guarantee that any solution you find
> won
>>> > > ¹t work for
> > >> > everyone or for very long.
> > >> > 
> > >> > Can you post a little bit about what you are trying to do?
> There
>>> > > might be a
> > >> > more Œcreative?way to get around the error. What kinds of
> things
>>> > > have you
> > >> > already tried?
> > >> > 
> > >> > Rick Winscot
> > >> > 
> > >> > 
> > >> > On 12/11/08 11:09 PM, "dialogtmp"  wrote:
> > >> > 
>>> > >>> > >  
>>> > >>> > >  
>>> > >>> > > 
>>> > >>> > > hello all,
>>> > >>> > > 
>>> > >>> > > I meet a big trouble.
>>> > >>> > > 
>>> > >>> > > I use flex to development firefox addon.
>>> > >>> > > 
>>> > >>> > > It's ok when I run the html which compliled by flex.
>>> > >>> > > 
>>> > >>> > > But when I package it to a firefox addon, it occurs
>>> > > SecurityError:
>>> > >>> > > Error #2060.
>>> > >>> > > 
>>> > >>> > > Could you tell how to process this error?
>>> > >>> > > 
>>> > >>> > > I'm really nerver-racking
>>> > >>> > > 
>>> > >>> > > thanks,
>>> > >>> > > dialogtmp
>>> > >>> > > 
>>> > >>> > >  
>>> > >>> > >
> > >> >
>>> > > 
>>> > >  
>>> > >
>> >
> 
>  
> 



[flexcoders] Re: SecurityError

2008-12-13 Thread dialogtmp

I tried to set allowscriptaccess=always,but it still occured  Error 
#2060.

I try to search some information, but I don't find the solution 
until now.


--- In flexcoders@yahoogroups.com, Rick Winscot  
wrote:
>
> Ok ?I think I get what you are doing... Which essentially amounts 
to
> cross-site scripting. Have you tried the allowscriptaccess 
parameter? What
> is your security configuration?
> 
> Rick Winscot
> 
> 
> On 12/13/08 10:20 PM, "dialogtmp"  wrote:
> 
> >  
> >  
> > 
> > 
> > thaks Rick :)
> > 
> > About my flex page,at the first,it will wait another page
> > development by javascript pass the parameter.
> > 
> > And then the flex page accroding to the parameter to parse html .
> > 
> > Finally, passing the result of html parsing back to the 
javascript
> > page.
> > 
> > dialogtmp
> > 
> > --- In flexcoders@yahoogroups.com  , Rick
> > Winscot 
> > wrote:
> >> >
> >> > There may be bad news on the horizon. There was a way to get
> > around this a
> >> > while ago by adjusting the Œallowscriptaccess?parameter in 
your
> > html output
> >> > to Œalways.?If you¹ve already tried this without success... 
then
> > you are
> >> > probably hitting crossdomain issues. Flash knows what Œpage?
it is
> > on and
> >> > where it is being accessed from ?if what you are doing 
violates a
> >> > crossdomain policy I can guarantee that any solution you find 
won
> > ¹t work for
> >> > everyone or for very long.
> >> > 
> >> > Can you post a little bit about what you are trying to do? 
There
> > might be a
> >> > more Œcreative?way to get around the error. What kinds of 
things
> > have you
> >> > already tried?
> >> > 
> >> > Rick Winscot
> >> > 
> >> > 
> >> > On 12/11/08 11:09 PM, "dialogtmp"  wrote:
> >> > 
> >>> > >  
> >>> > >  
> >>> > > 
> >>> > > hello all,
> >>> > > 
> >>> > > I meet a big trouble.
> >>> > > 
> >>> > > I use flex to development firefox addon.
> >>> > > 
> >>> > > It's ok when I run the html which compliled by flex.
> >>> > > 
> >>> > > But when I package it to a firefox addon, it occurs
> > SecurityError:
> >>> > > Error #2060.
> >>> > > 
> >>> > > Could you tell how to process this error?
> >>> > > 
> >>> > > I'm really nerver-racking
> >>> > > 
> >>> > > thanks,
> >>> > > dialogtmp
> >>> > > 
> >>> > >  
> >>> > >
> >> >
> > 
> >  
> >
>




RE: [flexcoders] Best practice for calling asynchronous functions?

2008-12-13 Thread Alex Harui
Your code looks like this:

function save(xml:XML, successFunc:Function, failureFunc:Function):void {
var service:HTTPService = new HTTPService();
...
service.addEventListener(ResultEvent.RESULT, function(evt:ResultEvent):void 
{
trace("Successfully saved XML");
successFunc();
});
service.send(); // called after the event listeners have been added :)
}

That seems unsafe to me.  You are relying on the Player's network stack to keep 
the HTTPService and your result event handlers around.  I've seen other types 
of loads cause the loading class to GC before the result event gets handled.

I would add more code to keep a hard reference to the HTTPService that gets 
cleaned up by the event handlers, although I think there might be advantages to 
keeping a  single HTTPService for multiple requests to the same server, in case 
that's your setup.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Mark Carter
Sent: Friday, December 12, 2008 11:39 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Best practice for calling asynchronous functions?



Alex Harui wrote:
>
> Can you repost your example?
>

Its just the very few simple lines I posted a few posts ago in this topic.
Here is the link:

http://www.nabble.com/Re%3A-Best-practice-for-calling-asynchronous-functions--p20969533.html

Its not a full example, but it gives the idea...
--
View this message in context: 
http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20988099.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Re: SecurityError

2008-12-13 Thread Rick Winscot
Ok ­ I think I get what you are doing... Which essentially amounts to
cross-site scripting. Have you tried the allowscriptaccess parameter? What
is your security configuration?

Rick Winscot


On 12/13/08 10:20 PM, "dialogtmp"  wrote:

>  
>  
> 
> 
> thaks Rick :)
> 
> About my flex page,at the first,it will wait another page
> development by javascript pass the parameter.
> 
> And then the flex page accroding to the parameter to parse html .
> 
> Finally, passing the result of html parsing back to the javascript
> page.
> 
> dialogtmp
> 
> --- In flexcoders@yahoogroups.com  , Rick
> Winscot 
> wrote:
>> >
>> > There may be bad news on the horizon. There was a way to get
> around this a
>> > while ago by adjusting the Œallowscriptaccess?parameter in your
> html output
>> > to Œalways.?If you¹ve already tried this without success... then
> you are
>> > probably hitting crossdomain issues. Flash knows what Œpage?it is
> on and
>> > where it is being accessed from ?if what you are doing violates a
>> > crossdomain policy I can guarantee that any solution you find won
> ¹t work for
>> > everyone or for very long.
>> > 
>> > Can you post a little bit about what you are trying to do? There
> might be a
>> > more Œcreative?way to get around the error. What kinds of things
> have you
>> > already tried?
>> > 
>> > Rick Winscot
>> > 
>> > 
>> > On 12/11/08 11:09 PM, "dialogtmp"  wrote:
>> > 
>>> > >  
>>> > >  
>>> > > 
>>> > > hello all,
>>> > > 
>>> > > I meet a big trouble.
>>> > > 
>>> > > I use flex to development firefox addon.
>>> > > 
>>> > > It's ok when I run the html which compliled by flex.
>>> > > 
>>> > > But when I package it to a firefox addon, it occurs
> SecurityError:
>>> > > Error #2060.
>>> > > 
>>> > > Could you tell how to process this error?
>>> > > 
>>> > > I'm really nerver-racking
>>> > > 
>>> > > thanks,
>>> > > dialogtmp
>>> > > 
>>> > >  
>>> > >
>> >
> 
>  
> 



[flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-13 Thread Tracy Spratt
You are not following my advice.  
Good luck.
Tracy



--- In flexcoders@yahoogroups.com, "stinasius"  wrote:
>
> hi guys i think am making progress. this is what i have so far.
> 
> "login_example.mxml"
> 
> 
> http://www.adobe.com/2006/mxml";
> layout="absolute" xmlns:view="components.*">
>   
>   
>   
>   
>   
>   
>   
>   
>useHandCursor="true" mouseChildren="false" click="showLogin()"/>
>   
>   
>   
>
>   
> 
> 
> "login_form.mxml"
> 
> 
> http://www.adobe.com/2006/mxml";
> layout="absolute" title="Login Form"> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   
>   
>   
>   
>   
> 
> 
> now i would like to connect that to this coldfusion script to have 
the
> cfc match login details from flex and database
> 
> "memberservice.cfc"
> 
> 
> 
> 
> 
> 
>hint="Datasource name used to connect CF to the database" 
>   type="string">
>   
>   
>   
>   
>   
>   variables.dsn = 'usr_grp';
>   
>
>   
>returntype="MemberService" hint="Constructor for this CFC">
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>output="false" returntype="Member" 
>   hint="Tries to find a record with a matching 
username and password.
>  If only 1 record
>   is found creates a Member object 
using the record's column values.">
>   
>   
>   
>   
>   
>   
>   
>   
>  var aMember = createObject
("Component","Member").init();
>   
>   
>   
>   
>   
>   
>   
> 
>  
>
>   
>   
>   select memID, memUserName, 
memPassword, memFirstName, memLastName,
> memEmail
>   from member
>   where memUsername =  value="#arguments.aUserName#">
>   and memPassword =  value="#arguments.aPassword#">
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   
>   
>   
>   
>   
>   
>   
>   
>
>   
>   
>   
>   
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   aMember.setMemberID( getMember.memID);
>   aMember.setUsername( getMember.memUserName);
>   aMember.setPassword( getMember.memPassword);
>   aMember.setFirstName( getMember.memFirstName);
>   aMember.setLastName( getMember.memLastName);
>   aMember.setEmail( getMember.memEmail);
>   
>   
>   
>   
>   
>   
>   
>   
>   
>returntype="void" 
>   hint="Pass Member object onto MemderDAO 
create function">
>   
>   
>   
>   
>
>
>
>
>  aMemberDAO = createObject("component",
> "MemberDAO").init('fluid_login');
>  aMemberDAO.create(aMember);
>
>   
>   
>
>
>   
>
>
>
>
>   
>   
>   
>   
>   
> 
>




Re: [flexcoders] Restrictions on non-visual component placement

2008-12-13 Thread Rick Winscot
Tracy / Michael,

The parent/child relationship (post application root) in MXML is constrained
to DisplayObjectContainer and DisplayObject relationships... this rule does
not apply to components within an item renderer.

http://www.adobe.us/livedocs/flex/2/langref/mxml/component.html

So... The question really is ­ what is the inheritance of the DetailPopUp?
Does it trace back to UIComponent? If not... Then that is what is preventing
him from using the component in both contexts. The simple solution would be
to extend UIComponent, mark includeInLayout as false, and make sure his
scripts are all playing nice.

Rick Winscot


On 12/12/08 2:18 PM, "Tracy Spratt"  wrote:

>  
>  
> 
> It IS, or at least was, the case that non-visual components must be at the
> root mxml scope.  I will try to find it documented.
>  
> If the component is non-visual, then it does not matter, functionally
> speaking, where in the DOM it goes.
>  
> Tracy
>  
> 
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf
> Of Rick Winscot
> Sent: Friday, December 12, 2008 1:25 PM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Restrictions on non-visual component placement
>  
> 
> It¹s difficult to determine what your problem is without knowing a little more
> about what your DetailPopUp does/is. If you post some code it would be far
> easier to determine why one context works and another doesn¹t. Generally... I
> wouldn¹t recommend mingling non-visual and visual components in mxml.
> 
> Your error basically says that your non-visual component doesn¹t have an
> appropriate interface for the context you are placing it in. e.g. It should be
> a IUIComponent.
> 
> http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
> 
> Rick Winscot
> 
> 
> On 12/12/08 12:49 PM, "Michael Prescott"  wrote:
>> 
>> 
>>  
>> 
>> Short version:
>> 
>> I have a non-visual component that I'm trying to declare in a repeater, but
>> it seems that MXML doesn't allow this.  Is this true?  How do you get around
>> this, create a visual component to wrap the non-visual component?
>> 
>> Long version:
>> 
>> I have an ActionScript non-visual component whose declaration looks like
>> this:
>> 
>> public class DetailPopup extends EventDispatcher implements IMXMLObject
>> 
>> I've used this successfully inside an inline, MXML item renderer, like this:
>> 
>>  
>> 
>>   
>> 
>> 
>>   
>> 
>>   
>> 
>> 
>>   
>> 
>>   
>> 
>> 
>> Now that I'm switching from a DataGrid to a Grid, the code ought to look like
>> this:
>> 
>>  
>> 
>> 
>>   
>> 
>> (X)   
>> 
>> 
>>   
>> 
>> ..except that I'm getting an error, "Component declarations are not allowed
>> here. (Note: visual children must implement IUIComponent.)"
>> 
>> After trying out a bunch of scenarios, it looks like non-visual components
>> can only be declared in the outermost scope of a component or application.
>> Is this true?  This is rather awkward, as I need a DetailPopUp for each
>> griditem.
>> 
>> Any tips would be very helpful!
>> 
>> Michael
>>  
>> 
>  
> 



Re: [flexcoders] Re: Best Practices: ArrayCollection of custom objects?

2008-12-13 Thread Rick Winscot
Have you been reading the articles in the replies? Seriously, they contain
great bits of information that would guide you in the right direction.

Reduce, reuse, and recycle...
http://www.insideria.com/2008/03/flex-performance-memory-manage.html

Array vs. ArrayCollection ­ FIGHT!
http://ectropic.com/wordpress/?p=59

James Ward gets Drunk on ArrayCollections (a.k.a Performance Pitfalls of
Flex¹s ArrayCollection)
http://www.jamesward.com/blog/2008/11/21/drunk-on-software-episode-3-perform
ance-pitfalls-of-flex%E2%80%99s-arraycollection/

Obviously, one of the most difficult aspects of asking a question online is
­ transferring context to the problem. My first reaction to your post is...
Œwhy extend array collection?Œ Is it because you are trying have something
you can swap out (for performance/optimization?) without changing code? Are
you addicted to ŒaddItem¹ - if you are there are probably some good
counseling groups in your area and... doesn¹t the ArrayCollection already
allow one to collect custom objects?

All kidding aside ­ your question about what to do... read the ASDocs on the
Ilist interface and then prepare for the obvious response to your best
practice question: ³Best practices for collections (read: Array,
ArrayCollection, etc) is contextual.² That¹s right! There is no silver
bullet answer ­ best practices for your implementation will reveal itself
after you have properly considered the recordset size, network traffic, db
response times, interface response, encoding/decoding (if you are using
anything like JSON) times, and whatnot. If the Œdata¹ is small then I would
have to say that even asking the question about performance is a waste of
time... If you are talking about Œmegalithic-data¹ I would have to say that
your performance problem isprobably architectural. If your data is somewhere
in the middle ­ these guys have provided clear direction.

Rick Winscot


On 12/12/08 2:14 PM, "burttram"  wrote:

>  
>  
> 
> Is this such a trivial question that people are passing up replying
> in lieu of bringing light to my ignorance, or are there really no best
> practices to speak of here?
> 
> The only way I've found so far to do this is to deprecate the
> overridden method, but even then from time to time we'll get a strange
> error (this doesn't happen all of the time):
> 
> 1021: Duplicate function definition.
> 
> Seems pretty obvious what's causing it, but we have other classes that
> use this same syntax that aren't generating the error...
> 
> Is there any reason we shouldn't do this, or is there another, more
> acceptable way to accomplish what we're trying to do here?
> 
> public class DataTypes extends ArrayCollection
> {
> public function DataTypes(){
> }
> 
> [Deprecated]
> override public function addItem(item:Object):void{
> }
> 
> public function addItem(item:DataType):void{
> super.addItem(item);
> }
> }
> 
>  
> 



[flexcoders] Re: SecurityError

2008-12-13 Thread dialogtmp

thaks Rick :)

About my flex page,at the first,it will wait another page 
development by javascript pass the parameter.

And then the flex page accroding to the parameter to parse html .

Finally, passing the result of html parsing back to the javascript 
page.

dialogtmp

--- In flexcoders@yahoogroups.com, Rick Winscot  
wrote:
>
> There may be bad news on the horizon. There was a way to get 
around this a
> while ago by adjusting the Œallowscriptaccess?parameter in your 
html output
> to Œalways.?If you¹ve already tried this without success... then 
you are
> probably hitting crossdomain issues. Flash knows what Œpage?it is 
on and
> where it is being accessed from ?if what you are doing violates a
> crossdomain policy I can guarantee that any solution you find won
¹t work for
> everyone or for very long.
> 
> Can you post a little bit about what you are trying to do? There 
might be a
> more Œcreative?way to get around the error. What kinds of things 
have you
> already tried?
> 
> Rick Winscot
> 
> 
> On 12/11/08 11:09 PM, "dialogtmp"  wrote:
> 
> >  
> >  
> > 
> > hello all,
> > 
> > I meet a big trouble.
> > 
> > I use flex to development firefox addon.
> > 
> > It's ok when I run the html which compliled by flex.
> > 
> > But when I package it to a firefox addon, it occurs 
SecurityError:
> > Error #2060.
> > 
> > Could you tell how to process this error?
> > 
> > I'm really nerver-racking
> > 
> > thanks,
> > dialogtmp
> > 
> >  
> >
>




Re: [flexcoders] Creating strongly typed objects from HTTPService results

2008-12-13 Thread Brent Dearth
Cleaning out my list mail and came across this ... I have a sample of this,
I put together awhile back, if anyone's interested. It's a JSON
implementation, but it piggy-backs on all the same principles here.

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



On Thu, Dec 4, 2008 at 10:34 PM, bpjadam  wrote:

>
> So as a followup to my own thread, I've written a drop-in replacement for
> SimpleXMLDecoder / Encoder that I call TypedXMLDecoder/Encoder..
>
> Rather than turning an XML doc into a tree of plain-jane Object (or
> ObjectProxy) instances, it directly creates a graph of typed instances
> using
> a simple XML element -> AS type mapping table you provide. Thus, each chunk
> of XML is only examined once and unmarshalled directly into an AS3 typed
> instance object.
>
> It's also smart enough to use the reflective machinery in AS3
> (specifically,
> DescribeTypeCache and friends) to figure out what AS type you *really* want
> for nested objects based on their declared type in your AS class
> definitions, thereby saving you the trouble of putting all possible types
> into the mapping table. You only need to specify the possible "root"
> element
> to type mappings and you do *not* have to put helper methods in your AS
> classes to deal with the marshalling/unmarshalling.
>
> I've got it handling Array and ArrayCollection properly as well as
> respecting the [Transient] metadata tag when encoding as XML.
>
> XML attributes can either be handled as properties (the default) or can be
> handled specially as "meta" and stashed in a distinct attributes dict
> handing off the instances. This latter option allows for symmetry with
> encoding the objects back into XML.
>
> And finally, if no type map entry can be figured out, it falls back to
> creating regular Object (or ObjectProxy) instances.
>
> So far, it's working well in our project against a nice REST service
> interface we've built for our application. If there's enough interest out
> there and I can get clearance from my employer, I'll open source the thing.
> --
> View this message in context:
> http://www.nabble.com/Creating-strongly-typed-objects-from-HTTPService-results-tp16182400p20847252.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>
>  
>