Re: [flexcoders] Flex to HTML5 Conversion tool?

2011-12-02 Thread John Fletcher
There's another key issue - who wants to work with machine converted code?
Sounds like a nightmare.
John
2011/12/1 Doug McCune d...@dougmccune.com

 **


 Just to throw in my two cents... I would not hold out any hope for any
 solution that will magically convert your Flex app to a HTML/JS app. Not in
 6 months, not in 6 years. I don't want to be a downer, but I just don't see
 it happening. Sure, we may see some tech demos that work on super simple
 Flex apps, but I think that's about as far as you'll get. You also might
 get tools that let you write a new app in MXML/AS, specifically with
 targeting HTML/JS in mind, and that might work well. But I have almost no
 confidence that you will ever be able to take an existing, large Flex app
 and magically get it to run well as an HTML app. I'd of course love to be
 proven wrong.

 My advice is that if you really need to target HTML/JS is to build it new
 from scratch. It's a harsh reality, and you're going to hate a lot of the
 toolchain, language, and process, but if you really do have the requirement
 that you need to have an HTML/JS app, you might as well just rip off the
 band-aid in one go instead of holding out hope for a holy grail solution.

 On Thu, Dec 1, 2011 at 6:27 AM, Merrill, Jason 
 jason.merr...@bankofamerica.com wrote:

 **


 Check out another possibility - using haXe for converting an
 MXML/Actionscript project to HTML5/Javascript.  The syntax is extremely
 similar to Actionscript, so you could convert the MXML (via the option with
 the compiler to save the generated Actionscript from MXML) to haXe code,
 and the Actionscript too.  

 ** **

 Jason Merrill
 Instructional Technology Architect II**

 * Bank of America*  Global Learning 

 ** **

 ** **

 ** **

 ** **

 ** **

 ___

 ** **

 *From:* flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] *On
 Behalf Of *ganaraj p r
 *Sent:* Thursday, December 01, 2011 4:13 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Flex to HTML5 Conversion tool?

 ** **

   

 If my understanding is right, Adobe is working on it currently. So you
 might have to wait for another 6 months or so. 

 ** **

 If that time frame is not suitable for you, I suggest you rewrite the
 project in HTML 5.

 On Thu, Dec 1, 2011 at 3:27 AM, Sells, Fred fred.se...@adventistcare.org
 wrote:

   

 I am looking at the same problem.  A very long time ago I designed a tool
 called ezX that was similar to Flex but not nearly as robust.  That was an
 Xwindows tool and has since gone the way of the dinosaur.

  

 I’m still researching but I think a tool like pyjamas pyjs.org  might be
 a building block.  You could write an xml parser to handle the mxml to dom
 and then use the dom to generate pyjamas class definitions (which you would
 probably have to tweak by hand).

  

 I’m not sure about the action script.  Source parsing is too tricky and I
 don’t know if the byte code is easy to handle.  Might be better to
 outsource that overseas.

  

 Let me know what you decide

  

 *From:* flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] *On
 Behalf Of *Venkat M
 *Sent:* Wednesday, November 30, 2011 12:56 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Flex to HTML5 Conversion tool?

  

   

 *Hi Group,*

 * *

 *I have a quick question.*

 *I have a web application that was developed using 100% flex (AS
 included).*

 *Now to be on the safe side we want to evaluate the options of
 converting the same on to HTML5. *

 * *

 *Do any one know of any tools that can help in the process of converting
 from flex (developed) to html5 version?*

 *Your help will be greatly appreciated.*

  

 Cheers,

 *Venkat.*

  

  



 

 ** **

 --
 Regards,
 Ganaraj P R

 
  --
 This message w/attachments (message) is intended solely for the use of
 the intended recipient(s) and may contain information that is privileged,
 confidential or proprietary. If you are not an intended recipient, please
 notify the sender, and then please delete and destroy all copies and
 attachments, and be advised that any review or dissemination of, or the
 taking of any action in reliance on, the information contained in or
 attached to this message is prohibited.
 Unless specifically indicated, this message is not an offer to sell or a
 solicitation of any investment products or other financial product or
 service, an official confirmation of any transaction, or an official
 statement of Sender. Subject to applicable law, Sender may intercept,
 monitor, review and retain e-communications (EC) traveling through its
 networks/systems and may produce any such EC to regulators, law
 enforcement, in litigation and as required by law.
 The laws of the country of each sender/recipient may impact the handling
 of EC, and EC may be 

[flexcoders] Git and Flash Builder

2011-12-02 Thread John Fletcher
Anyone here using Git and Flash Builder?

John


RE: [flexcoders] RE: AIR/Window/DataGrid Issue

2011-12-02 Thread Battershall, Jeff
Thanks Alex,

It's pretty clear I'm pushing the envelope architecture-wise - I've got a 
module that opens a popup that opens a window that contains a datagrid.  
Interestingly though, in my Flex 4.0 version, where I wasn't using a Spark 
datagrid but instead using my solution using DataGroups (spark datagrid wasn't 
yet available) I had no issues. Note the first error I get is from that the 
DataGrid skin cannot be found.  Makes me wonder whether it's the styles that 
are not loaded.

I'm going to try to get my wits around using moduleFactory.  It appears that in 
order to use it I cannot use MXML but instead using AS?

Jeff

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Thursday, December 01, 2011 5:05 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: AIR/Window/DataGrid Issue



That's a very puzzling stack trace.  I have no idea how you can get into this 
situation.  Do you have a simple test case?

The moduleFactory subsystem relies on instantiating classes in a module via 
moduleInfo.factory.create().  The children of that class have moduleFactory 
propagated to them as they are added to their parents.

Calling some function on a module that calls PopUpManager.createPopUp() 
bypasses the subsystem because the popup is added to the systemManager and some 
class that has its moduleFactory set to the right place.  Is that what is going 
on in your code?  There is a moduleFactory parameter to createPopUp you can use.


On 12/1/11 10:06 AM, Battershall, Jeff jeff.battersh...@djindexes.com wrote:





Thanks Alex,

Here's the stack trace:

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
   at 
spark.components::Group/addElement()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1342]
   at 
spark.components.gridClasses::GridLayout/createTypicalItemRenderer()[E:\dev\4.y\fr!
 ameworks\projects\spark\src\spark\components\gridClasses\GridLayout.as:748]
   at 
spark.components.gridClasses::GridLayout/updateTypicalCellSizes()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\gridClasses\GridLayout.as:883]
   at 
spark.components.gridClasses::GridLayout/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\gridClasses\GridLayout.as:444]
   at 
spark.components.supportClasses::GroupBase/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\GroupBase.as:1148]
   at mx.core::UIComponent! 
/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E:http://www.adobe.com/2006/flex/mx/internal::measureSizes()%5bE:!
 \dev\4.y \frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
   at 
mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8430]
   at 
spark.components::Group/validateSize()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1012]
   at 
mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:665]
   at 
mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:816]
   at 
mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]


The app is constructed like so:

1)  Shell application
2)  Modules loaded at runtime
3)  The module in question has a pop up wizard (TitleWindow).
4)  The popup wizard opens Window.
5)  Window contains DataGrid.

I! don't understand how the module factory for the datagrid points to the 
module factory for the module.  How's that accomplished?

Jeff




From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Thursday, December 01, 2011 12:51 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: AIR/Window/! DataGrid Issue
n bsp;



What is the Group stack trace?  If classes are in a module you definitely have 
to get the moduleFactory pointing to that module because that's probably where 
the skins are as well.


On 12/1/11 5:06 AM, Battershall, Jeff jeff.battersh...@djindexes.com wrote:





My issue sounds similar to this issue:

http://forums.adobe.com/message/3910406

What's unclear to me is how to work around it in my circumstance.  Clearly I 
should be able to declare a datagrid in a Window and have it work without an 
elaborate workaround.

Any advice appreciated.

Jeff


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Battershall, Jeff
Sent: Wednesday, November 30, 2011 8:58 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] AIR/Window/DataGrid Issue





Hi,

I'm mid re-factoring a SDK 4.0 AIR app to 4.5 and attempting to take advantage 
of the Spark DataGrid.   In this app (which is built with modules) I'm openin! 
g a NativeWindow and displaying a datagrid.   The fi! rst erro r 

[flexcoders] getting the total of values of an array collection that is updated manually

2011-12-02 Thread ZIONIST
Hi Guys, i would like to get the total price calculated as an array collection 
for a list is populated plus i would like to update the total when the quantity 
changes too. Here is the code i have so far, could someone please help me 
correct it.

Main App
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=horizontal
xmlns:ns1=*
mx:states
mx:State name=dark
mx:SetProperty target={product}
name=text
value=Dark Chocolate/
mx:SetProperty target={price}
name=text
value=50/
/mx:State
mx:State name=spread
mx:SetProperty target={product}
name=text
value=Drinking 
Chocolate/
mx:SetProperty target={price}
name=text
value=100/
/mx:State
/mx:states

mx:Script
![CDATA[
import mx.controls.listClasses.ListData;
import mx.collections.ArrayCollection;

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

private function addProduct():void
{

//Create an object to hold the data
var obj:Object=new Object();
//Assign the variables to it
obj.Product=product.text;
obj.Price=price.text;
//Add the object to the list
orderColl.addItem(obj);

}

private function deleteOrder():void
{

//Remove the item from the array collection
orderColl.removeItemAt(products.selectedIndex);

}

private function init():void
{
var n:int=orderColl.length;
var total:Number=0;
for (var i:int=0; i  n; i++)
{

//total+=orderColl[i][products.item.Price];
total+=orderColl[i].Price++;
}
sum.text=total.toString();

}
]]
/mx:Script

mx:Canvas width=500
   height=300
mx:Label x=10
  y=10
  text=Milk Chocolate
  id=product/
mx:Label x=10
  y=36
  text=10
  id=price/
mx:Button x=10
   y=62
   label=submit
   click=addProduct();init()/
mx:Button x=10
   y=92
   label=Change State
   click=currentState='dark'/
mx:Button x=10
   y=122
   label=Drinking Chocolate
   click=currentState='spread'/
/mx:Canvas

mx:VBox width=340
 height=340
 horizontalAlign=center
 verticalAlign=middle
mx:List id=products
 width=300
 height=300
 dataProvider={orderColl}
 itemRenderer=orderRenderer/
mx:HBox
mx:Label text=Total:
  color=#FF
  fontWeight=bold/
mx:Label id=sum
  text=${}/
/mx:HBox
/mx:VBox

/mx:Application


Item Renderer (orderRenderer.mxml)

?xml version=1.0 encoding=utf-8?
mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml;
 width=100%
 height=100%
 

[flexcoders] Re: getting the total of values of an array collection that is updated manually

2011-12-02 Thread ZIONIST
Hey guys! any help with my Predicament?



[flexcoders] Re: Check if a Security Domain is accepted or not (IE for bitmap smoothing)

2011-12-02 Thread dorkie dork from dorktown
To sort of answer my own question I've read that you can check
parentAllowsChild and childAllowsParent on the loader of the Image.

On Tue, Nov 29, 2011 at 11:33 AM, dorkie dork from dorktown 
dorkiedorkfromdorkt...@gmail.com wrote:

 I have an image I am pulling in from Facebook. It is running ok but now
 that we rotated the image it looks horribly pixelated with a lot of
 aliasing. I tried to set bitmap smoothing to true and it resulted in the
 famous error:

 SecurityError: Error #2122: Security sandbox violation: Loader.content:
 http:// cannot access .jpg. A policy file is required, but the
 checkPolicyFile flag was not set when this media was loaded.

 I found online that Facebook has a policy file and I applied it
 successfully using:

 protected function initializeHandler(event:FlexEvent):void
 {
 // allows bitmap smoothing (which we need here)
 Security.loadPolicyFile(
 http://profile.ak.fbcdn.net/crossdomain.xml;);
 var context:LoaderContext = new LoaderContext();
 context.checkPolicyFile = true;
 context.applicationDomain =
 ApplicationDomain.currentDomain;
 }

 This is called before the Image source is set. In fact it is in the
 initialize event of the Image container component.

 But I am wary to upload it to a site where I do not know if it will break
 because it is will be in a different security sandbox again.

 My question is, is there a way to tell if I can set bitmap smoothing to
 true on my images (bc if it is not allowed it will cause fatal errors and
 the whole application will explode). In other words, is it possible to tell
 if I'm in the correct security sandbox (security policy loaded and was
 successful) so I know smoothing is allowed. Does that make sense?





Re: [flexcoders] RE: AIR/Window/DataGrid Issue

2011-12-02 Thread Alex Harui
Basic implementations should be able to use MXML.  For example, you cram a 
bunch of MXML in a mx:Module and load that in an mx:ModuleLoader and it 
just works.

But it gets trickier when using popups.  Usually you have to call PopUpManager 
from AS anyway and you can choose the moduleFactory to pass in.
Is the Window and DataGrid in one MXML file?  Maybe instead of calling “new 
MyWindow()” you can use moduleFactory.create(“some.package.MyWindow”) and that 
will get things going in the right direction.

I suspect the DataGroups worked because they don’t have skins or the skins were 
in the main app.

The DataGrid’s styles are probably in the same module SWF as the DataGrid.  The 
problem is that if the DataGrid’s moduleFactory is pointing at the main app, it 
won’t find the styles in there.  The DataGrid is probably picking up its 
moduleFactory from its parents.

-Alex

On 12/2/11 4:00 AM, Battershall, Jeff jeff.battersh...@djindexes.com wrote:






Thanks Alex,

It’s pretty clear I’m pushing the envelope architecture-wise – I’ve got a 
module that opens a popup that opens a window that contains a datagrid.  
Interestingly though, in my Flex 4.0 version, where I wasn’t using a Spark 
datagrid but instead using my solution using DataGroups (spark datagrid wasn’t 
yet available) I had no issues. Note the first error I get is from that the 
DataGrid skin cannot be found.  Makes me wonder whether it’s the styles that 
are not loaded.

I! #8217;m going to try to get my wits around using moduleFactory.  It appears 
that in order to use it I cannot use MXML but instead using AS?

Jeff


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Thursday, December 01, 2011 5:05 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: AIR/Window/DataGrid Issue



That’s a very! puzzling stack trace.  I have no idea how you can get in! to 
this situation.  Do you have a simple test case?

The moduleFactory subsystem relies on instantiating classes in a module via 
moduleInfo.factory.create().  The children of that class have moduleFactory 
propagated to them as they are added to their parents.

Calling some function on a module that calls PopUpManager.createPopUp() 
bypasses the subsystem because the popup is added to the systemManager and some 
class that has its moduleFactory set to the right place.  Is that what is going 
on in your code?  There is a moduleFactory parameter to createPopUp you can use.


On 12/1/11 10:06 AM, Battershall, Jeff jeff.battersh...@djindexes.com wrote:





Thanks Alex,

Here’s the stack trace:

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
   at 
spark.components::Group/addElement()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1342]
   at 
spark.components.gridClasses::GridLayout/createTypicalItemRenderer()[E:\dev\4.y\fr!
 ameworks\projects\spark\src\spark\components\gridClasses\GridLayout.as:748]
   at 
spark.components.gridClasses::GridLayout/updateTypicalCellSizes()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\gridClasses\GridLayout.as:883]
   at 
spark.components.gridClasses::GridLayout/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\gridClasses\GridLayout.as:444]
   at 
spark.components.supportClasses::GroupBase/measure()[E:\dev\4.y\framew! 
orks\projects\spark\src\spark\components\supportClasses\GroupB! ase.as:1 148]
   at mx.core::UIComponent! 
/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E: 
http://www.adobe.com/2006/flex/mx/internal::measureSizes()%5bE: ! \dev\4.y 
\frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
   at 
mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8430]
   at 
spark.components::Group/validateSize()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1012]
   at 
mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:665]
   at 
mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:816]
 ! nbsp; at 
mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]


The app is constructed like so:

1)  Shell application
2)  Modules loaded at runtime
3)  The module in question has a pop up wizard (TitleWindow).
4)  The popup wizard opens Window.
5)  Window contains DataGrid.

I! don’t understand how the module factory for the datagrid points to the 
module factory for the module.  How’s that accomplished?

Jeff




From: flexcoders@yahoogroups.com [mailto:flexcoders@yaho! ogroups. com] On 
Behalf Of Alex Harui
Sent: Thursday, December 01, 2011 12:51 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: AIR/Window/! DataGrid Issue
n bsp;



What is the Group 

RE: [flexcoders] Flex to HTML5 Conversion tool?

2011-12-02 Thread Sells, Fred
One of my co-workers has been spending the last ? years on a project
that uses his standard xml syntax to define a UI and then plans to
generate HTML or  Swing, etc from that.  It is his intent to define a UI
library independent layout tool.  I question if it's worth the effort.  

 

I like the clean lines of Python code and I would probably use some of
the meta language and introspection features to allow me to define my
HTML using object technology and then have each object have a
self.toXML() method that would do the right thing and call all
children recursively.

 

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of Doug McCune
Sent: Thursday, December 01, 2011 4:48 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex to HTML5 Conversion tool?

 

  

Just to throw in my two cents... I would not hold out any hope for any
solution that will magically convert your Flex app to a HTML/JS app. Not
in 6 months, not in 6 years. I don't want to be a downer, but I just
don't see it happening. Sure, we may see some tech demos that work on
super simple Flex apps, but I think that's about as far as you'll get.
You also might get tools that let you write a new app in MXML/AS,
specifically with targeting HTML/JS in mind, and that might work well.
But I have almost no confidence that you will ever be able to take an
existing, large Flex app and magically get it to run well as an HTML
app. I'd of course love to be proven wrong.

 

My advice is that if you really need to target HTML/JS is to build it
new from scratch. It's a harsh reality, and you're going to hate a lot
of the toolchain, language, and process, but if you really do have the
requirement that you need to have an HTML/JS app, you might as well just
rip off the band-aid in one go instead of holding out hope for a holy
grail solution. 

 

On Thu, Dec 1, 2011 at 6:27 AM, Merrill, Jason
jason.merr...@bankofamerica.com wrote:

  

Check out another possibility - using haXe for converting an
MXML/Actionscript project to HTML5/Javascript.  The syntax is extremely
similar to Actionscript, so you could convert the MXML (via the option
with the compiler to save the generated Actionscript from MXML) to haXe
code, and the Actionscript too.  

 

Jason Merrill
Instructional Technology Architect II

Bank of America  Global Learning 

 

 

 

 

 

___

 

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of ganaraj p r
Sent: Thursday, December 01, 2011 4:13 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex to HTML5 Conversion tool?

 

  

If my understanding is right, Adobe is working on it currently. So you
might have to wait for another 6 months or so. 

 

If that time frame is not suitable for you, I suggest you rewrite the
project in HTML 5.

On Thu, Dec 1, 2011 at 3:27 AM, Sells, Fred
fred.se...@adventistcare.org wrote:

  

I am looking at the same problem.  A very long time ago I designed a
tool called ezX that was similar to Flex but not nearly as robust.  That
was an Xwindows tool and has since gone the way of the dinosaur.

 

I'm still researching but I think a tool like pyjamas pyjs.org  might be
a building block.  You could write an xml parser to handle the mxml to
dom and then use the dom to generate pyjamas class definitions (which
you would probably have to tweak by hand).

 

I'm not sure about the action script.  Source parsing is too tricky and
I don't know if the byte code is easy to handle.  Might be better to
outsource that overseas.

 

Let me know what you decide

 

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of Venkat M
Sent: Wednesday, November 30, 2011 12:56 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex to HTML5 Conversion tool?

 

  

Hi Group,

 

I have a quick question.

I have a web application that was developed using 100% flex (AS
included).

Now to be on the safe side we want to evaluate the options of converting
the same on to HTML5. 

 

Do any one know of any tools that can help in the process of converting
from flex (developed) to html5 version?

Your help will be greatly appreciated.

 

Cheers,

Venkat.

 

 





 

-- 
Regards,
Ganaraj P R



This message w/attachments (message) is intended solely for the use of
the intended recipient(s) and may contain information that is
privileged, confidential or proprietary. If you are not an intended
recipient, please notify the sender, and then please delete and destroy
all copies and attachments, and be advised that any review or
dissemination of, or the taking of any action in reliance on, the
information contained in or attached to this message is prohibited. 
Unless specifically indicated, this message is not an offer to sell or a
solicitation of any investment products or other financial product or
service, an official confirmation of any transaction, or an official
statement of Sender. 

Re: [flexcoders] Re: Check if a Security Domain is accepted or not (IE for bitmap smoothing)

2011-12-02 Thread Robert VanCuren Jr
I do not seem to have this problem. Can you post more code so I can get a
better look at what you are doing. I use facebook images all the time with
out problem.

The only time I have had issues with policy files is when the image url
is actually a redirect. Flash checks the policy file before loading the
image and does not resolve the redirect until after the image has loaded.
Thus it does not realize that it check the wrong domains policy file. You
can detect this and then manually load the policy file of the image once it
is loaded by checking the actual url.

On Fri, Dec 2, 2011 at 1:39 PM, dorkie dork from dorktown 
dorkiedorkfromdorkt...@gmail.com wrote:

 **


 To sort of answer my own question I've read that you can check
 parentAllowsChild and childAllowsParent on the loader of the Image.

 On Tue, Nov 29, 2011 at 11:33 AM, dorkie dork from dorktown 
 dorkiedorkfromdorkt...@gmail.com wrote:

 I have an image I am pulling in from Facebook. It is running ok but now
 that we rotated the image it looks horribly pixelated with a lot of
 aliasing. I tried to set bitmap smoothing to true and it resulted in the
 famous error:

 SecurityError: Error #2122: Security sandbox violation: Loader.content:
 http:// cannot access .jpg. A policy file is required, but the
 checkPolicyFile flag was not set when this media was loaded.

 I found online that Facebook has a policy file and I applied it
 successfully using:

 protected function initializeHandler(event:FlexEvent):void
 {
 // allows bitmap smoothing (which we need here)
 Security.loadPolicyFile(
 http://profile.ak.fbcdn.net/crossdomain.xml;);
 var context:LoaderContext = new LoaderContext();
 context.checkPolicyFile = true;
 context.applicationDomain =
 ApplicationDomain.currentDomain;
 }

 This is called before the Image source is set. In fact it is in the
 initialize event of the Image container component.

 But I am wary to upload it to a site where I do not know if it will break
 because it is will be in a different security sandbox again.

 My question is, is there a way to tell if I can set bitmap smoothing to
 true on my images (bc if it is not allowed it will cause fatal errors and
 the whole application will explode). In other words, is it possible to tell
 if I'm in the correct security sandbox (security policy loaded and was
 successful) so I know smoothing is allowed. Does that make sense?



  



Re: [flexcoders] Accessing functions from an embedded SWF from Flash

2011-12-02 Thread David Pariente

solved,

just creating a movieclip with the SWLoader content worked for me.

Thanks everyone

Al 02/12/2011 5:27, En/na David Pariente ha escrit:


Hello,

I'm upgrading and existing Flex 3.5 website to Flex4.5,

I have a small Flash created SWF file that has functions on it.

In Flex i embed it using SWFLoader, and i need to call a function on the
embedded SWF.

Tryied it in many diferent ways with no success. The SWF loads, runs,
but i can't call one of it's functions from Flex 4.5

Any ideas or example will help, since i've been stuck with this for many
days, Thank you.




[flexcoders] Re: getting the total of values of an array collection that is updated manually

2011-12-02 Thread ZIONIST
Any solution for my problem guys? I would be very grateful.