Re: [Flashcoders] Shared variable scope between mxml and ActionScript classes

2008-09-30 Thread steve linabery
Ian,

Excellent explanation. Knowing that mxml files are really just class
files...well, it's like turning on a light. Thank you!

Incidentally, it turns out that
Application.application.myChart.graphics...etc. works fine as well. I
was copying the use of "Application(Application.application)" from the
Moock book, but in that case the author was *adding* components to the
new Application object. That makes sense, since Application always
lets one add children, but the compiler only "knows" that
"Application(Application.application)" is an Application, not whether
or not it possesses an instance variable called myChart.

Good day,
Steve


On Tue, Sep 30, 2008 at 7:30 PM, Ian Thomas <[EMAIL PROTECTED]> wrote:
> Hi Steve,
>
> It's because the MXML file myApp.mxml is equivalent to a class file.
>
> So what you're really saying is:
>
> myApp.as: (roughly translated from myApp.mxml, omitting imports)
> package
> {
>  public class myApp extends Application
>  {
>public var myChart:VBox;
>
>public function myApp()
>{
>   addEventListener(FlexEvent.APPLICATION_COMPLETE,onApplicationComplete);
>}
>
>override protected function createChildren():void
>{
>   super.createChildren();
>   var panel:Panel=new Panel();
>   addChild(panel);
>   myChart=new VBox();
>   panel.addChild(myChart);
>}
>
>private function onApplicationComplete(ev:FlexEvent):void
>{
>EntryClass.main();
>}
> }
>
> (incidentally, you can now see it's a class - it would have been
> better to name it MyApp.mxml)
>
> And, from your own code for EntryClass.as:
> package {
>  public class EntryClass {
>   public static function main():void {
> myChart.graphics.drawRect(100,100,100,100);
>   }
>  }
> }
>
>
> I hope you can see that when EntryClass.main() gets called, EntryClass
> has no reference to any property or function called 'myChart', because
> myChart is defined by (and contained in) myApp.as (which is
> automagically created from your own myApp.mxml file).
>
> You need to get at the myApp instance from within main(). So your idea
> about using Application.application is correct, just you weren't quite
> using it right.
>
> Your code was:
>
> var mxmlApp:Application = Application(Application.application);
> mxmlApp.myChart.graphics.drawRect(100,100,100,100);
>
> The trouble with this is that you are casting Application.application
> to the class Application. The Application class doesn't define any
> variable called myChart, so the compiler throws an error. However, the
> myApp class _does_, and you know that Application.application is
> actually returning a myApp. So the correct thing to do is to cast it
> to myApp, like so:
>
> var mxmlApp:myApp = myApp(Application.application);
> mxmlApp.myChart.graphics.drawRect(100,100,100,100);
>
> although actually in AS3 I prefer this syntax, because I think it's clearer:
>
> var mxmlApp:myApp = Application.application as myApp;
> mxmlApp.myChart.graphics.drawRect(100,100,100,100);
>
>
> Things to take away from this:
>
> - MXML files are just classes. That's all the Flex compiler does when
> it compiles an mxml file - turns it into an .as file, then compiles.
> You can actually set a compiler flag to look at the .as files that are
> generated.
> - You need to cast to the right class i.e. the class that defines the
> property or method you're trying to get at.
> - You can't 'magically' refer to properties (such as myChart) without
> having some reference to the thing that defines the property.
> - You should name your .mxml file starting with an uppercase, as it's
> really a class - it should be MyApp.
>
>
> I hope that helps, and is clear!
>
> Cheers,
>   Ian
>
>
> On Tue, Sep 30, 2008 at 7:09 PM, steve linabery <[EMAIL PROTECTED]> wrote:
>> Hello Flashcoders,
>>
>> Let's say I have two files, myApp.mxml:
>> 
>> http://www.adobe.com/2006/mxml";
>> applicationComplete="EntryClass.main()">
>>
>>  
>>
>> 
>>
>> and EntryClass.as:
>> package {
>>  public class EntryClass {
>>public static function main():void {
>>  myChart.graphics.drawRect(100,100,100,100);
>>}
>>  }
>> }
>>
>>
>> Why does "mxmlc myApp.mxml" complain with this error message:
>>
>>quote:
>>/path/to/EntryClass.as(4): col: 7 Error: Access of undefined
>> property myChart.
>>
>>myChart.graphics.drawRect(100,100,100,100);
>>^
>>
>> According to devguide_flex3.pdf:
>> "The IDs for all tags in an MXML component, no matter how deeply
>> nested they are, generate public variables of the component being
>> defined. As a result, all id properties must be unique within a
>> document. This also means that if you specified an ID for a component
>> instance, you can access that component from anywhere in the
>> application: from functions, external class files, imported
>> ActionScript files, or inline scripts."
>>
>> I thought perhaps this would work:
>> package {
>>  public class EntryClass {
>>public static function main():void {
>> 

Re: [Flashcoders] Shared variable scope between mxml and ActionScript classes

2008-09-30 Thread Ian Thomas
Hi Steve,

It's because the MXML file myApp.mxml is equivalent to a class file.

So what you're really saying is:

myApp.as: (roughly translated from myApp.mxml, omitting imports)
package
{
  public class myApp extends Application
  {
public var myChart:VBox;

public function myApp()
{
   addEventListener(FlexEvent.APPLICATION_COMPLETE,onApplicationComplete);
}

override protected function createChildren():void
{
   super.createChildren();
   var panel:Panel=new Panel();
   addChild(panel);
   myChart=new VBox();
   panel.addChild(myChart);
}

private function onApplicationComplete(ev:FlexEvent):void
{
EntryClass.main();
}
}

(incidentally, you can now see it's a class - it would have been
better to name it MyApp.mxml)

And, from your own code for EntryClass.as:
package {
 public class EntryClass {
   public static function main():void {
 myChart.graphics.drawRect(100,100,100,100);
   }
 }
}


I hope you can see that when EntryClass.main() gets called, EntryClass
has no reference to any property or function called 'myChart', because
myChart is defined by (and contained in) myApp.as (which is
automagically created from your own myApp.mxml file).

You need to get at the myApp instance from within main(). So your idea
about using Application.application is correct, just you weren't quite
using it right.

Your code was:

var mxmlApp:Application = Application(Application.application);
mxmlApp.myChart.graphics.drawRect(100,100,100,100);

The trouble with this is that you are casting Application.application
to the class Application. The Application class doesn't define any
variable called myChart, so the compiler throws an error. However, the
myApp class _does_, and you know that Application.application is
actually returning a myApp. So the correct thing to do is to cast it
to myApp, like so:

var mxmlApp:myApp = myApp(Application.application);
mxmlApp.myChart.graphics.drawRect(100,100,100,100);

although actually in AS3 I prefer this syntax, because I think it's clearer:

var mxmlApp:myApp = Application.application as myApp;
mxmlApp.myChart.graphics.drawRect(100,100,100,100);


Things to take away from this:

- MXML files are just classes. That's all the Flex compiler does when
it compiles an mxml file - turns it into an .as file, then compiles.
You can actually set a compiler flag to look at the .as files that are
generated.
- You need to cast to the right class i.e. the class that defines the
property or method you're trying to get at.
- You can't 'magically' refer to properties (such as myChart) without
having some reference to the thing that defines the property.
- You should name your .mxml file starting with an uppercase, as it's
really a class - it should be MyApp.


I hope that helps, and is clear!

Cheers,
   Ian


On Tue, Sep 30, 2008 at 7:09 PM, steve linabery <[EMAIL PROTECTED]> wrote:
> Hello Flashcoders,
>
> Let's say I have two files, myApp.mxml:
> 
> http://www.adobe.com/2006/mxml";
> applicationComplete="EntryClass.main()">
>
>  
>
> 
>
> and EntryClass.as:
> package {
>  public class EntryClass {
>public static function main():void {
>  myChart.graphics.drawRect(100,100,100,100);
>}
>  }
> }
>
>
> Why does "mxmlc myApp.mxml" complain with this error message:
>
>quote:
>/path/to/EntryClass.as(4): col: 7 Error: Access of undefined
> property myChart.
>
>myChart.graphics.drawRect(100,100,100,100);
>^
>
> According to devguide_flex3.pdf:
> "The IDs for all tags in an MXML component, no matter how deeply
> nested they are, generate public variables of the component being
> defined. As a result, all id properties must be unique within a
> document. This also means that if you specified an ID for a component
> instance, you can access that component from anywhere in the
> application: from functions, external class files, imported
> ActionScript files, or inline scripts."
>
> I thought perhaps this would work:
> package {
>  public class EntryClass {
>public static function main():void {
>  var mxmlApp:Application = Application(Application.application);
>  mxmlApp.myChart.graphics.drawRect(100,100,100,100);
>}
>  }
> }
>
> but mxmlc complains about this with:
> /path/to/EntryClass.as(7): col: 15 Error: Access of possibly undefined
> property myChart through a reference with static type
> mx.core:Application.
>
> Any suggestions appreciated!
>
> Thanks,
> Steve
> ___
> 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] Can URLLoader Open New Window Like LoadVars?

2008-09-30 Thread Glen Pike

Hi,

   I posted an answer to this yesterday -

   use navigateToURL

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/package.html#navigateToURL() 



With a URLRequest having the "method" variable set to POST and the 
window set to "_blank"


Not 100% sure, but you may run into problems with pop-up blocking.

   HTH

   Glen

Elia Morling wrote:

Any ideas?

thanks

- Original Message - From: "Elia Morling" <[EMAIL PROTECTED]>
To: "Flash Coders List" 
Sent: Monday, September 29, 2008 12:32 AM
Subject: [Flashcoders] Can URLLoader Open New Window Like LoadVars?


The LoadVars could specify a target to open a new window in AS2... 
Can we open a new window with URLLoader while making a POST operation?


Thanks
Elia ___
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




--

Glen Pike
01326 218440
www.glenpike.co.uk 

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


Re: [Flashcoders] Can URLLoader Open New Window Like LoadVars?

2008-09-30 Thread Elia Morling

Any ideas?

thanks

- Original Message - 
From: "Elia Morling" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Monday, September 29, 2008 12:32 AM
Subject: [Flashcoders] Can URLLoader Open New Window Like LoadVars?


The LoadVars could specify a target to open a new window in AS2... Can we 
open a new window with URLLoader while making a POST operation?


Thanks
Elia ___
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] Perlin Noise / Displacement

2008-09-30 Thread Glen Pike

Hi,

   I did a similar thing to generate fake clouds - in a monochrome 
colour...
  
   Just try generating your perlin noise as greyscale - like you are 
doing.  You should not need to do the displacement filter on it, but 
with this you can do "clouds", through to big chunky stuff.  The trick 
is to overlay your perlin noise on a background colour by setting the 
blend mode to screen...


   Then if you want you can adjust the brightness and contrast of your 
bitmap, then finally, apply a threshold to it...
  
   Something like below:


   import flash.display.BitmapData;
import flash.geom.Point;
import flash.filters.*;
Stage.scaleMode="noScale";
// Perlin noise variables
var baseX  :Number = Stage.width / 4;
var baseY  :Number = Stage.height / 2;
var nOctaves   :Number = 6;
var randomSeed :Number = Math.random()*82;
var bStitch :Boolean = false;
var bFractalNoise  :Boolean = true;
var nChannels  :Number = 1;
var bGreyScale  :Boolean= true;

   // Offset array for perlin function
   var p1 = new Point(45, 34);
   var p2 = new Point(50, 60);
   var fltPt = new Point(0, 0);
   var fltRect = new Rectangle(0, 0, Stage.width, Stage.height);

   perlinOffset = new Array(p1, p2);


   var bg:MovieClip = _root.createEmptyMovieClip("bg", 
_root.getNextHighestDepth());
   bg.beginFill(0xFF);//Set this to whatever colour you want your 
chrome..

   bg.lineTo(Stage.width, 0);
   bg.lineTo(Stage.width, Stage.height);
   bg.lineTo(0, Stage.height);
   bg.lineTo(0, 0);
   bg.endFill();

   var holder:MovieClip = _root.createEmptyMovieClip("holder", 2);
   //You have a background colour underneath your perlin noise, which 
is white...

   //holder.blendMode = "screen";

   var cloudint = setInterval(animClouds, 1000/24);
  
   function animClouds() {

   //change the values in the perlinOffset to animate each perlin layer
   perlinOffset[0].y+=0.5;
   perlinOffset[0].x+=1;
   perlinOffset[1].x-=0.5;
   perlinOffset[1].y-=0.25;
   //apply perlin noise to our bitmapdata
   bmp.perlinNoise(baseX, baseY, nOctaves, randomSeed, bStitch, 
bFractalNoise, nChannels, bGreyScale, perlinOffset);

  //
   //Uncomment the following line to see the generated perlin noise
   _root.holder.attachBitmap(bmp, 1, "auto", true);
  
   //Contrast

   var cont = 3.4;
   var contMtx:Array =  Array(cont,0,0,0,128*(1-cont),
   0,cont,0,0,128*(1-cont),
   0,0,cont,0,128*(1-cont),
  0,0,0,1,0);
  
   //Brightness

   var brght = -20;
   var brghtMtx:Array =  Array(1,0,0,0,brght,
   0,1,0,0,brght ,
   0,0,1,0,brght ,
  0,0,0,1,0 );
   
  
   var contFlt = new ColorMatrixFilter(contMtx);

   var brghtFlt = new ColorMatrixFilter(brghtMtx);
   //bmp.applyFilter(bmp, bmp.rectangle, fltPoint, contFlt);
   //bmp.applyFilter(bmp, bmp.rectangle, fltPoint, brghtFlt);
   //Harsh threshold filtering...
   //bmp.threshold(bmp,bmp.rectangle,new Point(0, 
0),"<",0x006f6f6f,0x,0x00FF);
  



   function animClouds() {
   //change the values in the perlinOffset to animate each perlin layer
   perlinOffset[0].y+=0.5;
   perlinOffset[0].x+=1;
   perlinOffset[1].x-=0.5;
   perlinOffset[1].y-=0.25;
   //apply perlin noise to our bitmapdata
   bmp.perlinNoise(baseX, baseY, nOctaves, randomSeed, bStitch, 
bFractalNoise, nChannels, bGreyScale, perlinOffset);

  //
   //Uncomment the following line to see the generated perlin noise
   _root.holder.attachBitmap(bmp, 1, "auto", true);
  
   //Contrast

   var cont = 3.4;
   var contMtx:Array =  Array(cont,0,0,0,128*(1-cont),
   0,cont,0,0,128*(1-cont),
   0,0,cont,0,128*(1-cont),
  0,0,0,1,0);
  
   //Brightness

   var brght = -20;
   var brghtMtx:Array =  Array(1,0,0,0,brght,
   0,1,0,0,brght ,
   0,0,1,0,brght ,
  0,0,0,1,0 );
   
  
   var contFlt = new ColorMatrixFilter(contMtx);

   var brghtFlt = new ColorMatrixFilter(brghtMtx);
   //bmp.applyFilter(bmp, bmp.rectangle, fltPoint, contFlt);
   //bmp.applyFilter(bmp, bmp.rectangle, fltPoint, brghtFlt);
   //Harsh threshold filtering...
   //bmp.threshold(bmp,bmp.rectangle,new Point(0, 
0),"<",0x006f6f6f,0x,0x00FF);

}



  


Karim Beyrouti wrote:

Hello groovy list...

I am trying to generate a chrome effect by applying a displacement map to
Bitmap.
The Displacement map is generated from perlin noise, and the target is a
single colour filled bitmap. 
However it's not working with the single colour filled bitmap 
(I think it's because there is nothing to displace).


Maybe I am approaching this all wrong, and would appreciate any thoughts. 


Here is my test code so far:




Re: [Flashcoders] Shared variable scope between mxml and ActionScriptclasses

2008-09-30 Thread Paul Andrews


- Original Message - 
From: "steve linabery" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, September 30, 2008 7:09 PM
Subject: [Flashcoders] Shared variable scope between mxml and 
ActionScriptclasses




Hello Flashcoders,

Let's say I have two files, myApp.mxml:

http://www.adobe.com/2006/mxml";
applicationComplete="EntryClass.main()">
   
 
   


and EntryClass.as:
package {
 public class EntryClass {
   public static function main():void {
 myChart.graphics.drawRect(100,100,100,100);
   }
 }
}


Why does "mxmlc myApp.mxml" complain with this error message:

   quote:
   /path/to/EntryClass.as(4): col: 7 Error: Access of undefined
property myChart.

   myChart.graphics.drawRect(100,100,100,100);
   ^


Because classes are self contained. There is no notion that any class can 
access any variable outside the class unless there is a direct reference to 
it via a static reference or a parameter. EntryClass has no default access 
to the application.


You can probably do what you want by referring to 
Application.application.myChart...


This is also best asked on flexcoders..

Paul



Any suggestions appreciated!

Thanks,
Steve


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


Re: [Flashcoders] Shared variable scope between mxml and ActionScript classes

2008-09-30 Thread Glen Pike

Hi,

   Here is my 2c

   EntryClass.main is a static function, but you cannot guarantee that 
mxml is going to compile your chart to a static variable - you can't 
access non-static variables from a static function if I remember rightly...


   What you probably want to do here, which would be a lot cleaner is 
to create a new component in mxml or ActionScript that extends the VBox 
component.  This would have an applicationComplete event handler that 
did the drawing, very quickly:


Here is the MXML file for your component - right click in the project 
folder and create a new MXML  Component if you are in FlexBuilder, make 
sure it extends VBox and give it a name - MyChart or something, then 
edit the source:



http://www.adobe.com/2006/mxml"; width="400" height="300">
   
   

   



If you put the component in the top level folder - same as your App 
file, then you don't have to create another namespace.  If you put it in 
a folder, then you have to make a "namespace" for that to include it in 
your App.  The code above is stored in a folder called views, so you add 
the extra attribute to the opening tag xmlns:views="views.*"


Then in your App, do the same to put your namespace in scope:


	xmlns:mx="http://www.adobe.com/2006/mxml";

xmlns:views="views.*"
applicationComplete="EntryClass.main()">
   
 
   


Then that should be a bit neater - I would check out the video tutorials around 
for doing this stuff in Flex, there are some really good ones that got me 
started.

HTH

Glen



steve linabery wrote:

Hello Flashcoders,

Let's say I have two files, myApp.mxml:

http://www.adobe.com/2006/mxml";
applicationComplete="EntryClass.main()">

  



and EntryClass.as:
package {
  public class EntryClass {
public static function main():void {
  myChart.graphics.drawRect(100,100,100,100);
}
  }
}


Why does "mxmlc myApp.mxml" complain with this error message:

quote:
/path/to/EntryClass.as(4): col: 7 Error: Access of undefined
property myChart.

myChart.graphics.drawRect(100,100,100,100);
^

According to devguide_flex3.pdf:
"The IDs for all tags in an MXML component, no matter how deeply
nested they are, generate public variables of the component being
defined. As a result, all id properties must be unique within a
document. This also means that if you specified an ID for a component
instance, you can access that component from anywhere in the
application: from functions, external class files, imported
ActionScript files, or inline scripts."

I thought perhaps this would work:
package {
  public class EntryClass {
public static function main():void {
  var mxmlApp:Application = Application(Application.application);
  mxmlApp.myChart.graphics.drawRect(100,100,100,100);
}
  }
}

but mxmlc complains about this with:
/path/to/EntryClass.as(7): col: 15 Error: Access of possibly undefined
property myChart through a reference with static type
mx.core:Application.

Any suggestions appreciated!

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


  


--

Glen Pike
01326 218440
www.glenpike.co.uk 

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


[Flashcoders] Shared variable scope between mxml and ActionScript classes

2008-09-30 Thread steve linabery
Hello Flashcoders,

Let's say I have two files, myApp.mxml:

http://www.adobe.com/2006/mxml";
applicationComplete="EntryClass.main()">

  



and EntryClass.as:
package {
  public class EntryClass {
public static function main():void {
  myChart.graphics.drawRect(100,100,100,100);
}
  }
}


Why does "mxmlc myApp.mxml" complain with this error message:

quote:
/path/to/EntryClass.as(4): col: 7 Error: Access of undefined
property myChart.

myChart.graphics.drawRect(100,100,100,100);
^

According to devguide_flex3.pdf:
"The IDs for all tags in an MXML component, no matter how deeply
nested they are, generate public variables of the component being
defined. As a result, all id properties must be unique within a
document. This also means that if you specified an ID for a component
instance, you can access that component from anywhere in the
application: from functions, external class files, imported
ActionScript files, or inline scripts."

I thought perhaps this would work:
package {
  public class EntryClass {
public static function main():void {
  var mxmlApp:Application = Application(Application.application);
  mxmlApp.myChart.graphics.drawRect(100,100,100,100);
}
  }
}

but mxmlc complains about this with:
/path/to/EntryClass.as(7): col: 15 Error: Access of possibly undefined
property myChart through a reference with static type
mx.core:Application.

Any suggestions appreciated!

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


Re: [Flashcoders] Is it possible to create duplicate event listeners?

2008-09-30 Thread Paul Andrews
Would be really easy to find out by adding two identical event listeners to 
a button. I'd expect it to be called twice.


- Original Message - 
From: "ben gomez farrell" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Tuesday, September 30, 2008 6:23 PM
Subject: [Flashcoders] Is it possible to create duplicate event listeners?



Hi all,
I'm curious if I need to clean up my event listeners before adding a 
duplicate one.

For example if I have an initialization routine

function init():void {
   addEventListener( Event.SomeEvent, $somehandler, false, 0, true );
   // some other stuff that builds the app/game
}

If I finish up what I'm doing and want to re-initialize my game or 
application, should I clean up my event listener before I add the exact 
same one?


So another way to ask this is if I do:

addEventListener( Event.SomeEvent, $somehandler, false, 0, true );
addEventListener( Event.SomeEvent, $somehandler, false, 0, true );

Do I have 2 event listeners at this point, or just one?  Is it smart 
enough to not add an identical one?


thanks!
ben
___
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] Is it possible to create duplicate event listeners?

2008-09-30 Thread ben gomez farrell

Hi all,
I'm curious if I need to clean up my event listeners before adding a 
duplicate one.

For example if I have an initialization routine

function init():void {
   addEventListener( Event.SomeEvent, $somehandler, false, 0, true );
   // some other stuff that builds the app/game
}

If I finish up what I'm doing and want to re-initialize my game or 
application, should I clean up my event listener before I add the exact 
same one?


So another way to ask this is if I do:

addEventListener( Event.SomeEvent, $somehandler, false, 0, true );
addEventListener( Event.SomeEvent, $somehandler, false, 0, true );

Do I have 2 event listeners at this point, or just one?  Is it smart 
enough to not add an identical one?


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


[Flashcoders] Perlin Noise / Displacement

2008-09-30 Thread Karim Beyrouti
Hello groovy list...

I am trying to generate a chrome effect by applying a displacement map to
Bitmap.
The Displacement map is generated from perlin noise, and the target is a
single colour filled bitmap. 
However it's not working with the single colour filled bitmap 
(I think it's because there is nothing to displace).

Maybe I am approaching this all wrong, and would appreciate any thoughts. 

Here is my test code so far:




import flash.filters.DisplacementMapFilter;
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Matrix;
import flash.geom.ColorTransform;

var mapBitmap:BitmapData = new BitmapData ( Stage.width, Stage.height,
false, 0x00 );
mapBitmap.perlinNoise(100, 100, 10 , 10 , false, false,1 , true,
null );

var filter:DisplacementMapFilter = new DisplacementMapFilter(mapBitmap, new
Point(0, 0),4|8, 4|8, 100, 100, "wrap", .25, .25);

var dBitmap:BitmapData =  new BitmapData ( Stage.width, Stage.height, false,
0x66 );
attachBitmap( dBitmap, 10 );
dBitmap.applyFilter( dBitmap, dBitmap.rectangle,new Point( 0, 0 ),
filter );




P.s. This targets AS2 / FP8



Kind regards



Karim

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


Re: [Flashcoders] FLV generation from jpg sequence?

2008-09-30 Thread Piers Cowburn

HTH


On 30 Sep 2008, at 10:37, Wenzler, Thomas wrote:


Thank you, Piers,
That might be it...just googled an article on how to maybe do exactly
what I want. Thanks a lot for the hint.

Regards
Thomas

--

Message: 28
Date: Tue, 30 Sep 2008 10:12:23 +0100
From: Piers Cowburn <[EMAIL PROTECTED]>
Subject: Re: [Flashcoders] FLV generation from jpg sequence?
To: Flash Coders List 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;   charset=US-ASCII;   delsp=yes;
format=flowed

It's certainly possible, what server set up are you using? On Red5
you could do it with FFmpeg, I believe.

Piers


On 30 Sep 2008, at 09:51, Wenzler, Thomas wrote:


Hi to everyone on the List,
I was asked if it was possible to (preferably serverside)
generate .flv
movies from a sequence of .jpgs. Is that possible? Any hint in the
right
direction is highly appreciated...
Thanks in advance for all your efforts and excuse me if this is
off-topic... :)

Thomas

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


[EMAIL PROTECTED]
0207 631 3278




--

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


End of Flashcoders Digest, Vol 12, Issue 19
***

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


[EMAIL PROTECTED]
0207 631 3278


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


Re: [Flashcoders] FLV generation from jpg sequence?

2008-09-30 Thread Wenzler, Thomas
Thank you, Piers,
That might be it...just googled an article on how to maybe do exactly
what I want. Thanks a lot for the hint.

Regards
Thomas
 
--

Message: 28
Date: Tue, 30 Sep 2008 10:12:23 +0100
From: Piers Cowburn <[EMAIL PROTECTED]>
Subject: Re: [Flashcoders] FLV generation from jpg sequence?
To: Flash Coders List 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;   charset=US-ASCII;   delsp=yes;
format=flowed

It's certainly possible, what server set up are you using? On Red5  
you could do it with FFmpeg, I believe.

Piers


On 30 Sep 2008, at 09:51, Wenzler, Thomas wrote:

> Hi to everyone on the List,
> I was asked if it was possible to (preferably serverside)  
> generate .flv
> movies from a sequence of .jpgs. Is that possible? Any hint in the  
> right
> direction is highly appreciated...
> Thanks in advance for all your efforts and excuse me if this is
> off-topic... :)
>
> Thomas
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

[EMAIL PROTECTED]
0207 631 3278




--

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


End of Flashcoders Digest, Vol 12, Issue 19
***

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


Re: [Flashcoders] FLV generation from jpg sequence?

2008-09-30 Thread Piers Cowburn
It's certainly possible, what server set up are you using? On Red5  
you could do it with FFmpeg, I believe.


Piers


On 30 Sep 2008, at 09:51, Wenzler, Thomas wrote:


Hi to everyone on the List,
I was asked if it was possible to (preferably serverside)  
generate .flv
movies from a sequence of .jpgs. Is that possible? Any hint in the  
right

direction is highly appreciated...
Thanks in advance for all your efforts and excuse me if this is
off-topic... :)

Thomas

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


[EMAIL PROTECTED]
0207 631 3278


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


[Flashcoders] FLV generation from jpg sequence?

2008-09-30 Thread Wenzler, Thomas
Hi to everyone on the List,
I was asked if it was possible to (preferably serverside) generate .flv
movies from a sequence of .jpgs. Is that possible? Any hint in the right
direction is highly appreciated...
Thanks in advance for all your efforts and excuse me if this is
off-topic... :)

Thomas

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