[Flashcoders] bitMapData - function optimization

2008-02-28 Thread Karim Beyrouti
Hello Hello, 

Just wondering if anyone has any tips or ideas on optimizing this function,
as its really slow.. Basically, it creates an inverted alpha mask from a
bitmap by going through every pixel in the bit map. 

Here is the function:

code

private function createInvertedMask() {

var w:Number = mask_bitmap.width;
var h:Number = mask_bitmap.height;

var r:Number = 0;
var c:Number = 0;
var v:Number;

for ( r = 0 ; r  w ; r++ ) {

for ( c = 0 ; c  h ; c++ ) {

v = mask_bitmap.getPixel32( r, c );

if ( v == 0 ) {

mask_bitmap.setPixel32( r, c ,
0xFF00  );

} else { 

mask_bitmap.setPixel32( r, c ,
0x  ); 

}
}
}

}

/code

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


[Flashcoders] Accessing SVN from JSFL

2008-02-28 Thread Jake Prime
Hi List

I am hoping to create a custom Flash panel which can interface with
Subversion. Is it possible to execute external apps, or command line
access from JSFL?

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


Re: [Flashcoders] Accessing SVN from JSFL

2008-02-28 Thread Dennis - I Sioux

Well you can call C++ apps.. so it's probably possible.
Just look in the help file :)

With kind regards,

Dennis


- Original Message - 
From: Jake Prime [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, February 28, 2008 12:04 PM
Subject: [Flashcoders] Accessing SVN from JSFL



Hi List

I am hoping to create a custom Flash panel which can interface with
Subversion. Is it possible to execute external apps, or command line
access from JSFL?

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

__ NOD32 2908 (20080228) Informatie __

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl



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


[Flashcoders] descriptor file probs stops AIR publish

2008-02-28 Thread dave matthews

Trying to use AIR,
 
  Wasted six hours yesterday.
 
  Tried tutorials, samples form the web, reinstalling updated player, 
uninstalling AIR upgrades, reinstalling AIR upgrades...  no luck finding - 
fixing - creating a 'descriptor file'  for any sort of tutorial or tutorials 
from the web...  
 
  What the heck is the problem - i can't be the only one having this problem - 
i hope.
 
  Why does Flash cs3 refuse to produce or use any 'descriptor file'???
 
sorry for the rant,
 
Dave Matthewshttp://www.2GoTo.com
_
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


R: [Flashcoders] Accessing SVN from JSFL

2008-02-28 Thread Fabio Prada
Hi
1 define a external service (executor) listening socket (es. twisted python)
2 manage the external service from flash using XML Socket

 


-Messaggio originale-
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Per conto di Jake Prime
Inviato: giovedì 28 febbraio 2008 12.04
A: Flash Coders List
Oggetto: [Flashcoders] Accessing SVN from JSFL

Hi List

I am hoping to create a custom Flash panel which can interface with
Subversion. Is it possible to execute external apps, or command line
access from JSFL?

Thanks
Jake
___
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] bitMapData - function optimization

2008-02-28 Thread EECOLOR
You could use the paletMap function or the threshold function of the
bitmapData object. Check the documentation for details.


Greetz Erik


On 2/28/08, Karim Beyrouti [EMAIL PROTECTED] wrote:

 Hello Hello,

 Just wondering if anyone has any tips or ideas on optimizing this
 function,
 as its really slow.. Basically, it creates an inverted alpha mask from a
 bitmap by going through every pixel in the bit map.

 Here is the function:

 code

 private function createInvertedMask() {

 var w:Number = mask_bitmap.width;
 var h:Number = mask_bitmap.height;

 var r:Number = 0;
 var c:Number = 0;
 var v:Number;

 for ( r = 0 ; r  w ; r++ ) {

 for ( c = 0 ; c  h ; c++ ) {

 v = mask_bitmap.getPixel32( r, c );

 if ( v == 0 ) {

 mask_bitmap.setPixel32( r, c ,
 0xFF00  );

 } else {

 mask_bitmap.setPixel32( r, c ,
 0x  );

 }
 }
 }

 }

 /code

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


Re: [Flashcoders] bitMapData - function optimization

2008-02-28 Thread Elia Morling

See this page and the comments below it. There is one about how to invert with 
the paletteMap function.

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=1962.html

Elia

- Original Message - 
From: EECOLOR [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, February 28, 2008 3:47 PM
Subject: Re: [Flashcoders] bitMapData - function optimization



You could use the paletMap function or the threshold function of the
bitmapData object. Check the documentation for details.


Greetz Erik


On 2/28/08, Karim Beyrouti [EMAIL PROTECTED] wrote:


Hello Hello,

Just wondering if anyone has any tips or ideas on optimizing this
function,
as its really slow.. Basically, it creates an inverted alpha mask from a
bitmap by going through every pixel in the bit map.

Here is the function:

code

private function createInvertedMask() {

var w:Number = mask_bitmap.width;
var h:Number = mask_bitmap.height;

var r:Number = 0;
var c:Number = 0;
var v:Number;

for ( r = 0 ; r  w ; r++ ) {

for ( c = 0 ; c  h ; c++ ) {

v = mask_bitmap.getPixel32( r, c );

if ( v == 0 ) {

mask_bitmap.setPixel32( r, c ,
0xFF00  );

} else {

mask_bitmap.setPixel32( r, c ,
0x  );

}
}
}

}

/code


___
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] External Interface + Google Analytics + IE7

2008-02-28 Thread Glen Pike

Hi,

   I have encountered a problem with an ExternalInterface.call causing 
IE7 to throw a JS error.


   I get an error message saying:
   Line: 1
   Char 14:
   Error: Expected ';'
   Code: 0;
   URL: http://www.dijitl.co.uk/beta/
  
   So, my guessing is that somewhere the ExternalInterface call is not 
adding a semi-colon, but that IE 7 maybe getting it's knickers in a 
twist.  Either way, it's annoying and my tracking is not working.  Can 
anyone shed light on this - I am using so.addParam(allowScriptAccess, 
always); with SWFObject too.
  
   Ta


   Glen

   AS code is like this:
  
   var page:String = evt.type.substr(5);
  
   if (ExternalInterface.available) {

   ExternalInterface.call (trackTesting, page);
   }

   Have also tried calling the pageTracker object directly - 
ExternalInterface.call(pageTracker._trackPageview, page); - but no joy.


   JS Code is like this:

   script type=text/javascript
   // ![CDATA[
   var pageTracker = _gat._getTracker(UA-DELETED);
   pageTracker._initData();
   pageTracker._trackPageview();
  
   function trackTesting(page) {

   alert(before  + page);
   pageTracker._trackPageview(page);
   alert(after);
   }
  
   // ]]

   /script
--

Glen Pike
01736 759321
www.glenpike.co.uk http://www.glenpike.co.uk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] getting SoundChannel out of a NetStream

2008-02-28 Thread Meinte van't Kruis
Hi Folks,

At the moment we have a project which loads in Mp3 from 2 different sources;

one is progressive  - We use the Sound class to Load this one
the other is streaming  - We use the NetStream class to load this one

We have a visual effect which listens to the volume and then reacts to it,
we use soundchannel for this.

_soundChannel=soundObject.play()

visualeffect.alpha=_soundChannel.rightPeak.

This all works peachy. IF I have a Sound object.

With the Netstream there doesn't seem to be any way to read any sound
properties(like rightPeak in Soundchannel), since there is no way extract a
soundchannel from a Netstream(which seems odd, doesn't it?)

So my question; Does anyone have any clue as to how to get a Sound object or
SoundChannel object from a Netstream (soundTransform is fairly useless,
it will only let us change the volume parameters, not read it)... Or is this
restricted with Netstream the same way we can't read pixels from a
netstreamed video?

thanks for any pointers!

-- 
M.A. van't Kruis
http://www.malatze.nl/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] bitMapData - function optimization

2008-02-28 Thread Karim Beyrouti
:-) thanks... however the problem with the invert function is that it does
not preserve the transparency. Which is what I am trying to invert ( I
should have been more specific ) . So I am trying to make all transparent
pixels non-transparent. And vice-versa... will keep looking at
paletMap/threshold as it looks like a good solution.

Regards


Karim

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Elia Morling
Sent: 28 February 2008 16:08
To: Flash Coders List
Subject: Re: [Flashcoders] bitMapData - function optimization

See this page and the comments below it. There is one about how to invert
with the paletteMap function.

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm
?context=LiveDocs_Partsfile=1962.html

Elia

- Original Message - 
From: EECOLOR [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, February 28, 2008 3:47 PM
Subject: Re: [Flashcoders] bitMapData - function optimization


 You could use the paletMap function or the threshold function of the
 bitmapData object. Check the documentation for details.
 
 
 Greetz Erik
 
 
 On 2/28/08, Karim Beyrouti [EMAIL PROTECTED] wrote:

 Hello Hello,

 Just wondering if anyone has any tips or ideas on optimizing this
 function,
 as its really slow.. Basically, it creates an inverted alpha mask from a
 bitmap by going through every pixel in the bit map.

 Here is the function:

 code

 private function createInvertedMask() {

 var w:Number = mask_bitmap.width;
 var h:Number = mask_bitmap.height;

 var r:Number = 0;
 var c:Number = 0;
 var v:Number;

 for ( r = 0 ; r  w ; r++ ) {

 for ( c = 0 ; c  h ; c++ ) {

 v = mask_bitmap.getPixel32( r, c );

 if ( v == 0 ) {

 mask_bitmap.setPixel32( r, c ,
 0xFF00  );

 } else {

 mask_bitmap.setPixel32( r, c ,
 0x  );

 }
 }
 }

 }

 /code

 ___
 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


-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.1/1302 - Release Date: 27/02/2008
16:34


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


Re: [Flashcoders] bitMapData - function optimization

2008-02-28 Thread Steven Sacks

maybe...

private function createInvertedMask()
{
   var r:int = mask_bitmap.width;

   var c:int = mask_bitmap.height;
   var v:int;

   while (--r -(-1))
   {
   while (--c -(-1))
   {
   v = mask_bitmap.getPixel32(r, c);
   mask_bitmap.setPixel32(r, c, v ? 0x : 0xFF00);
   }
   }
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] 3 questions

2008-02-28 Thread Stuart (FunkDaWeb)
1 - In AS3 is it possible to add a class to a dynamically loaded image? (like 
right clicking and viewing properties if it was in the library) If so can 
anyone point me to an example of how to go about it?

2 - Is there a simple way to convert text to a shape (break apart) using 
actionscript? (not using double break apart in flash)

3 - Does anyone have an idea how to fix this error... ArgumentError: Error 
#2015: Invalid BitmapData.

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


[Flashcoders] forceSmoothing in a MovieClipLoader

2008-02-28 Thread Matt S.
I'm finding that when I use forceSmoothing in a moviecliploader, it
doesnt seem to work. It turns it OFF just fine, but never turns it
back on afterwards. Just fyi, I already tried placing the
forceSmoothing = true in the onLoadInit and onLoadComplete's, just to
see if they'd work from there, but it never seemed to get turned back
on. See code below, can someone else see what I'm doing wrong? I know
setTimeout's aren't entirely reliable...

and yes this is still AS2... (le sigh)

thx,

.m


//Portfolio loader
myPMCL.onLoadStart = function(targetMC) {
//targetMC.forceSmoothing = false;
targetMC._alpha = 0;
trace(STARTING LOAD OF:  + targetMC);
_root.loadermain_mc._visible = true;
_root.loadermain_mc.bar_mc._xscale = 0;
};
myPMCL.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
_root.loadermain_mc.bar_mc._xscale = (loadedBytes/totalBytes)*100;

};
myPMCL.onLoadComplete = function(targetMC) {
_root.loadermain_mc._visible = false;
};
myPMCL.onLoadInit = function(targetMC) {
targetMC._rotation = 0;
resizePortfolio();
targetMC.alphaTo(100,1,easeInOutCubic);
_global.setTimeout(smoothingOn,2000,targetMC);

};
myPMCL.onLoadError = function(targetMC, errorCode) {
};

function smoothingOn(mc){
trace(TURNING SMOOTHING BACK ON FOR: +mc);
mc._parent.forceSmoothing = true;
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Border color change of UILoader

2008-02-28 Thread anuj sharma
Hi
Does anyone now how to change the border color of the UILoader component
when user clicks on that. I have put UILoader in the sprite container and i
need to implement that if user selects that UILoader its border color will
be changed (to red may be).
Please help me out . Here's the my dummy code for that. Basically what I
need is the border of  UILoader to be shown as soon as mousedown event is
generated and the border to hide as soon as mouseup event is generated.
Any help or any new idea will be highly appreciated.
Thanks
Anuj

/CODE**
var container:Sprite=new Sprite();
var myUILoader:UILoader = new UILoader();
myUILoader.source = XYZ.swf;
myUILoader.load();
container.addChild(myUILoader);
 addChild(container);

myUILoader.addEventListener(MouseEvent.MOUSE_DOWN,dragUILoader);
myUILoader.addEventListener(MouseEvent.MOUSE_UP,dropUILoader);
myUILoader.addEventListener(MouseEvent.CLICK, moveSelectedVideoOnFront);

function moveSelectedVideoOnFront(event:MouseEvent):void
{
//Brings selected UILoader on top
}
function dragUILoader(e:MouseEvent):void
{
//Allows dragging of the UILoader
}
function dropUILoader(e:MouseEvent):void
{
//Allows dropping of the UILoader
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] 3 questions

2008-02-28 Thread Jason Van Cleave
1. check out describetype
http://livedocs.adobe.com/flex/201/langref/flash/utils/package.html#describeType()

3. check for a width and height property of the bitmapdata to be greater
than 0 before using it

Heres a function i use but i also check if its too big to display

private function isValid(disp:DisplayObject):Boolean
{
var isValid:Boolean=false;
if(disp.width0  disp.width2880  disp.height0 
disp.height2880)
{
isValid=true;
}
trace(this, isValid, isValid);
return isValid;
}



On Thu, Feb 28, 2008 at 1:00 PM, Stuart (FunkDaWeb) [EMAIL PROTECTED]
wrote:

 1 - In AS3 is it possible to add a class to a dynamically loaded image?
 (like right clicking and viewing properties if it was in the library) If so
 can anyone point me to an example of how to go about it?

 2 - Is there a simple way to convert text to a shape (break apart) using
 actionscript? (not using double break apart in flash)

 3 - Does anyone have an idea how to fix this error... ArgumentError: Error
 #2015: Invalid BitmapData.

 Yours
 Stuart Moir
 ___
 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] forceSmoothing in a MovieClipLoader

2008-02-28 Thread Jason Van Cleave
Did the forceSmoothing ever make it in? I remember hearing about it but
never saw anything official

This workaround works well for static content

http://www.kaourantin.net/2005/12/dynamically-loading-bitmaps-with.html

On Thu, Feb 28, 2008 at 4:41 PM, Matt S. [EMAIL PROTECTED] wrote:

 I'm finding that when I use forceSmoothing in a moviecliploader, it
 doesnt seem to work. It turns it OFF just fine, but never turns it
 back on afterwards. Just fyi, I already tried placing the
 forceSmoothing = true in the onLoadInit and onLoadComplete's, just to
 see if they'd work from there, but it never seemed to get turned back
 on. See code below, can someone else see what I'm doing wrong? I know
 setTimeout's aren't entirely reliable...

 and yes this is still AS2... (le sigh)

 thx,

 .m


 //Portfolio loader
 myPMCL.onLoadStart = function(targetMC) {
//targetMC.forceSmoothing = false;
targetMC._alpha = 0;
trace(STARTING LOAD OF:  + targetMC);
_root.loadermain_mc._visible = true;
_root.loadermain_mc.bar_mc._xscale = 0;
 };
 myPMCL.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
_root.loadermain_mc.bar_mc._xscale = (loadedBytes/totalBytes)*100;

 };
 myPMCL.onLoadComplete = function(targetMC) {
_root.loadermain_mc._visible = false;
 };
 myPMCL.onLoadInit = function(targetMC) {
targetMC._rotation = 0;
resizePortfolio();
targetMC.alphaTo(100,1,easeInOutCubic);
_global.setTimeout(smoothingOn,2000,targetMC);

 };
 myPMCL.onLoadError = function(targetMC, errorCode) {
 };

 function smoothingOn(mc){
trace(TURNING SMOOTHING BACK ON FOR: +mc);
mc._parent.forceSmoothing = true;
 }
 ___
 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] 3 questions

2008-02-28 Thread Jason Van Cleave
doh - thats the function that I use before I try and draw an object - same
point tho

On Fri, Feb 29, 2008 at 1:05 AM, Jason Van Cleave [EMAIL PROTECTED]
wrote:

 1. check out describetype

 http://livedocs.adobe.com/flex/201/langref/flash/utils/package.html#describeType()http://livedocs.adobe.com/flex/201/langref/flash/utils/package.html#describeType%28%29

 3. check for a width and height property of the bitmapdata to be greater
 than 0 before using it

 Heres a function i use but i also check if its too big to display

 private function isValid(disp:DisplayObject):Boolean
 {
 var isValid:Boolean=false;
 if(disp.width0  disp.width2880  disp.height0 
 disp.height2880)
 {
 isValid=true;
 }
 trace(this, isValid, isValid);
 return isValid;

 }



 On Thu, Feb 28, 2008 at 1:00 PM, Stuart (FunkDaWeb) [EMAIL PROTECTED]
 wrote:

  1 - In AS3 is it possible to add a class to a dynamically loaded image?
  (like right clicking and viewing properties if it was in the library) If so
  can anyone point me to an example of how to go about it?
 
  2 - Is there a simple way to convert text to a shape (break apart) using
  actionscript? (not using double break apart in flash)
 
  3 - Does anyone have an idea how to fix this error... ArgumentError:
  Error #2015: Invalid BitmapData.
 
  Yours
  Stuart Moir
  ___
  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