[flexcoders] Security Problem in cross-domain scripting

2007-12-28 Thread Muhammad Ahmed Ullah
Hello,

When loading a SWF file within a SWF through Loader's object, I'm
getting the following error message:

SecurityError: Error #2047: Security sandbox violation: parent:
http://192.168.0.20/wid/Widget1.swf cannot access
http://192.168.0.18:81/Any/container/ContainerSWF.swf.
 at flash.display::DisplayObject/get parent()
 at
mx.managers::SystemManager/executeCallbacks()[E:\dev\flex_3_beta3\sdk\fr\
ameworks\projects\framework\src\mx\managers\SystemManager.as:1518]
 at
mx.managers::SystemManager/docFrameHandler()[E:\dev\flex_3_beta3\sdk\fra\
meworks\projects\framework\src\mx\managers\SystemManager.as:2311]


Following facts may help:
1. On the server of the loaded-SWF file, crossdomain.xml exists with the
"*" permission.
2. In the initialize event handler of the loaded-SWF file,
Security.allowDomain("*") also exists.

If I write "Security.allowDomain("*")" in the loading SWF, then this
error is solved.

But my question is,  "Why is it necessary to use allowDomain() in the
loading-SWF, as I don't want to allow the loaded-SWF file to cross
script the loading-SWF file?" or "How can I solve this error without
using the allowDomain() in the loading-SWF?"


Thanks,
Ahmed


[flexcoders] Passing BitmapData through LocalConnection

2008-01-08 Thread Muhammad Ahmed Ullah
Hi,

When I try to pass BitmapData through the LocalConnection, I'm getting
the following error message:

"Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095:
flash.net.LocalConnection was unable to invoke callback setImgData.
error=TypeError: Error #1034: Type Coercion failed: cannot convert
[EMAIL PROTECTED] to flash.display.BitmapData."

Is there any restrictions on the data-types for passing the data
though LocalConnection.

Any ideas in this regard?

Thanks,
Ahmed



[flexcoders] Re: Passing BitmapData through LocalConnection

2008-01-08 Thread Muhammad Ahmed Ullah
Thanks Drew, But after registering the BitmapData class, now the error
is that AMF is requiring zeros argument constructor but the BitmapData
requires atleast two argument.

Now the following error occurs:

Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095:
flash.net.LocalConnection was unable to invoke callback setImgData.
error=ArgumentError: Error #1063: Argument count mismatch on
flash.display::BitmapData(). Expected 2, got 0.

-Ahmed


--- In flexcoders@yahoogroups.com, Drew Bourne <[EMAIL PROTECTED]> wrote:
>
> Hi Ahmed,
> 
> Try registering the flash.display.BitmapData class using the  
> flash.net.registerClassAlias function. If I remember rightly you need  
> to do this for any class besides Object that you want to pass through  
> LocalConnection before passing any objects over the connection.  
> You'll want to do it in both sides of the connection.
> 
> for example:
> 
> flash.net.registerClassAlias('BitmapDataAlias', BitmapData);
> 
> cheers,
> Drew
> 
> 
> On 08/01/2008, at 10:57 PM, Muhammad Ahmed Ullah wrote:
> 
> > Hi,
> >
> > When I try to pass BitmapData through the LocalConnection, I'm getting
> > the following error message:
> >
> > "Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095:
> > flash.net.LocalConnection was unable to invoke callback setImgData.
> > error=TypeError: Error #1034: Type Coercion failed: cannot convert
> > [EMAIL PROTECTED] to flash.display.BitmapData."
> >
> > Is there any restrictions on the data-types for passing the data
> > though LocalConnection.
> >
> > Any ideas in this regard?
> >
> > Thanks,
> > Ahmed
> >
> >
> >
>




[flexcoders] Security issue in crossscripting

2008-01-09 Thread Muhammad Ahmed Ullah
Hello,

When loading a SWF file (inner.swf) within a SWF file (outer.swf)
through Loader's object, I'm getting the following error message:

SecurityError: Error #2047: Security sandbox violation: parent:
http://192.168.0.20/wid/inner.swf cannot access
http://192.168.0.18:81/Any/container/outer.swf.
at flash.display::DisplayObject/get parent()
at
mx.managers::SystemManager/executeCallbacks()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\SystemManager.as:1518]
at
mx.managers::SystemManager/docFrameHandler()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\SystemManager.as:2311]

Both files are placed on different domains.
On the server of inner.swf file, crossdomain.xml exists with the "*"
permission.
In the initialize event handler of inner.swf file,
Security.allowDomain("*") also exists.
 

If I write "Security.allowDomain("*")" in outer.swf file, before
loading the inner.swf, then this error gets solved.

But my question is, "Why is it necessary to use allowDomain() in the
outer.swf file, as I don't want to allow inner.swf file to access
outer.swf file?" or "How can I solve this error without using the
allowDomain() in outer.swf file?"


Thanks,
Ahmed 



[flexcoders] Dragged rectangle offset

2008-01-09 Thread Muhammad Ahmed Ullah
Hi,

Does flex framework provides a way to know the offset of the dragged
rectangle from the mouse cursor, in the event handler of DRAG_DROP event.

Regards,
Ahmed



[flexcoders] Re: Security issue in crossscripting

2008-01-10 Thread Muhammad Ahmed Ullah
Thanks Alex for the info. Can we expect this support will come with
flash-10 or when?


--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Flex does not currently support cross-domain sub-apps
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Muhammad Ahmed Ullah
> Sent: Wednesday, January 09, 2008 3:46 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Security issue in crossscripting
> 
>  
> 
> Hello,
> 
> When loading a SWF file (inner.swf) within a SWF file (outer.swf)
> through Loader's object, I'm getting the following error message:
> 
> SecurityError: Error #2047: Security sandbox violation: parent:
> http://192.168.0.20/wid/inner.swf <http://192.168.0.20/wid/inner.swf>
> cannot access
> http://192.168.0.18:81/Any/container/outer.swf.
> <http://192.168.0.18:81/Any/container/outer.swf.> 
> at flash.display::DisplayObject/get parent()
> at
> mx.managers::SystemManager/executeCallbacks()[E:\dev\flex_3_beta3\sdk\fr
> ameworks\projects\framework\src\mx\managers\SystemManager.as:1518]
> at
> mx.managers::SystemManager/docFrameHandler()[E:\dev\flex_3_beta3\sdk\fra
> meworks\projects\framework\src\mx\managers\SystemManager.as:2311]
> 
> Both files are placed on different domains.
> On the server of inner.swf file, crossdomain.xml exists with the "*"
> permission.
> In the initialize event handler of inner.swf file,
> Security.allowDomain("*") also exists.
> 
> 
> If I write "Security.allowDomain("*")" in outer.swf file, before
> loading the inner.swf, then this error gets solved.
> 
> But my question is, "Why is it necessary to use allowDomain() in the
> outer.swf file, as I don't want to allow inner.swf file to access
> outer.swf file?" or "How can I solve this error without using the
> allowDomain() in outer.swf file?"
> 
> Thanks,
> Ahmed
>




[flexcoders] Re: Security issue in crossscripting

2008-01-11 Thread Muhammad Ahmed Ullah
Thanks again Alex.

-Ahmed

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> It isn't a FlashPlayer issue as much as a Flex Framework issue.  It is
> not in 3.0, but may show up in 3.x or 4.0, but no guarantees
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Muhammad Ahmed Ullah
> Sent: Thursday, January 10, 2008 3:42 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Security issue in crossscripting
> 
>  
> 
> Thanks Alex for the info. Can we expect this support will come with
> flash-10 or when?
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui"  wrote:
> >
> > Flex does not currently support cross-domain sub-apps
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of Muhammad Ahmed Ullah
> > Sent: Wednesday, January 09, 2008 3:46 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Security issue in crossscripting
> > 
> > 
> > 
> > Hello,
> > 
> > When loading a SWF file (inner.swf) within a SWF file (outer.swf)
> > through Loader's object, I'm getting the following error message:
> > 
> > SecurityError: Error #2047: Security sandbox violation: parent:
> > http://192.168.0.20/wid/inner.swf <http://192.168.0.20/wid/inner.swf>
> <http://192.168.0.20/wid/inner.swf <http://192.168.0.20/wid/inner.swf> >
> > cannot access
> > http://192.168.0.18:81/Any/container/outer.swf.
> <http://192.168.0.18:81/Any/container/outer.swf.> 
> > <http://192.168.0.18:81/Any/container/outer.swf.
> <http://192.168.0.18:81/Any/container/outer.swf.> > 
> > at flash.display::DisplayObject/get parent()
> > at
> >
> mx.managers::SystemManager/executeCallbacks()[E:\dev\flex_3_beta3\sdk\fr
> > ameworks\projects\framework\src\mx\managers\SystemManager.as:1518]
> > at
> >
> mx.managers::SystemManager/docFrameHandler()[E:\dev\flex_3_beta3\sdk\fra
> > meworks\projects\framework\src\mx\managers\SystemManager.as:2311]
> > 
> > Both files are placed on different domains.
> > On the server of inner.swf file, crossdomain.xml exists with the "*"
> > permission.
> > In the initialize event handler of inner.swf file,
> > Security.allowDomain("*") also exists.
> > 
> > 
> > If I write "Security.allowDomain("*")" in outer.swf file, before
> > loading the inner.swf, then this error gets solved.
> > 
> > But my question is, "Why is it necessary to use allowDomain() in the
> > outer.swf file, as I don't want to allow inner.swf file to access
> > outer.swf file?" or "How can I solve this error without using the
> > allowDomain() in outer.swf file?"
> > 
> > Thanks,
> > Ahmed
> >
>




[flexcoders] Re: Error #2044: Unhandled SecurityErrorEvent:. text=Error #2047: Security sandb

2008-01-17 Thread Muhammad Ahmed Ullah
--- In flexcoders@yahoogroups.com, "shemeshkale" <[EMAIL PROTECTED]> wrote:
>
> i get this error, but only on IE. on FF it doesn't show:
> 
> Error #2044: Unhandled SecurityErrorEvent:. text=Error #2047: Security
> sandbox violation: LocalConnection.send: mymachinename cannot access
> http://mymachinename:8087/app/app.swf.
> 
> what does it mean?
>

If you want to access a local-connection which is in different domain,
then receiving local-connection side, need to give the permission to
your domain. For this use the allowDomain method of the LocalConnection.

Regards,
Ahmed




[flexcoders] Text shift during printing

2008-01-22 Thread Muhammad Ahmed Ullah
Hi,

On a canvas derived class, I have few controls.
Before taking this canvas object's print, If move the scrollbars of
the browser window, then all the text, displayed over controls,
appears shifted in the print, but appears fine in the view. 

Any comments?

Regards,
Ahmed



[flexcoders] Re: Text shift during printing

2008-01-22 Thread Muhammad Ahmed Ullah
Thanks for the response, but I'm already using validateNow().
I think that in any case the browser windows scroll should not have
any impact on flex application.

Regards,
Ahmed

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> You might need to call validateNow() before adding the page
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Muhammad Ahmed Ullah
> Sent: Tuesday, January 22, 2008 6:11 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Text shift during printing
> 
>  
> 
> Hi,
> 
> On a canvas derived class, I have few controls.
> Before taking this canvas object's print, If move the scrollbars of
> the browser window, then all the text, displayed over controls,
> appears shifted in the print, but appears fine in the view. 
> 
> Any comments?
> 
> Regards,
> Ahmed
>




[flexcoders] Re: loaded external swf in perticilar place with AS3

2008-01-25 Thread Muhammad Ahmed Ullah
Hi,
you can use the local connection for communication between two SWFs.
Class named "LocalConnection" in flex is easy to use.
http://livedocs.adobe.com/flex/2/langref/flash/net/LocalConnection.html

Regards,
Ahmed

--- In flexcoders@yahoogroups.com, "Solanki Devang" <[EMAIL PROTECTED]>
wrote:
>
> Dear Friends
> 
> any one guide me how to call my external SWF file in my animation at my
> specify location
> 
> i have all ready developed 1.swf, i need to call 2.swf in my 1.swf,
> 
> for that i have to use flash player 9 and action script 3.0 due that
> 2.swf is developed in flex.
> 
> pl. guide me...
> 
> Regards
> Devang
>




[flexcoders] FYI: Re: Text shift during printing

2008-01-31 Thread Muhammad Ahmed Ullah
I think its a bug of flex that if the container's scrollbars are
shifted then there is a text shift in the print. 

In earlier messages I said that the scrollbars are of the browser
window, but that was wrong, infact the scrollbars are of flex
application object.

As a workaround of the problem, now when user presses print-button
then I shift the scrollbars to the zero position and then the text
shift problem gets solved in print.

Regards,
Ahmed

--- In flexcoders@yahoogroups.com, Frederico Garcia <[EMAIL PROTECTED]>
wrote:
>
> Muhammad Ahmed Ullah escreveu:
> > Thanks for the response, but I'm already using validateNow().
> > I think that in any case the browser windows scroll should not have
> > any impact on flex application.
> >
> > Regards,
> > Ahmed
> >
> > --- In flexcoders@yahoogroups.com, "Alex Harui"  wrote:
> >   
> >> You might need to call validateNow() before adding the page
> >>
> >>  
> >>
> >> ________
> >>
> >> From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> >> Behalf Of Muhammad Ahmed Ullah
> >> Sent: Tuesday, January 22, 2008 6:11 AM
> >> To: flexcoders@yahoogroups.com
> >> Subject: [flexcoders] Text shift during printing
> >>
> >>  
> >>
> >> Hi,
> >>
> >> On a canvas derived class, I have few controls.
> >> Before taking this canvas object's print, If move the scrollbars of
> >> the browser window, then all the text, displayed over controls,
> >> appears shifted in the print, but appears fine in the view. 
> >>
> >> Any comments?
> >>
> >> Regards,
> >> Ahmed
> >>
> >> 
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> > Yahoo! Groups Links
> >
> >
> >
> >
> > __ NOD32 2816 (20080123) Information __
> >
> > This message was checked by NOD32 antivirus system.
> > http://www.eset.com
> >
> >
> >
> >   
> It only happens when you move the scrollbars? Otherwise it could be 
> related to aliasing (with antialias what you see isn't what you print).
> 
> Regards,
> 
> Frederico Garcia
>




[flexcoders] TextSnapshot issue within AIR Window

2009-06-29 Thread Muhammad Ahmed Ullah
Hi,

In AIR, TextSnapshots are not properly working when used in mx.core.Window's 
subclass. Details of the scenario is as under:

Create and open object of custom subclass of Window in Adobe AIR. Within this 
subclass do the following:
Load the swf file:
var loader:Loader = new Loader();
loader.load(new URLRequest(urlOfSWF));
Get the TextSnapshot from the Loader's content:
var mc:MovieClip = loader.content as MovieClip;
var textsnap:TextSnapshot = mc.textSnapshot;
Now call:
var ret:String = textsnap.getText(10, 20);

The returned string is empty even the textsnap.charCount is larger. 
Similarly textsnap.hitTestTextNearPos always return -1.

But if the same process is done in the main AIR application instead of withing 
Window subclass, then all works as expected.

Does Textsnapshot work within "Window"? Is there any thing wrong being done in 
above steps?

Thanks,
Ahmed