[Flashcoders] Detecting if authoring mode (Flash 8 AS2)

2009-04-02 Thread Paul Steven
Is there a property or function to detect if a Flash movie is being tested
in authoring mode or live on the web?

Basically I have added a random variable to my xml file when loading it to
prevent caching.

The following works in both authoring and when live

myXML.load(xml/homeFlashContent.xml);

Whereas the following including the cache busting code doesn't work when
tested within Flash IDE.

my_Date = new Date();

myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

I would therefore like to have an if statement something like

If (boolAuthoringMode == true) {

myXML.load(xml/homeFlashContent.xml);

} else {

myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

}


If there are any better solutions please let me know.

Thanks

Paul

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] FPS question

2009-04-02 Thread Ian Thomas
Also = try to redraw as little of the screen as possible from frame to frame.

If your entire screen is constantly redrawing, that takes a lot of
processing power.

So alpha fades that affect the entire screen or moving/animating a
sprite which covers the entire screen are problems.

The Flash Debug Player has a right-click context menu option called
something like Show Redraw Areas (I forget).

HTH,
  Ian


P.S. There's a bug in FP9+ - possibly still in 10, I can't remember.
Calling setChildIndex() forces the entire display to be redrawn.

On Wed, Apr 1, 2009 at 11:49 PM, Karl DeSaulniers k...@designdrumm.com wrote:
 Perfect thank you...


 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Detecting if authoring mode (Flash 8 AS2)

2009-04-02 Thread Karl DeSaulniers

Try
+my_Date.getUTCSeconds().toString()

Sent from losPhone

On Apr 2, 2009, at 2:19 AM, Paul Steven paul_ste...@btinternet.com  
wrote:


Is there a property or function to detect if a Flash movie is being  
tested

in authoring mode or live on the web?

Basically I have added a random variable to my xml file when loading  
it to

prevent caching.

The following works in both authoring and when live

myXML.load(xml/homeFlashContent.xml);

Whereas the following including the cache busting code doesn't work  
when

tested within Flash IDE.

my_Date = new Date();

myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

I would therefore like to have an if statement something like

If (boolAuthoringMode == true) {

   myXML.load(xml/homeFlashContent.xml);

} else {

   myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

}


If there are any better solutions please let me know.

Thanks

Paul

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Detecting if authoring mode (Flash 8 AS2)

2009-04-02 Thread Ian Thomas
Hi Paul,

   Take a look at System.capabilities.playerType.


   System.capabilities.playerType==External means you're running in the IDE.

   System.capabilities.playerType==Plugin means you're running in a browser.


HTH,
Ian


On Thu, Apr 2, 2009 at 8:19 AM, Paul Steven paul_ste...@btinternet.com wrote:
 Is there a property or function to detect if a Flash movie is being tested
 in authoring mode or live on the web?

 Basically I have added a random variable to my xml file when loading it to
 prevent caching.

 The following works in both authoring and when live

 myXML.load(xml/homeFlashContent.xml);

 Whereas the following including the cache busting code doesn't work when
 tested within Flash IDE.

 my_Date = new Date();

 myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

 I would therefore like to have an if statement something like

 If (boolAuthoringMode == true) {

        myXML.load(xml/homeFlashContent.xml);

 } else {

        myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

 }


 If there are any better solutions please let me know.

 Thanks

 Paul

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Detecting if authoring mode (Flash 8 AS2)

2009-04-02 Thread Glen Pike

Hi,

   I have used the _root.url variable before to detect whether it is 
an http or a file based one and done caching based on that.


   Glen

Paul Steven wrote:

Is there a property or function to detect if a Flash movie is being tested
in authoring mode or live on the web?

Basically I have added a random variable to my xml file when loading it to
prevent caching.

The following works in both authoring and when live

myXML.load(xml/homeFlashContent.xml);

Whereas the following including the cache busting code doesn't work when
tested within Flash IDE.

my_Date = new Date();

myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

I would therefore like to have an if statement something like

If (boolAuthoringMode == true) {

myXML.load(xml/homeFlashContent.xml);

} else {

myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

}


If there are any better solutions please let me know.

Thanks

Paul

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Proof of Concept - HTTPService object doesn't require crossdomain-policy file

2009-04-02 Thread Johan Nyberg
Hi, thanks for all the response to my question about the 
crossdomain.xml. But... I didn't get a lot of response to the fact that 
HTTPService can access public feeds/content on other sites without the 
need of a crossdomain.xml


Please check out the code included at the end of this post. I've created 
a small AIR application (with a certificate) and it works without a 
problem.


Am I missing something?

But again.. if my Flash app isn't allowed to access content on another 
site, I can always throw together a simple php-script that extracts the 
content for me that my Flash then can read...


And then I can go ahead and create my evil banner ad. ;-)

I understand that crossdomain policy files are here to stay. I just 
don't understand why they don't allow me to access content on other 
domains that I can access in other ways and then pass on to Flash.


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Oops.. forgot to include the code. Proof of Concept - HTTPService

2009-04-02 Thread Johan Nyberg
Forgot to include the code as promised in my previous post. Here it is. 
Please set url to wathever favourite RSS or whatever you want to access:



?xml version=1.0 encoding=utf-8?
mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute creationComplete=loadSettings() width=200 
height=300

mx:Script
![CDATA[
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;

private var req:HTTPService;

private function loadSettings():void
{
this.req = new HTTPService();
req.addEventListener(ResultEvent.RESULT, resultHandler 
);
req.resultFormat = text;
			req.url =  //set to the url of whatever, for example your favourite 
RSS feed;

req.send();
}

private function resultHandler( _event:ResultEvent ):void
{
myText.text = _event.result.toString();
}
]]
/mx:Script
mx:Canvas width=100% height=100%
mx:VBox width=100% height=100%
mx:TextArea id=myText width=100% 
height=100% /
/mx:VBox
/mx:Canvas
/mx:WindowedApplication


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Proof of Concept - HTTPService object doesn't require crossdomain-policy file

2009-04-02 Thread Glen Pike
If that is the case then why is my standalone Flash exe restricted when 
I set it to allow network access only?


Paul Andrews wrote:
Isn't the context for an AIR application different to a flash 
application loaded from a browser?


In the browser the flash swf is loaded from a particular domain and 
access outside that domain requires the crossdomain policy.


In an Air application there is no concept of the domain that the swf 
is loaded from - it's essentially a desktop application.


Flash in Air and Flash in the browser have different security models.

Paul
- Original Message - From: Johan Nyberg 
johan.nyb...@webguidepartner.com

To: flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 9:29 AM
Subject: [Flashcoders] Proof of Concept - HTTPService object doesn't 
require crossdomain-policy file



Hi, thanks for all the response to my question about the 
crossdomain.xml. But... I didn't get a lot of response to the fact 
that HTTPService can access public feeds/content on other sites 
without the need of a crossdomain.xml


Please check out the code included at the end of this post. I've 
created a small AIR application (with a certificate) and it works 
without a problem.


Am I missing something?

But again.. if my Flash app isn't allowed to access content on 
another site, I can always throw together a simple php-script that 
extracts the content for me that my Flash then can read...


And then I can go ahead and create my evil banner ad. ;-)

I understand that crossdomain policy files are here to stay. I just 
don't understand why they don't allow me to access content on other 
domains that I can access in other ways and then pass on to Flash.


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't require crossdomain-policy file

2009-04-02 Thread Paul Andrews

Is this a projector or an AIR application?

Seems to me that if you say network only to an executable, it's like 
running it in a browser with no default domain, whereas an AIR application 
isn't restricted.


Paul
- Original Message - 
From: Glen Pike g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:26 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't 
require crossdomain-policy file



If that is the case then why is my standalone Flash exe restricted when I 
set it to allow network access only?


Paul Andrews wrote:
Isn't the context for an AIR application different to a flash application 
loaded from a browser?


In the browser the flash swf is loaded from a particular domain and 
access outside that domain requires the crossdomain policy.


In an Air application there is no concept of the domain that the swf is 
loaded from - it's essentially a desktop application.


Flash in Air and Flash in the browser have different security models.

Paul
- Original Message - From: Johan Nyberg 
johan.nyb...@webguidepartner.com

To: flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 9:29 AM
Subject: [Flashcoders] Proof of Concept - HTTPService object doesn't 
require crossdomain-policy file



Hi, thanks for all the response to my question about the 
crossdomain.xml. But... I didn't get a lot of response to the fact that 
HTTPService can access public feeds/content on other sites without the 
need of a crossdomain.xml


Please check out the code included at the end of this post. I've created 
a small AIR application (with a certificate) and it works without a 
problem.


Am I missing something?

But again.. if my Flash app isn't allowed to access content on another 
site, I can always throw together a simple php-script that extracts the 
content for me that my Flash then can read...


And then I can go ahead and create my evil banner ad. ;-)

I understand that crossdomain policy files are here to stay. I just 
don't understand why they don't allow me to access content on other 
domains that I can access in other ways and then pass on to Flash.


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Oops.. forgot to include the code. Proof of Concept - HTTPService

2009-04-02 Thread Ian Thomas
Johan - from memory, I'm not sure AIR needs the crossdomain file,
whereas browser-based Flash does.

That might explain the discrepancy.

(That is from memory, though - probably needs doublechecking...)

Cheers,
   Ian

On Thu, Apr 2, 2009 at 9:35 AM, Johan Nyberg
johan.nyb...@webguidepartner.com wrote:
 Forgot to include the code as promised in my previous post. Here it is.
 Please set url to wathever favourite RSS or whatever you want to access:


 ?xml version=1.0 encoding=utf-8?
 mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute creationComplete=loadSettings() width=200
 height=300
        mx:Script
        ![CDATA[
                import mx.rpc.events.ResultEvent;
                import mx.rpc.http.HTTPService;

                private var req:HTTPService;

                private function loadSettings():void
                {
                        this.req = new HTTPService();
                        req.addEventListener(ResultEvent.RESULT,
 resultHandler );
                        req.resultFormat = text;
                        req.url =  //set to the url of whatever, for
 example your favourite RSS feed;
                        req.send();
                }

                private function resultHandler( _event:ResultEvent ):void
                {
                        myText.text = _event.result.toString();
                }
        ]]
    /mx:Script
                mx:Canvas width=100% height=100%
                        mx:VBox width=100% height=100%
                                mx:TextArea id=myText width=100%
 height=100% /
                        /mx:VBox
                /mx:Canvas
 /mx:WindowedApplication


 --
 Johan Nyberg

 Web Guide Partner
 Engelbrektsplan 1
 114 34 Stockholm
 08 - 50 00 24 30
 070 - 407 83 00
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Detecting if authoring mode (Flash 8 AS2)

2009-04-02 Thread Paul Steven
Thanks Glen - that seems to be just what I was after.

Cheers

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
Sent: 02 April 2009 09:15
To: Flash Coders List
Subject: Re: [Flashcoders] Detecting if authoring mode (Flash 8 AS2)

Hi,

I have used the _root.url variable before to detect whether it is 
an http or a file based one and done caching based on that.

Glen

Paul Steven wrote:
 Is there a property or function to detect if a Flash movie is being tested
 in authoring mode or live on the web?

 Basically I have added a random variable to my xml file when loading it to
 prevent caching.

 The following works in both authoring and when live

 myXML.load(xml/homeFlashContent.xml);

 Whereas the following including the cache busting code doesn't work when
 tested within Flash IDE.

 my_Date = new Date();

 myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

 I would therefore like to have an if statement something like

 If (boolAuthoringMode == true) {

   myXML.load(xml/homeFlashContent.xml);

 } else {

   myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

 }


 If there are any better solutions please let me know.

 Thanks

 Paul

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


   

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Proof of Concept - HTTPServiceobjectdoesn't require crossdomain-policy file

2009-04-02 Thread Paul Andrews
Looking at the flash player security model, a projector has a local security 
sandbox while a browser launched swf has a security sandbox that includes 
it's own domain, so this would explain why your projector would be 
restricted.


Paul
- Original Message - 
From: Paul Andrews p...@ipauland.com

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:36 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPServiceobjectdoesn't 
require crossdomain-policy file




Is this a projector or an AIR application?

Seems to me that if you say network only to an executable, it's like 
running it in a browser with no default domain, whereas an AIR 
application isn't restricted.


Paul
- Original Message - 
From: Glen Pike g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:26 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't 
require crossdomain-policy file



If that is the case then why is my standalone Flash exe restricted when I 
set it to allow network access only?


Paul Andrews wrote:
Isn't the context for an AIR application different to a flash 
application loaded from a browser?


In the browser the flash swf is loaded from a particular domain and 
access outside that domain requires the crossdomain policy.


In an Air application there is no concept of the domain that the swf is 
loaded from - it's essentially a desktop application.


Flash in Air and Flash in the browser have different security models.

Paul
- Original Message - From: Johan Nyberg 
johan.nyb...@webguidepartner.com

To: flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 9:29 AM
Subject: [Flashcoders] Proof of Concept - HTTPService object doesn't 
require crossdomain-policy file



Hi, thanks for all the response to my question about the 
crossdomain.xml. But... I didn't get a lot of response to the fact that 
HTTPService can access public feeds/content on other sites without the 
need of a crossdomain.xml


Please check out the code included at the end of this post. I've 
created a small AIR application (with a certificate) and it works 
without a problem.


Am I missing something?

But again.. if my Flash app isn't allowed to access content on another 
site, I can always throw together a simple php-script that extracts the 
content for me that my Flash then can read...


And then I can go ahead and create my evil banner ad. ;-)

I understand that crossdomain policy files are here to stay. I just 
don't understand why they don't allow me to access content on other 
domains that I can access in other ways and then pass on to Flash.


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't require crossdomain-policy file

2009-04-02 Thread Glen Pike

Hi,

   It's an AS2 Flash application running standalone on Linux requesting 
stuff from the localhost on various ports - the irritating thing is I 
still have to implement x-domain files / responses on every port I 
connect to, I tried setting a policy server up on the default port as 
per the instructions on the devnet site, but this did not work..


   My point is that the standalone Flash application is an exe, like 
Air, so implies that a higher level of trust is required to run it, 
therefore it should be allowed more liberty than a browser based Flash 
app.  This is one of the most irritating things about doing standalone 
stuff - I can't load files from the file system because I am requesting 
over the network.  I am doing standalone because this is legacy stuff 
for a kiosk...


   Glen

Paul Andrews wrote:

Is this a projector or an AIR application?

Seems to me that if you say network only to an executable, it's like 
running it in a browser with no default domain, whereas an AIR 
application isn't restricted.


Paul
- Original Message - From: Glen Pike 
g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:26 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService 
objectdoesn't require crossdomain-policy file



If that is the case then why is my standalone Flash exe restricted 
when I set it to allow network access only?


Paul Andrews wrote:
Isn't the context for an AIR application different to a flash 
application loaded from a browser?


In the browser the flash swf is loaded from a particular domain and 
access outside that domain requires the crossdomain policy.


In an Air application there is no concept of the domain that the swf 
is loaded from - it's essentially a desktop application.


Flash in Air and Flash in the browser have different security models.

Paul
- Original Message - From: Johan Nyberg 
johan.nyb...@webguidepartner.com

To: flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 9:29 AM
Subject: [Flashcoders] Proof of Concept - HTTPService object doesn't 
require crossdomain-policy file



Hi, thanks for all the response to my question about the 
crossdomain.xml. But... I didn't get a lot of response to the fact 
that HTTPService can access public feeds/content on other sites 
without the need of a crossdomain.xml


Please check out the code included at the end of this post. I've 
created a small AIR application (with a certificate) and it works 
without a problem.


Am I missing something?

But again.. if my Flash app isn't allowed to access content on 
another site, I can always throw together a simple php-script that 
extracts the content for me that my Flash then can read...


And then I can go ahead and create my evil banner ad. ;-)

I understand that crossdomain policy files are here to stay. I just 
don't understand why they don't allow me to access content on other 
domains that I can access in other ways and then pass on to Flash.


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Proof of Concept - HTTPServiceobjectdoesn't require crossdomain-policy file

2009-04-02 Thread Glen Pike

Projector sandbox can be set to local or network, but not both.

Paul Andrews wrote:
Looking at the flash player security model, a projector has a local 
security sandbox while a browser launched swf has a security sandbox 
that includes it's own domain, so this would explain why your 
projector would be restricted.


Paul
- Original Message - From: Paul Andrews p...@ipauland.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:36 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPServiceobjectdoesn't 
require crossdomain-policy file




Is this a projector or an AIR application?

Seems to me that if you say network only to an executable, it's 
like running it in a browser with no default domain, whereas an AIR 
application isn't restricted.


Paul
- Original Message - From: Glen Pike 
g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:26 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService 
objectdoesn't require crossdomain-policy file



If that is the case then why is my standalone Flash exe restricted 
when I set it to allow network access only?


Paul Andrews wrote:
Isn't the context for an AIR application different to a flash 
application loaded from a browser?


In the browser the flash swf is loaded from a particular domain and 
access outside that domain requires the crossdomain policy.


In an Air application there is no concept of the domain that the 
swf is loaded from - it's essentially a desktop application.


Flash in Air and Flash in the browser have different security models.

Paul
- Original Message - From: Johan Nyberg 
johan.nyb...@webguidepartner.com

To: flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 9:29 AM
Subject: [Flashcoders] Proof of Concept - HTTPService object 
doesn't require crossdomain-policy file



Hi, thanks for all the response to my question about the 
crossdomain.xml. But... I didn't get a lot of response to the fact 
that HTTPService can access public feeds/content on other sites 
without the need of a crossdomain.xml


Please check out the code included at the end of this post. I've 
created a small AIR application (with a certificate) and it works 
without a problem.


Am I missing something?

But again.. if my Flash app isn't allowed to access content on 
another site, I can always throw together a simple php-script that 
extracts the content for me that my Flash then can read...


And then I can go ahead and create my evil banner ad. ;-)

I understand that crossdomain policy files are here to stay. I 
just don't understand why they don't allow me to access content on 
other domains that I can access in other ways and then pass on to 
Flash.


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Bitwise selection

2009-04-02 Thread Jiri

I am new to bitwise operators, so I am trying to learn it.

I have the following code and it works half. I am using a switch case to 
get the result, but this is messing things up. I could revert to and if 
- else statement, but I was wondering if there is a more elagant way of 
doing it. I post my code below, and would have some advice.


var NO_RESTRICTION:int = 1;
var NUM_ONLY:int = 2;
var CHAR_ONLY:int = 4;

var RESTRICTION:int =  NUM_ONLY ;

function setInputCharRestriction(tInt:int):void {
RESTRICTION = tInt | tInt2 | tInt3;
}

function getRestrict():String{
var tRestrict:String = '';

trace('all ' , Boolean(RESTRICTION1))
trace('num ' , Boolean(RESTRICTION2))
trace('char ' ,Boolean(RESTRICTION4))

switch(RESTRICTION){
case RESTRICTION1 :
tRestrict +=\u0020-\u007E;
trace('all')
case RESTRICTION2:
tRestrict = 0-9;
trace('num')
case RESTRICTION4:
tRestrict = A-Z a-z;
trace('char')
}
trace('restrict field ' , tRestrict)
return tRestrict;
}

getRestrict()

Thank you.

Jiri
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Detecting if authoring mode (Flash 8 AS2)

2009-04-02 Thread Paul Steven
Nice one Ian - that looks even better than the other suggestion by Glen:)

Cheers

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Ian Thomas
Sent: 02 April 2009 08:40
To: Flash Coders List
Subject: Re: [Flashcoders] Detecting if authoring mode (Flash 8 AS2)

Hi Paul,

   Take a look at System.capabilities.playerType.


   System.capabilities.playerType==External means you're running in the
IDE.

   System.capabilities.playerType==Plugin means you're running in a
browser.


HTH,
Ian


On Thu, Apr 2, 2009 at 8:19 AM, Paul Steven paul_ste...@btinternet.com
wrote:
 Is there a property or function to detect if a Flash movie is being tested
 in authoring mode or live on the web?

 Basically I have added a random variable to my xml file when loading it to
 prevent caching.

 The following works in both authoring and when live

 myXML.load(xml/homeFlashContent.xml);

 Whereas the following including the cache busting code doesn't work when
 tested within Flash IDE.

 my_Date = new Date();

 myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

 I would therefore like to have an if statement something like

 If (boolAuthoringMode == true) {

        myXML.load(xml/homeFlashContent.xml);

 } else {

        myXML.load(xml/homeFlashContent.xml?+my_Date.getUTCSeconds());

 }


 If there are any better solutions please let me know.

 Thanks

 Paul

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Bitwise selection

2009-04-02 Thread Hans Wichman
Hi,

isn't the absence of break statements messing things up?

greetz
JC

On Thu, Apr 2, 2009 at 12:08 PM, Jiri jiriheitla...@googlemail.com wrote:

 I am new to bitwise operators, so I am trying to learn it.

 I have the following code and it works half. I am using a switch case to
 get the result, but this is messing things up. I could revert to and if -
 else statement, but I was wondering if there is a more elagant way of doing
 it. I post my code below, and would have some advice.

 var NO_RESTRICTION:int = 1;
 var NUM_ONLY:int = 2;
 var CHAR_ONLY:int = 4;

 var RESTRICTION:int =  NUM_ONLY ;

 function setInputCharRestriction(tInt:int):void {
RESTRICTION = tInt | tInt2 | tInt3;
 }

 function getRestrict():String{
var tRestrict:String = '';

trace('all ' , Boolean(RESTRICTION1))
trace('num ' , Boolean(RESTRICTION2))
trace('char ' ,Boolean(RESTRICTION4))

switch(RESTRICTION){
case RESTRICTION1 :
tRestrict +=\u0020-\u007E;
trace('all')
case RESTRICTION2:
tRestrict = 0-9;
trace('num')
case RESTRICTION4:
tRestrict = A-Z a-z;
trace('char')
}
trace('restrict field ' , tRestrict)
return tRestrict;
 }

 getRestrict()

 Thank you.

 Jiri
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Bitwise selection

2009-04-02 Thread Jiri

Thanks Hans,

I am aware of that, so if-else would be the only way to go I guess.

Jiri


Hans Wichman wrote:

Hi,

isn't the absence of break statements messing things up?

greetz
JC

On Thu, Apr 2, 2009 at 12:08 PM, Jiri jiriheitla...@googlemail.com wrote:


I am new to bitwise operators, so I am trying to learn it.

I have the following code and it works half. I am using a switch case to
get the result, but this is messing things up. I could revert to and if -
else statement, but I was wondering if there is a more elagant way of doing
it. I post my code below, and would have some advice.

var NO_RESTRICTION:int = 1;
var NUM_ONLY:int = 2;
var CHAR_ONLY:int = 4;

var RESTRICTION:int =  NUM_ONLY ;

function setInputCharRestriction(tInt:int):void {
   RESTRICTION = tInt | tInt2 | tInt3;
}

function getRestrict():String{
   var tRestrict:String = '';

   trace('all ' , Boolean(RESTRICTION1))
   trace('num ' , Boolean(RESTRICTION2))
   trace('char ' ,Boolean(RESTRICTION4))

   switch(RESTRICTION){
   case RESTRICTION1 :
   tRestrict +=\u0020-\u007E;
   trace('all')
   case RESTRICTION2:
   tRestrict = 0-9;
   trace('num')
   case RESTRICTION4:
   tRestrict = A-Z a-z;
   trace('char')
   }
   trace('restrict field ' , tRestrict)
   return tRestrict;
}

getRestrict()

Thank you.

Jiri
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Bitwise selection

2009-04-02 Thread jonathan howe
Jiri, I think Hans's advice will get you what you want.

   case RESTRICTION1 :
   tRestrict +=\u0020-\u007E;
   trace('all');
   break;
   case RESTRICTION2:
   tRestrict = 0-9;
   trace('num');
   break;
   case RESTRICTION4:
   tRestrict = A-Z a-z;
   trace('char');
   break;
I think there might be communication confusion.
On Thu, Apr 2, 2009 at 7:44 AM, Jiri jiriheitla...@googlemail.com wrote:

 Thanks Hans,

 I am aware of that, so if-else would be the only way to go I guess.

 Jiri



 Hans Wichman wrote:

 Hi,

 isn't the absence of break statements messing things up?

 greetz
 JC

 On Thu, Apr 2, 2009 at 12:08 PM, Jiri jiriheitla...@googlemail.com
 wrote:

 I am new to bitwise operators, so I am trying to learn it.

 I have the following code and it works half. I am using a switch case to
 get the result, but this is messing things up. I could revert to and if -
 else statement, but I was wondering if there is a more elagant way of
 doing
 it. I post my code below, and would have some advice.

 var NO_RESTRICTION:int = 1;
 var NUM_ONLY:int = 2;
 var CHAR_ONLY:int = 4;

 var RESTRICTION:int =  NUM_ONLY ;

 function setInputCharRestriction(tInt:int):void {
   RESTRICTION = tInt | tInt2 | tInt3;
 }

 function getRestrict():String{
   var tRestrict:String = '';

   trace('all ' , Boolean(RESTRICTION1))
   trace('num ' , Boolean(RESTRICTION2))
   trace('char ' ,Boolean(RESTRICTION4))

   switch(RESTRICTION){
   case RESTRICTION1 :
   tRestrict +=\u0020-\u007E;
   trace('all')
   case RESTRICTION2:
   tRestrict = 0-9;
   trace('num')
   case RESTRICTION4:
   tRestrict = A-Z a-z;
   trace('char')
   }
   trace('restrict field ' , tRestrict)
   return tRestrict;
 }

 getRestrict()

 Thank you.

 Jiri
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
-jonathan howe
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Proof of Concept - HTTPServiceobjectdoesn't requirecrossdomain-policy file

2009-04-02 Thread Paul Andrews
I think that my point was that the sandbox permissions for the projector are 
restricted to the machine it runs on and you need the policy file in place 
to go anywhere else.


I'm not saying Adobe did the right thing for projectors, just how it is.

Paul
- Original Message - 
From: Glen Pike g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:59 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPServiceobjectdoesn't 
requirecrossdomain-policy file




Projector sandbox can be set to local or network, but not both.

Paul Andrews wrote:
Looking at the flash player security model, a projector has a local 
security sandbox while a browser launched swf has a security sandbox that 
includes it's own domain, so this would explain why your projector would 
be restricted.


Paul
- Original Message - From: Paul Andrews p...@ipauland.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:36 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPServiceobjectdoesn't 
require crossdomain-policy file




Is this a projector or an AIR application?

Seems to me that if you say network only to an executable, it's like 
running it in a browser with no default domain, whereas an AIR 
application isn't restricted.


Paul
- Original Message - From: Glen Pike 
g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:26 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't 
require crossdomain-policy file



If that is the case then why is my standalone Flash exe restricted when 
I set it to allow network access only?


Paul Andrews wrote:
Isn't the context for an AIR application different to a flash 
application loaded from a browser?


In the browser the flash swf is loaded from a particular domain and 
access outside that domain requires the crossdomain policy.


In an Air application there is no concept of the domain that the swf 
is loaded from - it's essentially a desktop application.


Flash in Air and Flash in the browser have different security models.

Paul
- Original Message - From: Johan Nyberg 
johan.nyb...@webguidepartner.com

To: flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 9:29 AM
Subject: [Flashcoders] Proof of Concept - HTTPService object doesn't 
require crossdomain-policy file



Hi, thanks for all the response to my question about the 
crossdomain.xml. But... I didn't get a lot of response to the fact 
that HTTPService can access public feeds/content on other sites 
without the need of a crossdomain.xml


Please check out the code included at the end of this post. I've 
created a small AIR application (with a certificate) and it works 
without a problem.


Am I missing something?

But again.. if my Flash app isn't allowed to access content on 
another site, I can always throw together a simple php-script that 
extracts the content for me that my Flash then can read...


And then I can go ahead and create my evil banner ad. ;-)

I understand that crossdomain policy files are here to stay. I just 
don't understand why they don't allow me to access content on other 
domains that I can access in other ways and then pass on to Flash.


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't requirecrossdomain-policy file

2009-04-02 Thread Paul Andrews

Yes, that sounds tedious and frustrating.

Paul
- Original Message - 
From: Glen Pike g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:54 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't 
requirecrossdomain-policy file




Hi,

   It's an AS2 Flash application running standalone on Linux requesting 
stuff from the localhost on various ports - the irritating thing is I 
still have to implement x-domain files / responses on every port I connect 
to, I tried setting a policy server up on the default port as per the 
instructions on the devnet site, but this did not work..


   My point is that the standalone Flash application is an exe, like Air, 
so implies that a higher level of trust is required to run it, therefore 
it should be allowed more liberty than a browser based Flash app.  This 
is one of the most irritating things about doing standalone stuff - I 
can't load files from the file system because I am requesting over the 
network.  I am doing standalone because this is legacy stuff for a 
kiosk...


   Glen

Paul Andrews wrote:

Is this a projector or an AIR application?

Seems to me that if you say network only to an executable, it's like 
running it in a browser with no default domain, whereas an AIR 
application isn't restricted.


Paul
- Original Message - From: Glen Pike 
g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 10:26 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't 
require crossdomain-policy file



If that is the case then why is my standalone Flash exe restricted when 
I set it to allow network access only?


Paul Andrews wrote:
Isn't the context for an AIR application different to a flash 
application loaded from a browser?


In the browser the flash swf is loaded from a particular domain and 
access outside that domain requires the crossdomain policy.


In an Air application there is no concept of the domain that the swf is 
loaded from - it's essentially a desktop application.


Flash in Air and Flash in the browser have different security models.

Paul
- Original Message - From: Johan Nyberg 
johan.nyb...@webguidepartner.com

To: flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 9:29 AM
Subject: [Flashcoders] Proof of Concept - HTTPService object doesn't 
require crossdomain-policy file



Hi, thanks for all the response to my question about the 
crossdomain.xml. But... I didn't get a lot of response to the fact 
that HTTPService can access public feeds/content on other sites 
without the need of a crossdomain.xml


Please check out the code included at the end of this post. I've 
created a small AIR application (with a certificate) and it works 
without a problem.


Am I missing something?

But again.. if my Flash app isn't allowed to access content on another 
site, I can always throw together a simple php-script that extracts 
the content for me that my Flash then can read...


And then I can go ahead and create my evil banner ad. ;-)

I understand that crossdomain policy files are here to stay. I just 
don't understand why they don't allow me to access content on other 
domains that I can access in other ways and then pass on to Flash.


--
Johan Nyberg

Web Guide Partner
Engelbrektsplan 1
114 34 Stockholm
08 - 50 00 24 30
070 - 407 83 00
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Bitwise selection

2009-04-02 Thread Mark Winterhalder
Jiri,

if() isn't too bad, especially since you will possibly want to permit
multiple restrictions (like numbers /and/ letters, or Latin letters
plus umlauts). If you use if() and combine that with appending to the
restriction instead of setting it (+= instead of =), you gain
flexibility. That way, you could also split lower case and upper case
letter restrictions, and introduce a case insensitive restriction that
is set to (UPPER_CASE | LOWER_CASE) -- it would have both bits set, so
it would hit for both tests and append the restrictions to the a-z
A-Z  you already have now. That's just one example, the idea is not
to have a fixed number of selections, but groups that you can switch
on bit by bit, plus some predefined combinations (like the case
insensitive letter example) for convenience.

Also, don't test (restriction  2), but (restriction  NUM_ONLY). That
way, it's more readable, and you don't have to change all 2s if you
decide to reorder your flags. Even more pedantic :), test
((restriction  NUM_ONLY) == NUM_ONLY) so you don't run into problems
if you want to have flags that have multiple bits set later on.

 HTH,
Mark



On Thu, Apr 2, 2009 at 12:08 PM, Jiri jiriheitla...@googlemail.com wrote:
 I am new to bitwise operators, so I am trying to learn it.

 I have the following code and it works half. I am using a switch case to get
 the result, but this is messing things up. I could revert to and if - else
 statement, but I was wondering if there is a more elagant way of doing it. I
 post my code below, and would have some advice.

 var NO_RESTRICTION:int = 1;
 var NUM_ONLY:int = 2;
 var CHAR_ONLY:int = 4;

 var RESTRICTION:int =  NUM_ONLY ;

 function setInputCharRestriction(tInt:int):void {
        RESTRICTION = tInt | tInt2 | tInt3;
 }

 function getRestrict():String{
                var tRestrict:String = '';

                trace('all ' , Boolean(RESTRICTION1))
                trace('num ' , Boolean(RESTRICTION2))
                trace('char ' ,Boolean(RESTRICTION4))

                switch(RESTRICTION){
                        case RESTRICTION1 :
                                tRestrict +=\u0020-\u007E;
                                trace('all')
                        case RESTRICTION2:
                                tRestrict = 0-9;
                                trace('num')
                        case RESTRICTION4:
                                tRestrict = A-Z a-z;
                                trace('char')
                }
                trace('restrict field ' , tRestrict)
                return tRestrict;
 }

 getRestrict()

 Thank you.

 Jiri
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Bitwise selection

2009-04-02 Thread Jiri

Thanks for the helpfull feedback

Mark Winterhalder wrote:

Jiri,

if() isn't too bad, especially since you will possibly want to permit
multiple restrictions (like numbers /and/ letters, or Latin letters
plus umlauts). If you use if() and combine that with appending to the
restriction instead of setting it (+= instead of =), you gain
flexibility. That way, you could also split lower case and upper case
letter restrictions, and introduce a case insensitive restriction that
is set to (UPPER_CASE | LOWER_CASE) -- it would have both bits set, so
it would hit for both tests and append the restrictions to the a-z
A-Z  you already have now. That's just one example, the idea is not
to have a fixed number of selections, but groups that you can switch
on bit by bit, plus some predefined combinations (like the case
insensitive letter example) for convenience.

Also, don't test (restriction  2), but (restriction  NUM_ONLY). That
way, it's more readable, and you don't have to change all 2s if you
decide to reorder your flags. Even more pedantic :), test
((restriction  NUM_ONLY) == NUM_ONLY) so you don't run into problems
if you want to have flags that have multiple bits set later on.

 HTH,
Mark



On Thu, Apr 2, 2009 at 12:08 PM, Jiri jiriheitla...@googlemail.com wrote:

I am new to bitwise operators, so I am trying to learn it.

I have the following code and it works half. I am using a switch case to get
the result, but this is messing things up. I could revert to and if - else
statement, but I was wondering if there is a more elagant way of doing it. I
post my code below, and would have some advice.

var NO_RESTRICTION:int = 1;
var NUM_ONLY:int = 2;
var CHAR_ONLY:int = 4;

var RESTRICTION:int =  NUM_ONLY ;

function setInputCharRestriction(tInt:int):void {
   RESTRICTION = tInt | tInt2 | tInt3;
}

function getRestrict():String{
   var tRestrict:String = '';

   trace('all ' , Boolean(RESTRICTION1))
   trace('num ' , Boolean(RESTRICTION2))
   trace('char ' ,Boolean(RESTRICTION4))

   switch(RESTRICTION){
   case RESTRICTION1 :
   tRestrict +=\u0020-\u007E;
   trace('all')
   case RESTRICTION2:
   tRestrict = 0-9;
   trace('num')
   case RESTRICTION4:
   tRestrict = A-Z a-z;
   trace('char')
   }
   trace('restrict field ' , tRestrict)
   return tRestrict;
}

getRestrict()

Thank you.

Jiri
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] as3 rollover rolloff issue..

2009-04-02 Thread Preston Parris
So basically I have a bunch of thumbnail images set up in a grid form, each
is the same movieclip just multiple instances of it. This movie clip has a
rollover and rolloff state that basically scales the image up, this is done
with external as that loops through and creates the event listeners for each
one. If i roll over a movie clip and then roll off at normal speed,
everything works as intended, the old one scales down to normal size, and
then new one scales up. The issue comes when you quickly roll off and then
back on. The movieclip gets stuck in scaling down to about half way. Any
ideas on how to fix this? Also I dont want to remove all of the event
listeners for the other clips until it scales back down because it would
take away from the visual effect.

thank you!

-- 
Preston Parris
ppar...@modevisual.com
cell: 704.450.9299
www.modevisual.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] as3 rollover rolloff issue..

2009-04-02 Thread jonathan howe
Preston,

There are two possible issues:

1. The scaled image is overlapping other scaled images and messing up your
chain of events fired
2. The tween method you are using to scale is not being properly terminated
and restarted/triggered. (How are you scaling the images?)

I would start by putting a trace action on both my event handlers for each
image (maybe tracing image name/id # for clarity) and seeing what the output
is: if everything happens in the expected order then I would look towards
blaming #2.

-jonathan



On Thu, Apr 2, 2009 at 10:24 AM, Preston Parris prestonpar...@gmail.comwrote:

 So basically I have a bunch of thumbnail images set up in a grid form, each
 is the same movieclip just multiple instances of it. This movie clip has a
 rollover and rolloff state that basically scales the image up, this is done
 with external as that loops through and creates the event listeners for
 each
 one. If i roll over a movie clip and then roll off at normal speed,
 everything works as intended, the old one scales down to normal size, and
 then new one scales up. The issue comes when you quickly roll off and then
 back on. The movieclip gets stuck in scaling down to about half way. Any
 ideas on how to fix this? Also I dont want to remove all of the event
 listeners for the other clips until it scales back down because it would
 take away from the visual effect.

 thank you!

 --
 Preston Parris
 ppar...@modevisual.com
 cell: 704.450.9299
 www.modevisual.com
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
-jonathan howe
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Flashplayer positioning

2009-04-02 Thread Glen Pike

Hi,

   I have just setup FP10 in standalone on my Gentoo Linux box and am 
running a SWF from the command line in standalone mode.


   The x, y position of my SWF is all wrong - the SWF is positioned 
mostly off the screen.  Reverting to FP9 standalone it works fine.


   The SWF is compiled for AS2.

   Does anyone have any ideas about this??
  
   Ta


   Glen
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Bitwise selection

2009-04-02 Thread Kerry Thompson
Jiri has gotten some good answers. I got to work late today after working
until 11:30 last night meeting my 5:00 deadline :-P

 

I did occur to me that a fair number of us may not completely grok bitwise
stuff. That's computer science stuff, and a lot of us got here by other
routes-I see a lot of C programmers doing bitwise stuff, but relatively few
AS programmers (at least, we don't talk about it a lot). Still, it can be
blazingly fast, so when you have a need for speed, they are great.

 

So I thought I'd talk a little about bit operations. If you already
understand them, no need to read further (unless you wish to check my
accuracy).

 

First, the basics. We all probably know this, but a byte is no more than a
series of on-off switches, or bits--eight of them on most modern computers.
On is represented by 1, off by 0. So, a byte with every other bit on would
be 10101010.

 

When you do a bitwise operation, you are comparing bits. The bitwise OR
operator, | , compares bits. If either of them is on (1), the result is 1.
If both are off (0), the result is 0. Consider the following:

 

120 | 96

 

Compares 10101010 and 0110, giving the result 11101010 (234 decimal).
Visually, this may help:

 

10101010

0110



 

11101010 

 

We get that result because the | operator compares each bit. If either of
them is on, the result is 1 for that bit.

 

The AND operator  is similar in that it compares bit by bit, but both bits
have to be on to get a 1 result. Comparing the same two numbers as before,
120  96, gives you the result 0010, or 32 decimal.

 

10101010

0110



 

00101010 

 

Sometimes we use these as flags, where every bit can represent a Boolean
value. They also can be used for fast math operations (check out
http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/

 

This barely scratches the surface of bitwise operators and their power, but
I hope it intrigues some of you enough to pursue it further.

 

Cordially,

 

Kerry Thompson

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't requirecrossdomain-policy file

2009-04-02 Thread Muzak
I haven't really looked into the differences between standalone and AIR - haven't created a projector in years - but my guess is 
that because you have to install an AIR application (and are therefor informed/warned about the risks that entails) it is allowed to 
do more than a standalone executable (projector).


So basically there are 3 different player security models:
- Standalone
- AIR
- Browser plugin

Here's an article explaining the AIR security model:
http://www.adobe.com/devnet/air/articles/introduction_to_air_security.html

@Johan:

Please check out the code included at the end of this post. I've created a small AIR application (with a certificate) and it works 
without a problem.



Am I missing something?


Yes, as I explained earlier, this has nothing to do with HTTPService.
This is about different sandboxes: standalone, AIR and the browser.

regards,
Muzak

- Original Message - 
From: Glen Pike g...@engineeredarts.co.uk

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, April 02, 2009 11:54 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't 
requirecrossdomain-policy file



Hi,

   It's an AS2 Flash application running standalone on Linux requesting stuff from the localhost on various ports - the irritating 
thing is I still have to implement x-domain files / responses on every port I connect to, I tried setting a policy server up on 
the default port as per the instructions on the devnet site, but this did not work..


   My point is that the standalone Flash application is an exe, like Air, so implies that a higher level of trust is required to 
run it, therefore it should be allowed more liberty than a browser based Flash app.  This is one of the most irritating things 
about doing standalone stuff - I can't load files from the file system because I am requesting over the network.  I am doing 
standalone because this is legacy stuff for a kiosk...


   Glen



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flashplayer positioning

2009-04-02 Thread Joel Stransky
Is there any off-stage content that might be causing this?

On Thu, Apr 2, 2009 at 12:42 PM, Glen Pike g...@engineeredarts.co.ukwrote:

 Hi,

   I have just setup FP10 in standalone on my Gentoo Linux box and am
 running a SWF from the command line in standalone mode.

   The x, y position of my SWF is all wrong - the SWF is positioned mostly
 off the screen.  Reverting to FP9 standalone it works fine.

   The SWF is compiled for AS2.

   Does anyone have any ideas about this??
 Ta

   Glen
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Bitwise selection

2009-04-02 Thread Jiri

Nice, that you took the time to write that post. It is much appreciated.

Jiri

Kerry Thompson wrote:

Jiri has gotten some good answers. I got to work late today after working
until 11:30 last night meeting my 5:00 deadline :-P

 


I did occur to me that a fair number of us may not completely grok bitwise
stuff. That's computer science stuff, and a lot of us got here by other
routes-I see a lot of C programmers doing bitwise stuff, but relatively few
AS programmers (at least, we don't talk about it a lot). Still, it can be
blazingly fast, so when you have a need for speed, they are great.

 


So I thought I'd talk a little about bit operations. If you already
understand them, no need to read further (unless you wish to check my
accuracy).

 


First, the basics. We all probably know this, but a byte is no more than a
series of on-off switches, or bits--eight of them on most modern computers.
On is represented by 1, off by 0. So, a byte with every other bit on would
be 10101010.

 


When you do a bitwise operation, you are comparing bits. The bitwise OR
operator, | , compares bits. If either of them is on (1), the result is 1.
If both are off (0), the result is 0. Consider the following:

 


120 | 96

 


Compares 10101010 and 0110, giving the result 11101010 (234 decimal).
Visually, this may help:

 


10101010

0110



 

11101010 

 


We get that result because the | operator compares each bit. If either of
them is on, the result is 1 for that bit.

 


The AND operator  is similar in that it compares bit by bit, but both bits
have to be on to get a 1 result. Comparing the same two numbers as before,
120  96, gives you the result 0010, or 32 decimal.

 


10101010

0110



 

00101010 

 


Sometimes we use these as flags, where every bit can represent a Boolean
value. They also can be used for fast math operations (check out
http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/

 


This barely scratches the surface of bitwise operators and their power, but
I hope it intrigues some of you enough to pursue it further.

 


Cordially,

 


Kerry Thompson

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Bitwise selection

2009-04-02 Thread Kerry Thompson
Jiri wrote:

 Nice, that you took the time to write that post. It is much appreciated.

Thanks, Jiri.

One other thing worth mentioning is that an integer is actually 4 bytes, so
you have 32 bits. I kept my example to one byte for simplicity. If you want
to do operations on a single byte, you can use ByteArray elements.

Other bitwise operators to check out are XOR (exclusive OR, which means one
or the other is on, but not both) and shift operators  and  to check the
value of a particular bit.

Cordially,

Kerry Thompson

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flashplayer positioning

2009-04-02 Thread Glen Pike

Hi,

   There is stuff offstage, but I am not sure if it is in a guide layer 
or not - will check later.


   Why this would happen in FP10 and not 9 though??

   Glen

Joel Stransky wrote:

Is there any off-stage content that might be causing this?

On Thu, Apr 2, 2009 at 12:42 PM, Glen Pike g...@engineeredarts.co.ukwrote:

  

Hi,

  I have just setup FP10 in standalone on my Gentoo Linux box and am
running a SWF from the command line in standalone mode.

  The x, y position of my SWF is all wrong - the SWF is positioned mostly
off the screen.  Reverting to FP9 standalone it works fine.

  The SWF is compiled for AS2.

  Does anyone have any ideas about this??
Ta

  Glen
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






  


--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flashplayer positioning

2009-04-02 Thread Taka Kojima
not sure, maybe FP10 defaults to a different stage alignment. Maybe
try explicity stating the stage alignment and see if that fixes it.

- Taka

On Thu, Apr 2, 2009 at 11:16 AM, Glen Pike postmas...@glenpike.co.uk wrote:
 Hi,

   There is stuff offstage, but I am not sure if it is in a guide layer or
 not - will check later.

   Why this would happen in FP10 and not 9 though??

   Glen

 Joel Stransky wrote:

 Is there any off-stage content that might be causing this?

 On Thu, Apr 2, 2009 at 12:42 PM, Glen Pike
 g...@engineeredarts.co.ukwrote:



 Hi,

  I have just setup FP10 in standalone on my Gentoo Linux box and am
 running a SWF from the command line in standalone mode.

  The x, y position of my SWF is all wrong - the SWF is positioned mostly
 off the screen.  Reverting to FP9 standalone it works fine.

  The SWF is compiled for AS2.

  Does anyone have any ideas about this??
    Ta

  Glen
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders







 --

 Glen Pike
 01326 218440
 www.glenpike.co.uk http://www.glenpike.co.uk

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] id3 runtime error

2009-04-02 Thread Dave Segal
I have a bug that is driving me nuts. I am loading an mp3 file from the
same server as my swf. About 1 in 30 tries when trying to reading the id3
tags after the ID3 event I get a runtime error telling me I need to load
the crossdomain policy file in order to access the tags. I tried setting
the checkpolicyfile flag to true and placing a valid crossdomain.xml on
the server but the error occurs with the same frequency. 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] id3 runtime error

2009-04-02 Thread Taka Kojima
Hey Dave,

Can you paste the exact error message?

On Thu, Apr 2, 2009 at 4:51 PM, Dave Segal d...@oddcast.com wrote:
 I have a bug that is driving me nuts. I am loading an mp3 file from the
 same server as my swf. About 1 in 30 tries when trying to reading the id3
 tags after the ID3 event I get a runtime error telling me I need to load
 the crossdomain policy file in order to access the tags. I tried setting
 the checkpolicyfile flag to true and placing a valid crossdomain.xml on
 the server but the error occurs with the same frequency.

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] id3 runtime error

2009-04-02 Thread Joel Stransky

Are they id3 version 1 or 2?

--Joel

On Apr 2, 2009, at 7:51 PM, Dave Segal d...@oddcast.com wrote:

I have a bug that is driving me nuts. I am loading an mp3 file from  
the
same server as my swf. About 1 in 30 tries when trying to reading  
the id3
tags after the ID3 event I get a runtime error telling me I need to  
load
the crossdomain policy file in order to access the tags. I tried  
setting
the checkpolicyfile flag to true and placing a valid crossdomain.xml  
on

the server but the error occurs with the same frequency.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders