Re: [Flashcoders] fisheye dislpacement

2009-09-11 Thread Hans Wichman
Hi,
maybe this will help;
http://www.unitzeroone.com/blog/2005/10/26/2-new-flash-8-examples-displace-smoke-displacement-spheres-source/
it's as2 but the id is the same.

hth
JC

On Thu, Sep 10, 2009 at 4:58 PM, Mendelsohn, Michael 
michael.mendels...@fmglobal.com wrote:

 Hi list...

 I'm trying to render a spherical earth using a DisplacementMapFilter out of
 a flat movieclip of the landmasses but it isn't working too well for me.
  Any suggestions?  I'd appreciate hearing any ideas.

 Thanks,
 - Michael M.

 private function renderOrnament():Sprite{
var makeCirc:Function = function(isFront:Boolean, diam:uint):Shape{
// used for masks and displacement
var c:Shape = new Shape();
var m:Matrix = new Matrix();
m.createGradientBox(diam,diam);
var colors:Array = (isFront !=
 true)?[0xFF,0x00]:[0x00,0xFF];
c.graphics.beginGradientFill(GradientType.RADIAL,
 colors,[1,1],[0,255],m);
c.graphics.drawEllipse(0,0,diam,diam);
c.graphics.endFill();
return c;
}
// container
var orn:Sprite = new Sprite();
// front hemisphere
var fh:Sprite = new Sprite();
orn.addChild(fh);
// front world (World is a mc of all the continents)
frontWorld = new World();
fh.addChild(frontWorld);
// front world mask
var circleMask:Shape = makeCirc(true,200);
fh.addChild(circleMask);
frontWorld.mask = circleMask;
// front world displacement
fh.filters = [new DisplacementMapFilter(new BitmapData(200,200), new
 Point(0,0), 1, 1,75, 75, DisplacementMapFilterMode.IGNORE, 1,0)];
return orn;
 }



 ___
 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] fisheye dislpacement

2009-09-11 Thread Mendelsohn, Michael
Thanks for the link Hans.  That's exactly what I was looking for.  I think I 
figured out the issue I was having.  In the DisplacementMapFilter constructor, 
you have to assign color channels for it to displace along x and y, and I was 
setting the displacement map to a black and white gradient.  When I created a 
red/green gradient, it worked.

Unfortunately, I can't download the zip source on that page.  :-/

Regards,
- Michael M.

 maybe this will help;
http://www.unitzeroone.com/blog/2005/10/26/2-new-flash-8-examples-displace-smoke-displacement-spheres-source/
it's as2 but the id is the same.

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


RE: [Flashcoders] Access dynamically created MovieClip from class?

2009-09-11 Thread Cor
var drawingSign:Movieclip = new MovieClip(); //you forgot the w of new
drawingSign.x = 40;
drawingSign.y = 40;
drawingSign.addEventListener(MouseEvent.CLICK, mc_clicked);
addChild(drawingSign);

private function mc_clicked(e:MouseEvent):void{
trace(You have clicked drawingSign);
}


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of ktt
Sent: vrijdag 11 september 2009 15:40
To: Flash Coders List
Subject: [Flashcoders] Access dynamically created MovieClip from class?

Hello,

I have created Movieclip in main actionscript file main.as :

var drawingSign:Movieclip = ne MovieClip();
drawingSign.x = 40;
drawingSign.y = 40;

How could I access it (add listeners etc.) from a class file?
Is it possible?

Thank you in advance,
kioshin


  
___
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] Access dynamically created MovieClip from class?

2009-09-11 Thread ktt
Thank you the answer, but maybe I didn't define situation clearly:

I have two separate files main.as and classdraw.as

Movieclip is defined in main.as:

var drawingSign:Movieclip = new MovieClip();
drawingSign.x = 40;
drawingSign.y = 40;
//drawingSign.addEventListener(MouseEvent.CLICK,mc_clicked);
addChild(drawingSign);

I want to access drawingSign from my other classdraw.as file:

package (

import flash.events.*;
import flash.display.*;
import flash.utils.*; 

public class classdraw extends MovieClip {

private var newSign:drawingSign = new drawingSign(); // as it is used to access 
objects from Library

public function classdraw() {

addChild (newSign);

}

But I geting errors :
1046: Type was not found or was not a compile-time constant: drawingSign.
1180; Call to a possibly undefined method drawingSign.

Regards,
Kioshin

--- On Fri, 9/11/09, Cor c...@chello.nl wrote:

 From: Cor c...@chello.nl
 Subject: RE: [Flashcoders] Access dynamically created MovieClip from class?
 To: 'Flash Coders List' flashcoders@chattyfig.figleaf.com
 Date: Friday, September 11, 2009, 4:58 PM
 var drawingSign:Movieclip = new
 MovieClip(); //you forgot the w of new
 drawingSign.x = 40;
 drawingSign.y = 40;
 drawingSign.addEventListener(MouseEvent.CLICK,
 mc_clicked);
 addChild(drawingSign);
 
 private function mc_clicked(e:MouseEvent):void{
     trace(You have clicked drawingSign);
 }
 
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com]
 On Behalf Of ktt
 Sent: vrijdag 11 september 2009 15:40
 To: Flash Coders List
 Subject: [Flashcoders] Access dynamically created MovieClip
 from class?
 
 Hello,
 
 I have created Movieclip in main actionscript file main.as
 :
 
 var drawingSign:Movieclip = ne MovieClip();
 drawingSign.x = 40;
 drawingSign.y = 40;
 
 How could I access it (add listeners etc.) from a class
 file?
 Is it possible?
 
 Thank you in advance,
 kioshin
 
 
       
 ___
 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] time based smooth animation w/ GTween. HELP!

2009-09-11 Thread Isaac Alves
Hello!

I would like to create a time based and very smooth animation with
GTween (or another one).
But I´m used to GTween , though.

here is my code:

var plantaTween = new GTween(planta, 1.5, {y: 414}, {delay: 0.8,
reversed: true, reflect: true, repeat: 999, ease:Quartic.easeInOut});

I´ve read the following examples in Gtween´s documentation and
somewhere else but i can-t quite understand it ..

 GTween.timingMode = GTween.TIME;

at http://www.gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html

should I use:
  plantaTween.timingMode = GTween.TIME;
or:
  GTween.timingMode = GTween.TIME; ?

What does the latter exactly means? it doesn´t do nothing. maybe cause
the default timeInterval property is 25ms. how do i set it ?

the first one throws a reference error Error #1056:

and i-ve seen this also at the documentation
http://www.gskinner.com/libraries/gtween/docs/

 Implementation
 public static function get timeInterval():uint
 public function set timeInterval(value:uint):void

 Implementation
 public static function get timingMode():String
 public function set timingMode(value:String):void

but cannot figure out how to implement it...

help ! thanks !

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


RE: [Flashcoders] Access dynamically created MovieClip from class?

2009-09-11 Thread Merrill, Jason
Not sure what you are trying to accomplish in what you are building (because I 
am suspicious your architectural approach may be a bit off - maybe), but to 
just answer your question, in the Main class, define the drawingSign Movie clip 
as a public variable like this:

package
{
import flash.display.MovieClip;

public class Main
{
//define it as public here:
public var drawingSign:MovieClip;

public function Main():void
{
//create it here:
drawingSign = new MovieClip();
//blah blah more code here.
}
}
}

Then, in your other class ClassDraw, import Main and create an instance of it:

package
{
import flash.display.MovieClip;
import Main; 

public class ClassDraw extends MovieClip
{
private var _main:Main;

public function ClassDraw():void
{
//create an instance of Main:
_main = new Main();
//access the MovieClip you want in the other class:
trace(_main.drawingSign)
//blah blah more code here.
}
}
}


Jason Merrill 

Bank of  America   Global Learning 
Learning  Performance Soluions

Monthly meetings on making the most of the Adobe Flash Platform - presented by 
bank associates, Adobe engineers, and outside experts in the borader multimedia 
community - join the Bank of America Flash Platform Community  (note: this is 
for Bank of America employees only)




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of ktt
Sent: Friday, September 11, 2009 10:25 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Access dynamically created MovieClip from class?

Thank you the answer, but maybe I didn't define situation clearly:

I have two separate files main.as and classdraw.as

Movieclip is defined in main.as:

var drawingSign:Movieclip = new MovieClip();
drawingSign.x = 40;
drawingSign.y = 40;
//drawingSign.addEventListener(MouseEvent.CLICK,mc_clicked);
addChild(drawingSign);

I want to access drawingSign from my other classdraw.as file:

package (

import flash.events.*;
import flash.display.*;
import flash.utils.*; 

public class classdraw extends MovieClip {

private var newSign:drawingSign = new drawingSign(); // as it is used to access 
objects from Library

public function classdraw() {

addChild (newSign);

}

But I geting errors :
1046: Type was not found or was not a compile-time constant: drawingSign.
1180; Call to a possibly undefined method drawingSign.

Regards,
Kioshin

--- On Fri, 9/11/09, Cor c...@chello.nl wrote:

 From: Cor c...@chello.nl
 Subject: RE: [Flashcoders] Access dynamically created MovieClip from class?
 To: 'Flash Coders List' flashcoders@chattyfig.figleaf.com
 Date: Friday, September 11, 2009, 4:58 PM
 var drawingSign:Movieclip = new
 MovieClip(); //you forgot the w of new
 drawingSign.x = 40;
 drawingSign.y = 40;
 drawingSign.addEventListener(MouseEvent.CLICK,
 mc_clicked);
 addChild(drawingSign);
 
 private function mc_clicked(e:MouseEvent):void{
     trace(You have clicked drawingSign);
 }
 
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com]
 On Behalf Of ktt
 Sent: vrijdag 11 september 2009 15:40
 To: Flash Coders List
 Subject: [Flashcoders] Access dynamically created MovieClip
 from class?
 
 Hello,
 
 I have created Movieclip in main actionscript file main.as
 :
 
 var drawingSign:Movieclip = ne MovieClip();
 drawingSign.x = 40;
 drawingSign.y = 40;
 
 How could I access it (add listeners etc.) from a class
 file?
 Is it possible?
 
 Thank you in advance,
 kioshin
 
 
       
 ___
 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] Access dynamically created MovieClip from class?

2009-09-11 Thread ktt
Hello,

I have created Movieclip in main actionscript file main.as :

var drawingSign:Movieclip = ne MovieClip();
drawingSign.x = 40;
drawingSign.y = 40;

How could I access it (add listeners etc.) from a class file?
Is it possible?

Thank you in advance,
kioshin


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


Re: [Flashcoders] time based smooth animation w/ GTween. HELP!

2009-09-11 Thread Joel Stransky
Grant has now merged forces with Jack Doyle, author of TweenLite, TweenMax
and TweenGroup. The syntax is almost identical and I think you'll have an
easier time achieving the effect you want. A tweens pulse can be updated
via a setInterval, use of a Timer object, based on the milliseconds a flash
movie has been running (getTime) or Enter_Frame events. Enter_Frame has
proven to be the most reliable but due to differences in computer speed and
network conditions none of them are bullet proof. TweenLite, I believe uses
a combination of enter_frame and a Timer where the pulse is updated via
enter_frame and the Timer object is then used to determine exactly which
frame of the tween is to be rendered. This means if for some reason the
flash movie lags, you may see a jump in animation in order to complete in
the time you've allotted. You do not have to specify this when using
TweenLite but keep in mind your movies framerate, the distance of the tween
and the amount of time you are allowing for the tween to finish all factor
in to the smoothness of playback.

On Fri, Sep 11, 2009 at 10:48 AM, Isaac Alves isaacal...@gmail.com wrote:

 Hello!

 I would like to create a time based and very smooth animation with
 GTween (or another one).
 But I´m used to GTween , though.

 here is my code:

 var plantaTween = new GTween(planta, 1.5, {y: 414}, {delay: 0.8,
 reversed: true, reflect: true, repeat: 999, ease:Quartic.easeInOut});

 I´ve read the following examples in Gtween´s documentation and
 somewhere else but i can-t quite understand it ..

 GTween.timingMode = GTween.TIME;

 at http://www.gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html

 should I use:
  plantaTween.timingMode = GTween.TIME;
 or:
  GTween.timingMode = GTween.TIME; ?

 What does the latter exactly means? it doesn´t do nothing. maybe cause
 the default timeInterval property is 25ms. how do i set it ?

 the first one throws a reference error Error #1056:

 and i-ve seen this also at the documentation
 http://www.gskinner.com/libraries/gtween/docs/

 Implementation
 public static function get timeInterval():uint
 public function set timeInterval(value:uint):void

 Implementation
 public static function get timingMode():String
 public function set timingMode(value:String):void

 but cannot figure out how to implement it...

 help ! thanks !

 ___
 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


[Flashcoders] Re: slideshow works w/ ctrl Enter in Flash but not when exported....

2009-09-11 Thread Isaac Alves
solved . it is a problem with GTween  completeListener parameter.

it had a function in it , as:  completeListener: function () {bla bal
bla bla }

usually doesn´t work.

so i did:

completeListener: someFunction

and then declared the function somewhre else.

thanks!
cheers

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


RE: [Flashcoders] Access dynamically created MovieClip from class?

2009-09-11 Thread ktt
Thank you for your help. I'm trying dynamicaly create a movieclip and be able 
to modify it, add and remove listeners etc. accesing it from any class.


Your example throws errors:
1046: Type was not found or was not a compile-time constant: Main
1180: Call to a possibly undefined method Main
1172: Definition Main could not be found // while trying to import

both classes are in the same directory.

k.
--- On Fri, 9/11/09, Merrill, Jason jason.merr...@bankofamerica.com wrote:

 From: Merrill, Jason jason.merr...@bankofamerica.com
 Subject: RE: [Flashcoders] Access dynamically created MovieClip from class?
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Date: Friday, September 11, 2009, 5:52 PM
 Not sure what you are trying to
 accomplish in what you are building (because I am suspicious
 your architectural approach may be a bit off - maybe), but
 to just answer your question, in the Main class, define the
 drawingSign Movie clip as a public variable like this:
 
 package
 {
     import flash.display.MovieClip;
 
     public class Main
     {
         //define it as public
 here:
         public var
 drawingSign:MovieClip;
 
         public function
 Main():void
         {
            
 //create it here:
            
 drawingSign = new MovieClip();
            
 //blah blah more code here.
         }
     }
 }
 
 Then, in your other class ClassDraw, import Main and create
 an instance of it:
 
 package
 {
     import flash.display.MovieClip;
     import Main; 
 
     public class ClassDraw extends
 MovieClip
     {
         private var
 _main:Main;
 
         public function
 ClassDraw():void
         {
            
 //create an instance of Main:
            
 _main = new Main();
            
 //access the MovieClip you want in the other class:
            
 trace(_main.drawingSign)
            
 //blah blah more code here.
         }
     }
 }
 
 
 Jason Merrill 
 
 Bank of  America   Global Learning 
 Learning  Performance Soluions
 
 Monthly meetings on making the most of the Adobe Flash
 Platform - presented by bank associates, Adobe engineers,
 and outside experts in the borader multimedia community -
 join the Bank of America Flash Platform Community 
 (note: this is for Bank of America employees only)
 
 
 
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com]
 On Behalf Of ktt
 Sent: Friday, September 11, 2009 10:25 AM
 To: Flash Coders List
 Subject: RE: [Flashcoders] Access dynamically created
 MovieClip from class?
 
 Thank you the answer, but maybe I didn't define situation
 clearly:
 
 I have two separate files main.as and classdraw.as
 
 Movieclip is defined in main.as:
 
 var drawingSign:Movieclip = new MovieClip();
 drawingSign.x = 40;
 drawingSign.y = 40;
 //drawingSign.addEventListener(MouseEvent.CLICK,mc_clicked);
 addChild(drawingSign);
 
 I want to access drawingSign from my other classdraw.as
 file:
 
 package (
 
 import flash.events.*;
 import flash.display.*;
 import flash.utils.*; 
 
 public class classdraw extends MovieClip {
 
 private var newSign:drawingSign = new drawingSign(); // as
 it is used to access objects from Library
 
 public function classdraw() {
 
 addChild (newSign);
 
 }
 
 But I geting errors :
 1046: Type was not found or was not a compile-time
 constant: drawingSign.
 1180; Call to a possibly undefined method drawingSign.
 
 Regards,
 Kioshin
 
 --- On Fri, 9/11/09, Cor c...@chello.nl
 wrote:
 
  From: Cor c...@chello.nl
  Subject: RE: [Flashcoders] Access dynamically created
 MovieClip from class?
  To: 'Flash Coders List' flashcoders@chattyfig.figleaf.com
  Date: Friday, September 11, 2009, 4:58 PM
  var drawingSign:Movieclip = new
  MovieClip(); //you forgot the w of new
  drawingSign.x = 40;
  drawingSign.y = 40;
  drawingSign.addEventListener(MouseEvent.CLICK,
  mc_clicked);
  addChild(drawingSign);
  
  private function mc_clicked(e:MouseEvent):void{
      trace(You have clicked drawingSign);
  }
  
  
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com
  [mailto:flashcoders-boun...@chattyfig.figleaf.com]
  On Behalf Of ktt
  Sent: vrijdag 11 september 2009 15:40
  To: Flash Coders List
  Subject: [Flashcoders] Access dynamically created
 MovieClip
  from class?
  
  Hello,
  
  I have created Movieclip in main actionscript file
 main.as
  :
  
  var drawingSign:Movieclip = ne MovieClip();
  drawingSign.x = 40;
  drawingSign.y = 40;
  
  How could I access it (add listeners etc.) from a
 class
  file?
  Is it possible?
  
  Thank you in advance,
  kioshin
  
  
        
  ___
  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] Access dynamically created MovieClip from class?

2009-09-11 Thread Geografiek

Hi k.
That's because ClassDraw cannot find the Main class. You have to get  
your class paths right.

Maybe this earlier post helps:


1) Flash - Preferences - Actionscript - ActionScript 3.0 Settings
This is a global configuration. It affects every fla document you  
export (i.e., when you compile a fla, the compiler will look up  
these paths)
2) File - Publish Settings - (ActionScript version) ActionScript  
3.0 Settings
This a per fla file configuration. It only affects the fla and it  
has a

higher priority than the global classpath.

What does that mean?
Suppose you have these settings:
In your global classpath:
C:\Actionscript\Classes\ (it's a windows path but it works the same  
way for Mac, I think)


In your fla classpath:
C:\Myprojects\someProject\src\

So, you have a class somePackage.someClass in both C:\Actionscript 
\Classes\ and C:\Myprojects\someProject\src\.
The class that will be compiled is the one in C:\Myprojects 
\someProject\src\, because it has a higher priority, since it's set  
up in the fla file. Take that into account to avoid some hard to  
find bugs caused by these kind of conflicts (which are not such  
for the compiler but might be hard to spot and cause some  
apparently odd behavior)


Cheers
Juan Pablo Califano



HTH
Willem van den Goorbergh

On 11-sep-2009, at 19:25, ktt wrote:

Thank you for your help. I'm trying dynamicaly create a movieclip  
and be able to modify it, add and remove listeners etc. accesing it  
from any class.



Your example throws errors:
1046: Type was not found or was not a compile-time constant: Main
1180: Call to a possibly undefined method Main
1172: Definition Main could not be found // while trying to import

both classes are in the same directory.

k.
--- On Fri, 9/11/09, Merrill, Jason  
jason.merr...@bankofamerica.com wrote:



From: Merrill, Jason jason.merr...@bankofamerica.com
Subject: RE: [Flashcoders] Access dynamically created MovieClip  
from class?

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Date: Friday, September 11, 2009, 5:52 PM
Not sure what you are trying to
accomplish in what you are building (because I am suspicious
your architectural approach may be a bit off - maybe), but
to just answer your question, in the Main class, define the
drawingSign Movie clip as a public variable like this:

package
{
import flash.display.MovieClip;

public class Main
{
//define it as public
here:
public var
drawingSign:MovieClip;

public function
Main():void
{

//create it here:

drawingSign = new MovieClip();

//blah blah more code here.
}
}
}

Then, in your other class ClassDraw, import Main and create
an instance of it:

package
{
import flash.display.MovieClip;
import Main;

public class ClassDraw extends
MovieClip
{
private var
_main:Main;

public function
ClassDraw():void
{

//create an instance of Main:

_main = new Main();

//access the MovieClip you want in the other class:

trace(_main.drawingSign)

//blah blah more code here.
}
}
}


Jason Merrill

Bank of  America   Global Learning
Learning  Performance Soluions

Monthly meetings on making the most of the Adobe Flash
Platform - presented by bank associates, Adobe engineers,
and outside experts in the borader multimedia community -
join the Bank of America Flash Platform Community
(note: this is for Bank of America employees only)




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com]
On Behalf Of ktt
Sent: Friday, September 11, 2009 10:25 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Access dynamically created
MovieClip from class?

Thank you the answer, but maybe I didn't define situation
clearly:

I have two separate files main.as and classdraw.as

Movieclip is defined in main.as:

var drawingSign:Movieclip = new MovieClip();
drawingSign.x = 40;
drawingSign.y = 40;
//drawingSign.addEventListener(MouseEvent.CLICK,mc_clicked);
addChild(drawingSign);

I want to access drawingSign from my other classdraw.as
file:

package (

import flash.events.*;
import flash.display.*;
import flash.utils.*;

public class classdraw extends MovieClip {

private var newSign:drawingSign = new drawingSign(); // as
it is used to access objects from Library

public function classdraw() {

addChild (newSign);

}

But I geting errors :
1046: Type was not found or was not a compile-time
constant: drawingSign.
1180; Call to a possibly undefined method drawingSign.

Regards,
Kioshin

--- On Fri, 9/11/09, Cor c...@chello.nl
wrote:


From: Cor c...@chello.nl
Subject: RE: [Flashcoders] Access dynamically created

MovieClip from class?

To: 'Flash Coders List' flashcoders@chattyfig.figleaf.com
Date: Friday, September 11, 2009, 4:58 PM
var drawingSign:Movieclip = new
MovieClip(); //you forgot the w of new
drawingSign.x = 40;
drawingSign.y = 40;
drawingSign.addEventListener(MouseEvent.CLICK,
mc_clicked);

Re: [Flashcoders] Access dynamically created MovieClip from class?

2009-09-11 Thread ktt
Geografiek, Jason,

Thank you very much.
Now it works!

K.

--- On Fri, 9/11/09, Geografiek geograf...@geografiek.nl wrote:

 From: Geografiek geograf...@geografiek.nl
 Subject: Re: [Flashcoders] Access dynamically created MovieClip from class?
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Date: Friday, September 11, 2009, 9:11 PM
 Hi k.
 That's because ClassDraw cannot find the Main class. You
 have to get  
 your class paths right.
 Maybe this earlier post helps:
 
  1) Flash - Preferences - Actionscript -
 ActionScript 3.0 Settings
  This is a global configuration. It affects every fla
 document you  
  export (i.e., when you compile a fla, the compiler
 will look up  
  these paths)
  2) File - Publish Settings - (ActionScript
 version) ActionScript  
  3.0 Settings
  This a per fla file configuration. It only affects the
 fla and it  
  has a
  higher priority than the global classpath.
 
  What does that mean?
  Suppose you have these settings:
  In your global classpath:
  C:\Actionscript\Classes\ (it's a windows path but it
 works the same  
  way for Mac, I think)
 
  In your fla classpath:
  C:\Myprojects\someProject\src\
 
  So, you have a class somePackage.someClass in both
 C:\Actionscript 
  \Classes\ and C:\Myprojects\someProject\src\.
  The class that will be compiled is the one in
 C:\Myprojects 
  \someProject\src\, because it has a higher priority,
 since it's set  
  up in the fla file. Take that into account to avoid
 some hard to  
  find bugs caused by these kind of conflicts (which
 are not such  
  for the compiler but might be hard to spot and cause
 some  
  apparently odd behavior)
 
  Cheers
  Juan Pablo Califano
 
 
 HTH
 Willem van den Goorbergh
 
 On 11-sep-2009, at 19:25, ktt wrote:
 
  Thank you for your help. I'm trying dynamicaly create
 a movieclip  
  and be able to modify it, add and remove listeners
 etc. accesing it  
  from any class.
 
 
  Your example throws errors:
  1046: Type was not found or was not a compile-time
 constant: Main
  1180: Call to a possibly undefined method Main
  1172: Definition Main could not be found // while
 trying to import
 
  both classes are in the same directory.
 
  k.
  --- On Fri, 9/11/09, Merrill, Jason  
  jason.merr...@bankofamerica.com
 wrote:
 
  From: Merrill, Jason jason.merr...@bankofamerica.com
  Subject: RE: [Flashcoders] Access dynamically
 created MovieClip  
  from class?
  To: Flash Coders List flashcoders@chattyfig.figleaf.com
  Date: Friday, September 11, 2009, 5:52 PM
  Not sure what you are trying to
  accomplish in what you are building (because I am
 suspicious
  your architectural approach may be a bit off -
 maybe), but
  to just answer your question, in the Main class,
 define the
  drawingSign Movie clip as a public variable like
 this:
 
  package
  {
      import
 flash.display.MovieClip;
 
      public class Main
      {
          //define it
 as public
  here:
          public var
  drawingSign:MovieClip;
 
          public
 function
  Main():void
          {
 
  //create it here:
 
  drawingSign = new MovieClip();
 
  //blah blah more code here.
          }
      }
  }
 
  Then, in your other class ClassDraw, import Main
 and create
  an instance of it:
 
  package
  {
      import
 flash.display.MovieClip;
      import Main;
 
      public class ClassDraw
 extends
  MovieClip
      {
          private var
  _main:Main;
 
          public
 function
  ClassDraw():void
          {
 
  //create an instance of Main:
 
  _main = new Main();
 
  //access the MovieClip you want in the other
 class:
 
  trace(_main.drawingSign)
 
  //blah blah more code here.
          }
      }
  }
 
 
  Jason Merrill
 
  Bank of  America   Global
 Learning
  Learning  Performance Soluions
 
  Monthly meetings on making the most of the Adobe
 Flash
  Platform - presented by bank associates, Adobe
 engineers,
  and outside experts in the borader multimedia
 community -
  join the Bank of America Flash Platform Community
  (note: this is for Bank of America employees
 only)
 
 
 
 
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com
  [mailto:flashcoders-boun...@chattyfig.figleaf.com]
  On Behalf Of ktt
  Sent: Friday, September 11, 2009 10:25 AM
  To: Flash Coders List
  Subject: RE: [Flashcoders] Access dynamically
 created
  MovieClip from class?
 
  Thank you the answer, but maybe I didn't define
 situation
  clearly:
 
  I have two separate files main.as and
 classdraw.as
 
  Movieclip is defined in main.as:
 
  var drawingSign:Movieclip = new MovieClip();
  drawingSign.x = 40;
  drawingSign.y = 40;
 
 //drawingSign.addEventListener(MouseEvent.CLICK,mc_clicked);
  addChild(drawingSign);
 
  I want to access drawingSign from my other
 classdraw.as
  file:
 
  package (
 
  import flash.events.*;
  import flash.display.*;
  import flash.utils.*;
 
  public class classdraw extends MovieClip {
 
  private var newSign:drawingSign = new
 drawingSign(); // as
  it is used to access 

[Flashcoders] Testing

2009-09-11 Thread Glen Pike

1,2,4
--

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] Testing

2009-09-11 Thread Karl DeSaulniers

Aaap ya missed 3

;)

Karl


On Sep 11, 2009, at 5:45 PM, Glen Pike wrote:


1,2,4
--

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


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


Re: [Flashcoders] Testing

2009-09-11 Thread Glen Pike

8,16,32

Karl DeSaulniers wrote:

Aaap ya missed 3

;)

Karl


On Sep 11, 2009, at 5:45 PM, Glen Pike wrote:


1,2,4
--

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


Karl DeSaulniers
Design Drumm
http://designdrumm.com

___
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