Re: [Flashcoders] When is 1 not 1?

2008-03-11 Thread Dave Mennenoh

When 1 had line feeds...

Well, I'm not quite sure how yet but somehow I'm getting a couple of line 
feeds in my def variable when it comes back to the LoadVars.onLoad.


I do:
$defUser = 1;
echo(im=.$fName.def=.$defUser);

But I found I get 1 plus a couple of line feeds...

I sure like AMFPHP a whole lot better.



Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ 


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


[Flashcoders] attachMovie(LibrarySymbol). Right way to access custom clip variables and functions.

2008-03-11 Thread Pasha
Hey!

Consider this.
There is a symbol in the library - Ball.
It has a variable declared in the first frame - size.
I want to instantiate the symbol and then read the variable value.

Trying to access the variable synchronously, right after the the symbol has
been instantiated, does not work:

var ball_mc = _root.attachMovie(Ball, ball_mc,
_root.getNextHighestDepth());
trace(size =  + ball_mc.size); //size = undefined

Then I came up with the following solution.
In the first frame of Ball symbol, at the end of code I insert the
following statement

onLoad();


And then inside the main program I register the listener to onLoad()
funciton call.

var ball_mc = _root.attachMovie(Ball, ball_mc,
_root.getNextHighestDepth());
ball_mc.onLoad = function() {
trace(size =  + ball_mc.size); //size = 20
}

This technique works fine.
However, I don't like the fact that I have manually add onLoad() call to
every symbol which properties or functions I want to access.

Do you think this is the right way to solve the problem?
What is the best way to?

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


[Flashcoders] JSFL Stringpanel

2008-03-11 Thread Dennis - I Sioux
Hey,

Has anyone got tips/ideas how to automate settings in the stringpanel?

With kind regards,

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


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-11 Thread Ian Thomas
Further to this (again) I've investigated the whole thing in some
depth, and come up with this:

The bug affects the AS2 MovieClip.getBounds() and MovieClip.getRect() methods.

As far as I can tell, it only happens in this situation:

AppA is an _AS3_ application. AppA loads AppB.
AppB is an AS2 application. AppB loads AppC.
AppC is an AS2 application.

If you run AppA, then any getBounds() or getRect() calls on objects in
AppC fail, but they work as expected in AppB.

(If you just run AppB, then everything works as expected.)

I've tried various variants of this; if, instead of loading AppB, you
embed it into AppA at compile-time, the problem still occurs. It
appears to be something to do with loading one VM1 movie into another
one within a VM2 shell.

For the curious, here's a Zip containing a minimal test setup:
http://www.wildwinter.net/public/getBoundsBug.zip

All suggestions for workarounds welcomed, as this is a real nuisance
for what we're currently working on.

(For reference, this is in Flash Player 9,0,115,0, using either Flex
compiler 2.01 or Flex Compiler 3.0 for the AS3 and using Flash 8.0 or
MTASC for the AS2.)

Cheers,
   Ian

P.S. Fairly obviously, I will be reporting this to Adobe.

On Mon, Mar 10, 2008 at 5:41 PM, Ian Thomas [EMAIL PROTECTED] wrote:
 On Mon, Mar 10, 2008 at 5:38 PM, Ian Thomas [EMAIL PROTECTED] wrote:

Using MovieClip.getRect() or MovieClip.getBounds() within b) (or a, of
course) works fine.
  
Using MovieClip.getRect() or MovieClip.getBounds() within c) returns
undefined (at least, in my setup).

  Sorry - to be clearer - using getRect() or getBounds() _on any object_
  in c) returns undefined. If you write code in c) that calls getRect()
  or getBounds() on b) e.g. _parent.getBounds(_parent) works fine.

  Ian

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


[Flashcoders] Loading Flash 8 swfs into Flash 9 and GC

2008-03-11 Thread Matt Muller
Hi, Im building an AS3 Flash 9 app. One requirement is to allow loading of
swf ads into the application.

I am a little concerned about GC. If the ad has any event listeners attached
to the stage, my understanding is that I will not be able to clean up after
the ad has finished and will leave myself open to memory leaks.
Can anyone validate this? And if this is true, is this also true of loading
in Flash 8 and less content.

Any ideas?

cheers,

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


[Flashcoders] mouse x and y

2008-03-11 Thread Lehr, Theodore M (N-SGIS)

How can I trace the x and y of the mouse? I would want to grab it on a
click

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


[Flashcoders] calculating distance between two points

2008-03-11 Thread Lehr, Theodore M (N-SGIS)
How do you calculate the distance between two points with different x
and y values? I know it is some simple math formula - I just don't know
it
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Kenneth Kawamoto

You can use our old friend Pythagoras':

c^2 = a^2 + b^2

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Lehr, Theodore M (N-SGIS) wrote:

How do you calculate the distance between two points with different x
and y values? I know it is some simple math formula - I just don't know
it

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


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Anthony Cintron
dx:Number = obj1.x - obj2.x;
dy:Number = obj1.y - obj2.y;

distance:Number = Math.sqrt(dx * dx + dy * dy);

On Tue, Mar 11, 2008 at 8:05 AM, Lehr, Theodore M (N-SGIS) 
[EMAIL PROTECTED] wrote:

 How do you calculate the distance between two points with different x
 and y values? I know it is some simple math formula - I just don't know
 it
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
Anthony Cintron
Flash || Flash Developer
www.sweetiesandgangsters.com
[EMAIL PROTECTED]
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Ivan Dembicki
Or you can use new revolutionary Point.distance(pt1, pt2);

-- 
iv
http://www.bezier.ru
http://bezier.googlecode.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] calculating distance between two points

2008-03-11 Thread Graham.Burton
The square root of the sum of the squares of the x difference and the y
difference.

Pythagoras

-Original Message-


How do you calculate the distance between two points with different x
and y values? I know it is some simple math formula - I just don't know
it
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 
 
Thomson Scientific Limited is a company incorporated under the laws of England 
and Wales (registered number 756619) having its registered office and address 
for service at Aldgate House, 33 Aldgate High Street, London, EC3N 1DL
 
This email is for the sole use of the intended recipient and contains 
information that may be privileged and/or confidential. If you are not an 
intended recipient, please notify the sender by return email and delete this 
email and any attachments.

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


RE: [Flashcoders] calculating distance between two points

2008-03-11 Thread Jim Hayes
Pythagorus, innit?
The square root of the the sum of the difference in x squared and the
difference in y squared ? Or was I not listening in school way back
then?

I think there may be an inbuilt method in flash, mind you, but if there
is I don't know what it is.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lehr,
Theodore M (N-SGIS)
Sent: 11 March 2008 12:05
To: Flash Coders List
Subject: [Flashcoders] calculating distance between two points

How do you calculate the distance between two points with different x
and y values? I know it is some simple math formula - I just don't know
it
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__

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


[Flashcoders] RE: calculating distance between two points

2008-03-11 Thread Lehr, Theodore M (N-SGIS)
Nevermind sorry

-Original Message-
From: Lehr, Theodore M (N-SGIS) 
Sent: Tuesday, March 11, 2008 8:05 AM
To: 'Flash Coders List'
Subject: calculating distance between two points

How do you calculate the distance between two points with different x
and y values? I know it is some simple math formula - I just don't know
it
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Paul Andrews

Your teacher must be cringing!

The square of the hypotenuse equals the sum of the squares of the opposite 
two sides should be familar..  ;-)


Math.sqrt ( Math.pow(Math.abs(x1-x2),2 )+Math.pow(Math.abs(y1-y2),2 )+))

Paul
- Original Message - 
From: Lehr, Theodore M (N-SGIS) [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Tuesday, March 11, 2008 12:05 PM
Subject: [Flashcoders] calculating distance between two points



How do you calculate the distance between two points with different x
and y values? I know it is some simple math formula - I just don't know
it
___
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] calculating distance between two points

2008-03-11 Thread Fumio Nonaka

Using Point class?

import flash.geom.Point;
var p0:Point = new Point(0, 0);
var p1:Point = new Point(1, Math.sqrt(3));
var nDistance:Number = Point.distance(p0, p1);
trace(nDistance);  // Output: 2
_
Jim Hayes wrote:

I think there may be an inbuilt method in flash, mind you, but if there
is I don't know what it is.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lehr,
Theodore M (N-SGIS)
Sent: 11 March 2008 12:05
To: Flash Coders List
Subject: [Flashcoders] calculating distance between two points

How do you calculate the distance between two points with different x
and y values? I know it is some simple math formula - I just don't know
it

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Paul Andrews

Aha - didn't know about that!

Paul
- Original Message - 
From: Ivan Dembicki [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Flash Coders List 
flashcoders@chattyfig.figleaf.com

Sent: Tuesday, March 11, 2008 12:34 PM
Subject: Re: [Flashcoders] calculating distance between two points



Or you can use new revolutionary Point.distance(pt1, pt2);

--
iv
http://www.bezier.ru
http://bezier.googlecode.com
___
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] mouse x and y

2008-03-11 Thread Allandt Bik-Elliott (Receptacle)
http://www.adobe.com/support/flash/action_scripts/ 
actionscript_dictionary/actionscript_dictionary584.html


questions like this are better sent to the flashnewbie board -  
they're very helpful there

http://chattyfig.figleaf.com/mailman/listinfo/flashnewbie


On 11 Mar 2008, at 11:49, Lehr, Theodore M (N-SGIS) wrote:



How can I trace the x and y of the mouse? I would want to grab it on a
click

Ted
___
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] mouse x and y

2008-03-11 Thread Hans Wichman
google for flash mouse x y

On Tue, Mar 11, 2008 at 12:49 PM, Lehr, Theodore M (N-SGIS) 
[EMAIL PROTECTED] wrote:


 How can I trace the x and y of the mouse? I would want to grab it on a
 click

 Ted
 ___
 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] listen for mouse click

2008-03-11 Thread Lehr, Theodore M (N-SGIS)
I have a deal where I have a huge movie and onPress I am getting the
mouse coordinates and onRelease I am getting the mouse coordinates and
then drawing a circle with the resulting coordinates... I would like to
do it without having to be on a movie... is it possible to have a
listener turned on that will then be able to do the same thing? I am not
totally familiar with listeners
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash is full of surprises. I will show you how to move movie-clip using a reference to another deleted clip.

2008-03-11 Thread Andy Herrman
So, the case he brought up was different from what you said.

In your case you're creating differently named movie clips, and
explicitly assigning them to the mc variable.

In the original code, a new movie clip was attached with the same
name, but NOT assigned to the variable.  After doing so you would
expect the variable to not work, but it ended up pointing to the new
clip.

  -Andy

On Mon, Mar 10, 2008 at 4:27 PM, Glen Pike [EMAIL PROTECTED] wrote:
 Sorry if I am speaking out of turn, but isn't this point a bit moot
  (redundant)?

  How else would you expect to be able to attach movieclips and manipulate
  them in a loop as you would normally?

  e.g.

  function doClips() {
 var mc:MovieClip;

 for(var i = 0;i  10;i++) {
mc = attachMovie(star, star_mc_ + i, getNextHighestDepth());
//mc.removeClip();
mx._x = 100 * i;
 }

 //would expect to manipulate the last one.
 mc._y = 100;
  }

  doClips();
  //compile error, but would not work anyway.
  mc._y = 200;
  //would work.
  star_mc_9._y = 200;

  I bet the reference goes out of scope once you exit the function you are in?

  If not, then that maybe a bug.

  Glen



  Andy Herrman wrote:
   So you're saying variables like mc are effectively pointers?
  
   Well crap.  I thought I didn't have to worry about pointers when I
   wasn't working in C... :)
  
   (I say after just debugging some really weird memory issue in C++ code...)
  
 -Andy
  
   On Mon, Mar 10, 2008 at 4:08 AM, strk [EMAIL PROTECTED] wrote:
  
   On Sun, Mar 09, 2008 at 06:50:58PM +0300, Pavel Empty wrote:
  
 //Create a clip from the library and store its reference to mc 
 variable.
 var mc:MovieClip = _root.attachMovie(Star, star_mc,
 _root.getNextHighestDepth());
  
'mc' is a soft reference to the Star instance.
  
  
 //Destroy the clip
 mc.removeMovieClip();
  
'mc' becomes a dangling reference, which means it'll be looking
for a substitute with same target name when dereferenced.
  
  
 //Create another star clip once again with the same name star_mc
 //Notice that I do not assign the clip reference to mc variable.
 _root.attachMovie(Star, star_mc, _root.getNextHighestDepth());

 //And now I move mc. It references the first clip, which was 
 destroyed.
 //I expect nothing to happen, but...
 mc._x = 100;

 The second clip moves!
 That is, the second clip was referenced using mc.
  
Dereferencing 'mc' here yelds the new Star insatnce, having
the same target path as the original one.
  
--strk;
  
  
   ___
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
  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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] calculating distance between two points

2008-03-11 Thread Merrill, Jason
Your teacher must be cringing!

The square of the hypotenuse equals the sum of the squares 
of the opposite two sides should be familar..  ;-)

Math.sqrt ( Math.pow(Math.abs(x1-x2),2 
)+Math.pow(Math.abs(y1-y2),2 )+))


Why not skip the math lessons and use the Point class?  

var dist:Number = Point.distance(p1, p2);


Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies? 
Check out our internal  GTO Innovative Learning Blog  subscribe.



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


RE: [Flashcoders] listen for mouse click

2008-03-11 Thread Merrill, Jason
Yes.   

MySprite.addEventListener(MouseEvent.MOUSE_DOWN, doDrawing)

private function doDrawing(e:MouseEvent):void
{
var targSprite:Sprite = e.target as Sprite
trace(targSprite.x)
}


Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies? 
Check out our internal  GTO Innovative Learning Blog  subscribe.




 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of Lehr, Theodore M (N-SGIS)
Sent: Tuesday, March 11, 2008 9:27 AM
To: Flash Coders List
Subject: [Flashcoders] listen for mouse click

I have a deal where I have a huge movie and onPress I am 
getting the mouse coordinates and onRelease I am getting the 
mouse coordinates and then drawing a circle with the 
resulting coordinates... I would like to do it without having 
to be on a movie... is it possible to have a listener turned 
on that will then be able to do the same thing? I am not 
totally familiar with listeners
___
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] mouse x and y

2008-03-11 Thread Merrill, Jason
Or Flash_Tiger on Yahoo - we embrace Actionscripters of all types, skill
level, donor status and music preference.

Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies? 
Check out our internal  GTO Innovative Learning Blog  subscribe.




 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of Allandt Bik-Elliott (Receptacle)
Sent: Tuesday, March 11, 2008 9:21 AM
To: Flash Coders List
Subject: Re: [Flashcoders] mouse x and y

http://www.adobe.com/support/flash/action_scripts/
actionscript_dictionary/actionscript_dictionary584.html

questions like this are better sent to the flashnewbie board 
- they're very helpful there 
http://chattyfig.figleaf.com/mailman/listinfo/flashnewbie


On 11 Mar 2008, at 11:49, Lehr, Theodore M (N-SGIS) wrote:


 How can I trace the x and y of the mouse? I would want to 
grab it on a 
 click

 Ted
 ___
 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] calculating distance between two points

2008-03-11 Thread Piers Cowburn

Good point


On 11 Mar 2008, at 13:53, Merrill, Jason wrote:





Why not skip the math lessons and use the Point class?

var dist:Number = Point.distance(p1, p2);


Jason Merrill
Bank of America
GTO LLD Solutions Design  Development
eTools  Multimedia

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GTO Innovative Learning Blog  subscribe.



___
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] calculating distance between two points

2008-03-11 Thread Merrill, Jason
Very punny.

Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies? 
Check out our internal  GTO Innovative Learning Blog  subscribe.




 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of Piers Cowburn
Sent: Tuesday, March 11, 2008 10:24 AM
To: Flash Coders List
Subject: Re: [Flashcoders] calculating distance between two points

Good point


On 11 Mar 2008, at 13:53, Merrill, Jason wrote:



 Why not skip the math lessons and use the Point class?

 var dist:Number = Point.distance(p1, p2);


 Jason Merrill
 Bank of America
 GTO LLD Solutions Design  Development eTools  Multimedia

 Bank of America Flash Platform Developer Community


 Are you a Bank of America associate interested in 
innovative learning 
 ideas and technologies?
 Check out our internal  GTO Innovative Learning Blog  subscribe.



 ___
 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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] mouse x and y

2008-03-11 Thread Brian Mays
Even those of us who use scenes??? ;-)

Brian Mays


On 3/11/08 9:17 AM, Merrill, Jason [EMAIL PROTECTED]
wrote:

 Or Flash_Tiger on Yahoo - we embrace Actionscripters of all types, skill
 level, donor status and music preference.
 

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


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Allandt Bik-Elliott (Receptacle)

aargh

that pun made me bleed



On 11 Mar 2008, at 14:24, Piers Cowburn wrote:


Good point


On 11 Mar 2008, at 13:53, Merrill, Jason wrote:





Why not skip the math lessons and use the Point class?

var dist:Number = Point.distance(p1, p2);


Jason Merrill
Bank of America
GTO LLD Solutions Design  Development
eTools  Multimedia

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GTO Innovative Learning Blog  subscribe.



___
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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] mouse x and y

2008-03-11 Thread Merrill, Jason
Everyone but - sorry, forgot to mention.

Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies? 
Check out our internal  GTO Innovative Learning Blog  subscribe.




 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of Brian Mays
Sent: Tuesday, March 11, 2008 10:38 AM
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] mouse x and y

Even those of us who use scenes??? ;-)

Brian Mays


On 3/11/08 9:17 AM, Merrill, Jason [EMAIL PROTECTED]
wrote:

 Or Flash_Tiger on Yahoo - we embrace Actionscripters of all types, 
 skill level, donor status and music preference.
 

___
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] calculating distance between two points

2008-03-11 Thread Jim Hayes
That was the one I thought I'd heard of. But...
Too easy! Boring! Soh cah toa !
(and that as far as I can remember is actually the only useful thing I
did learn in school)

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ivan
Dembicki
Sent: 11 March 2008 12:35
To: [EMAIL PROTECTED]; Flash Coders List
Subject: Re: [Flashcoders] calculating distance between two points

Or you can use new revolutionary Point.distance(pt1, pt2);

-- 

iv
http://www.bezier.ru
http://bezier.googlecode.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__

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


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Paul Andrews
- Original Message - 
From: Merrill, Jason [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Tuesday, March 11, 2008 1:53 PM
Subject: RE: [Flashcoders] calculating distance between two points



Your teacher must be cringing!

The square of the hypotenuse equals the sum of the squares 
of the opposite two sides should be familar..  ;-)


Math.sqrt ( Math.pow(Math.abs(x1-x2),2 
)+Math.pow(Math.abs(y1-y2),2 )+))



Why not skip the math lessons and use the Point class?  


Yes, my explanation was what was completely pointless..
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash is full of surprises. I will show you how to move movie-clip using a reference to another deleted clip.

2008-03-11 Thread Glen Pike
Yes, but my example was meant to be different to demonstrate there is 
probably a reason for allowing different clips to be assigned to a 
variable. 

My argument was, the original post may have been moot / redundant / 
not-so-surprising if you think a little about how Flash works.  Once the 
variable goes out of scope, you probably cannot manipulate any clips 
through this variable any more.  I would also expect that if you create 
movie clips with the same names, you are going to run into problems - 
the name of the movie clip corresponds to a variable in the parent clip 
- assign one thing to this variable and you can manipulate it, assign 
another and you would expect to manipulate that - not surprising at all.


Andy Herrman wrote:

So, the case he brought up was different from what you said.

In your case you're creating differently named movie clips, and
explicitly assigning them to the mc variable.

In the original code, a new movie clip was attached with the same
name, but NOT assigned to the variable.  After doing so you would
expect the variable to not work, but it ended up pointing to the new
clip.

  -Andy

On Mon, Mar 10, 2008 at 4:27 PM, Glen Pike [EMAIL PROTECTED] wrote:
  

Sorry if I am speaking out of turn, but isn't this point a bit moot
 (redundant)?

 How else would you expect to be able to attach movieclips and manipulate
 them in a loop as you would normally?

 e.g.

 function doClips() {
var mc:MovieClip;

for(var i = 0;i  10;i++) {
   mc = attachMovie(star, star_mc_ + i, getNextHighestDepth());
   //mc.removeClip();
   mx._x = 100 * i;
}

//would expect to manipulate the last one.
mc._y = 100;
 }

 doClips();
 //compile error, but would not work anyway.
 mc._y = 200;
 //would work.
 star_mc_9._y = 200;

 I bet the reference goes out of scope once you exit the function you are in?

 If not, then that maybe a bug.

 Glen



 Andy Herrman wrote:
  So you're saying variables like mc are effectively pointers?
 
  Well crap.  I thought I didn't have to worry about pointers when I
  wasn't working in C... :)
 
  (I say after just debugging some really weird memory issue in C++ code...)
 
-Andy
 
  On Mon, Mar 10, 2008 at 4:08 AM, strk [EMAIL PROTECTED] wrote:
 
  On Sun, Mar 09, 2008 at 06:50:58PM +0300, Pavel Empty wrote:
 
//Create a clip from the library and store its reference to mc 
variable.
var mc:MovieClip = _root.attachMovie(Star, star_mc,
_root.getNextHighestDepth());
 
   'mc' is a soft reference to the Star instance.
 
 
//Destroy the clip
mc.removeMovieClip();
 
   'mc' becomes a dangling reference, which means it'll be looking
   for a substitute with same target name when dereferenced.
 
 
//Create another star clip once again with the same name star_mc
//Notice that I do not assign the clip reference to mc variable.
_root.attachMovie(Star, star_mc, _root.getNextHighestDepth());
   
//And now I move mc. It references the first clip, which was destroyed.
//I expect nothing to happen, but...
mc._x = 100;
   
The second clip moves!
That is, the second clip was referenced using mc.
 
   Dereferencing 'mc' here yelds the new Star insatnce, having
   the same target path as the original one.
 
   --strk;
 
 
  ___
   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
 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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


--

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] accessing statics from a timeline

2008-03-11 Thread Mendelsohn, Michael
Hi list...

I have a class emc extends movieclip.

On emc's timeline, how do I access a static variable in the emc class?
Super doesn't seem to work, neither does emc.staticprop.

Thanks,
- MM


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


Re: [Flashcoders] mouse x and y

2008-03-11 Thread anuj sharma
Hi Throdore.
You can try MOUSE_MOVE and trace mouseX and mouseY and it will give you your
mouse coordinates whenever you move your mouse. Similarly you can use mouseX
and mouseYon mouseUP or DOWN event or CLICK.
Thanks
Anuj

On Tue, Mar 11, 2008 at 4:49 AM, Lehr, Theodore M (N-SGIS) 
[EMAIL PROTECTED] wrote:


 How can I trace the x and y of the mouse? I would want to grab it on a
 click

 Ted
 ___
 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] calculating distance between two points

2008-03-11 Thread Kenneth Kawamoto
Isn't it pointless to do Math.abs() since result is always positive 
number anyway? ;)


Kenneth Kawamoto
http://www.materiaprima.co.uk/

Paul Andrews wrote:
- Original Message - From: Merrill, Jason 
[EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Tuesday, March 11, 2008 1:53 PM
Subject: RE: [Flashcoders] calculating distance between two points



Your teacher must be cringing!

The square of the hypotenuse equals the sum of the squares of the 
opposite two sides should be familar..  ;-)


Math.sqrt ( Math.pow(Math.abs(x1-x2),2 )+Math.pow(Math.abs(y1-y2),2 
)+))



Why not skip the math lessons and use the Point class?  


Yes, my explanation was what was completely pointless..

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


[Flashcoders] Need HELP...Masking Tween in actionscript3 for animating purposes..

2008-03-11 Thread John Glendenning

Hello everyone,

This is my first message, and before I begin, I would like to thank the 
creator(s) of this mailing list.


I have begun working with AS3 and I am getting comfortalble with the 
basics.  I can put my MCs on the stage through actionscript, designate 
coordinates/placement of MCs, and apply copy motions from the timeline.  
so i am able to add event listeners and get the MCs to animate, play 
sounds, etc. 

I need help with a new class/method..im not sure what to refer it to as 
but i will explain. 

I attempted to copy motion a mask tween of a circle in the time line, 
only to find out that i am not able to.  after research i have found 
that i can do this in actionscript and have found the following 
information about mask tween in AS



the following is my current code structure, and i would very much 
appreciate some guidance in this, as to where i should place the codes 
at to create a mask effect within a mc, i think...


plain english request :Pi want to animate the rays of the sun.  i 
have a circle that has lines going away from it.  so my idea is to 
create a code in actionscript, where it creates an animation of mask 
circle, twening from the first fame of animation, to the last frame and 
then stop.  the circle mask is the same size as the sun.  so i want to 
add an eventlistener to the sun movie clip that when mouseclick release, 
it will animate the shape tween of the circle mask an then stop when it 
reaches its final size.  beginning size = 100,100, radius final size = 
300,300, radius .  

can ayone help me get started on the basics of how to implement this?  
as i send this email out, i will continue to make attempts.  thank you 
all for taking a look at this.


JohnGlendenning



SAMPLE CODES FROM ONLINE RESEARCH

import fl.transitions.*;
import fl.transitions.easing.*;

TransitionManager.start(img1_mc, {type:Iris, direction:Transition.IN, 
duration:2, easing:Strong.easeOut, startPoint:5, shape:Iris.CIRCLE});


// break in code, next snippet...\\



function createClip(radius:Number):MovieClip
{
var clip:MovieClip=new MovieClip();
clip.name='clip';
clip.graphics.beginFill(0xFF0033,1);
clip.graphics.drawCircle(300,300,radius);
clip.graphics.endFill();
return clip;
}
addChild(createClip(50));
trace(createClip(50).name);

// break in code... next snippet of an EXAMPLE i found 
onlineflepstudio.org/forum/tutorials/551-masks-actionscript-3-0-a.html\\

package
{
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.geom.Point;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.Event;
import flash.events.MouseEvent;

public class Maschere extends MovieClip
{
private var points_array:Array;
private var clips_array:Array;

private var container_mc:MovieClip;

private const w:int=5;
private const h:int=5;
private var ww:int;
private var hh:int;
private var arrS:int;

private var timer:Timer;

public function Maschere()
{
init();
creaPunti();
disegnaMaschere();
listenerBottone();
iniziaTimer();
}

private function init():void
{
stage.frameRate=31;

points_array=new Array();
clips_array=new Array();

container_mc=new MovieClip();
addChild(container_mc);
container_mc.x=pic_mc.x;
container_mc.y=pic_mc.y;

ww=Math.floor(pic_mc.width/w);
hh=Math.floor(pic_mc.height/h);

replay_btn.visible=false;
}

private function creaPunti():void
{
for(var i:int=0;i  h;i++)
{
for(var j:int=0;j  w;j++)
{
var point:Point=new Point(ww*j,hh*i);
points_array.push(point);
}
}
}

private function disegnaMaschere():void
{
for(var i:int=0;i  points_array.length;i++)
{
var clip:MovieClip=new MovieClip();
  

Re: [Flashcoders] Is there any grid component in AS 3.0

2008-03-11 Thread anuj sharma
can I use my already AS 3.0 code in Flex . i am not sure how do these things
integrate. Please let me know do I have to create a new application from
scratch in Flex or does my already existing code going to be imported.
Thanks
Anuj

On Mon, Mar 10, 2008 at 6:32 PM, eric e. dolecki [EMAIL PROTECTED] wrote:

 check out Flex.

 On Mon, Mar 10, 2008 at 8:08 PM, anuj sharma [EMAIL PROTECTED] wrote:

  Hi All
  I am looking for a grid container in AS 3.0. With my search I found that
  AS
  3.0 supports Data Grid but for holding data not for visual layout
  perspective. I am looking something for visual layout perspective. My
 aim
  is
  that if user drops 4 objects on the main screen  and hits arrange button
  then 4 objects will be arranged in a 2x2 grid format. Any ideas e(xcept
 to
  manually specifying the coordinates) how would i do that and which
  container
  i will use for that.
  Thanks in advance
  Anuj
  ___
  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] clean scripting

2008-03-11 Thread Allandt Bik-Elliott (Receptacle)

hi

just a semantic question really

when writing your classes, would you only declare variables in the  
class and assign variables later or would you assign values straight  
away if you had them?


so for instance, would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;

internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties = new CommonProperties();
private var commonY:uint = cp. commonY;
private var commonCopy:String = cp.commonCopy;
private static var title:String = Title;
private static var subtitle:String = Subtitle;

public function Class()
{
myFunc1();
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which works fine but is a little messy at the class level

or would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;

internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var commonY:uint;
private var commonCopy:String
private static var title:String
private static var subtitle:String ;

public function Class()
{
setVars();
myFunc1();
}

private function setVars()
{
cp =  new CommonProperties();
commonY = cp. commonY;
commonCopy = cp.commonCopy;
title = Title;
subtitle = Subtitle;
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which seems cleaner but is more round the houses.

thanks in advance
a


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


RE: [Flashcoders] clean scripting

2008-03-11 Thread Matthew James Poole
Actually, I've seen that the values are often set quicker when
initilaised in the contructor rather than against class members , but I
think it looks tidier the way you've done it... imo

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Allandt
Bik-Elliott (Receptacle)
Sent: 11 March 2008 17:41
To: flashcoders
Subject: [Flashcoders] clean scripting

hi

just a semantic question really

when writing your classes, would you only declare variables in the class
and assign variables later or would you assign values straight away if
you had them?

so for instance, would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;

internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties = new
CommonProperties();
private var commonY:uint = cp. commonY;
private var commonCopy:String = cp.commonCopy;
private static var title:String = Title;
private static var subtitle:String = Subtitle;

public function Class()
{
myFunc1();
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which works fine but is a little messy at the class level

or would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;

internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var commonY:uint;
private var commonCopy:String
private static var title:String
private static var subtitle:String ;

public function Class()
{
setVars();
myFunc1();
}

private function setVars()
{
cp =  new CommonProperties();
commonY = cp. commonY;
commonCopy = cp.commonCopy;
title = Title;
subtitle = Subtitle;
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which seems cleaner but is more round the houses.

thanks in advance
a


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

__
This e-mail has been scanned for viruses by the Virtual Universe e-mail
security system - powered by MessageLabs.
http://www.virtual-universe.net

__

The contents of this email (which include its attachments) are confidential and 
may be subject to legal privilege and protected by copyright. If you are not 
the intended recipient any use, copying or disclosure of this e-mail to any 
third party is strictly forbidden by the sender and we reserve all rights and 
remedies against any person or entity making any such unauthorised use. If you 
have received this email in error, please contact the sender immediately by 
telephone or return the email to the sender and then delete this email and any 
copies of it on your system. Virtual Universe Limited may monitor the contents 
of emails sent and received via its network for viruses and to ensure the 
lawful and authorised use of its systems. Virtual Universe Limited will not be 
held responsible for any damage caused by viruses which may be transmitted upon 
receipt of this email or the opening of any attachment thereto. Any views or 
opinions presented in this email are solely those of th!
 e author and do not necessarily represent those of Virtual Universe Limited.

Virtual Universe Limited is a company established under the laws of England and 
Wales with registered number 03064568 and has its registered office at 1 Regent 
Street, London, SW1Y 4NW and principal place of business at 28-39 The Quadrant, 
135 Salusbury Road, London NW6 6RJ, United Kingdom. It is registered for VAT in 
the United Kingdom with number GB877113217.



Re: [Flashcoders] clean scripting

2008-03-11 Thread Jer Brand
Not sure if this is correct for AS3, but I was under the impression that
there was an actual performance penalty to doing things the first way
(object creation and assignment in the class definition rather than in the
methods or the constructor).

Still, I like doing things the 2nd way, if only because it's habit for me at
this point. In my own twisted little mind it also prevents me from
experiencing the Where the hell did I define that syndrome --- I always
know where I set the initial values of my class variables.

Would be interested to know if my memory of [some book I can't remember the
name of] told me right.

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


[Flashcoders] dictionary vs array

2008-03-11 Thread Dwayne Neckles
can anyone say why dictionary is better than array.. Im seeing it used in alot 
of papervision examples and i dont get why?
I will research this on my own as well..

_
Need to know the score, the latest news, or you need your Hotmail®-get your 
fix.
http://www.msnmobilefix.com/Default.aspx___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] clean scripting

2008-03-11 Thread Mark Lapasa

Either way to me is a non-issue.

However, it is an issue if I want to implement lazy instantiation. That 
is, instantiating  objects  only right before you need them.

Thus, in your first example, the bulk of instantiation occurs up-front.

Lazy instantiation  
http://www.javaworld.com/javaworld/javatips/jw-javatip67.html



-mL


Allandt Bik-Elliott (Receptacle) wrote:

hi

just a semantic question really

when writing your classes, would you only declare variables in the 
class and assign variables later or would you assign values straight 
away if you had them?


so for instance, would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;

internal class Class extends Sprite

{
// class variable declarations
private var cp:CommonProperties = new CommonProperties();
private var commonY:uint = cp. commonY;
private var commonCopy:String = cp.commonCopy;
private static var title:String = Title;
private static var subtitle:String = Subtitle;
   
public function Class()

{
myFunc1();
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which works fine but is a little messy at the class level

or would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;

internal class Class extends Sprite

{
// class variable declarations
private var cp:CommonProperties;
private var commonY:uint;
private var commonCopy:String
private static var title:String
private static var subtitle:String ;
   
public function Class()

{
setVars();
myFunc1();
}

private function setVars()
{
cp =  new CommonProperties();
commonY = cp. commonY;
commonCopy = cp.commonCopy;
title = Title;
subtitle = Subtitle;
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which seems cleaner but is more round the houses.

thanks in advance
a


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




Notice of confidentiality:
The information contained in this e-mail is intended only for the use of the 
individual or entity named above and may be confidential. Should the reader of 
this message not be the intended recipient, you are hereby notified that any 
unauthorized dissemination, distribution or reproduction of this message is 
strictly prohibited. If you have received this message in error, please advise 
the sender immediately and destroy the e-mail.


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


RE: [Flashcoders] Is there any grid component in AS 3.0

2008-03-11 Thread Kerry Thompson
anuj Sharma wrote:
 
 can I use my already AS 3.0 code in Flex . i am not sure how do these
things
 integrate. Please let me know do I have to create a new application from
 scratch in Flex or does my already existing code going to be imported.

Your AS3 code will probably work, but you'll need to make some
modifications. For example, if you have declared a document class, that will
be the file you will choose as your project file in Flex. Also, if you have
assets in your Flash file, export them, publish it as a swf (no code, no
timeline), and you can use the swf essentially as a library in Flex.

I could go into more detail, but this is really a Flex topic, and this is a
Flash list. Check out FlexCoders--it's high volume (a LOT of people are
switching to Flex, it appears), but there are some bright guys there (look
for Jason Merrill's posts), and it is, surprisingly enough, more oriented
towards Flex.

Cordially,

Kerry Thompson


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


Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Steven Sacks
An Array is a linear collection.  A Hash is a random access collection 
(lookup table) of name-value pairs.


Dictionary is a fancy Hash that can take an Object as a key, instead of 
a String, and uses strict (===) equality for its lookups.


hash = new Object();
hash.foo = bar;

array = new Array();
array.push(hello);
array.push(world);

dictionary = new Dictionary();
dictionary[hash] = array;

trace(hash.foo);
-- bar

trace(array)
-- hello, world

trace(dictionary[hash]);
-- hello, world




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


RE: [Flashcoders] Is there any grid component in AS 3.0

2008-03-11 Thread Merrill, Jason
In Flex, for visual layout components, there are a lot of options, but
one you'll want to look at is mx.controls.TileList

Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies? 
Check out our internal  GTO Innovative Learning Blog  subscribe.




 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of Kerry Thompson
Sent: Tuesday, March 11, 2008 2:29 PM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Is there any grid component in AS 3.0

anuj Sharma wrote:
 
 can I use my already AS 3.0 code in Flex . i am not sure 
how do these
things
 integrate. Please let me know do I have to create a new application 
 from scratch in Flex or does my already existing code going 
to be imported.

Your AS3 code will probably work, but you'll need to make 
some modifications. For example, if you have declared a 
document class, that will be the file you will choose as your 
project file in Flex. Also, if you have assets in your Flash 
file, export them, publish it as a swf (no code, no 
timeline), and you can use the swf essentially as a library in Flex.

I could go into more detail, but this is really a Flex topic, 
and this is a Flash list. Check out FlexCoders--it's high 
volume (a LOT of people are switching to Flex, it appears), 
but there are some bright guys there (look for Jason 
Merrill's posts), and it is, surprisingly enough, more 
oriented towards Flex.

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] dictionary vs array

2008-03-11 Thread Dwayne Neckles
I was just wondering since tthe PV3d guys use it all the time.. and i am having 
some trouble interacting with planes consistently ( see 
http://www.dnecklesportfolio.com/pv3d/ click on interactive and then 
experiements ).. so i thought that it might be an issue as far off as it seems



 Date: Tue, 11 Mar 2008 19:48:45 +0100
 From: [EMAIL PROTECTED]
 To: flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] dictionary vs array
 CC: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 
 Hi,
 its a conceptual difference, array maps indices to objects, while a
 dictionary maps objects to objects.
 There is no such thing as better, it depends on what you need.
 
 greetz
 JC
 
 On Tue, Mar 11, 2008 at 7:02 PM, Dwayne Neckles [EMAIL PROTECTED]
 wrote:
 
  can anyone say why dictionary is better than array.. Im seeing it used in
  alot of papervision examples and i dont get why?
  I will research this on my own as well..
 
  _
  Need to know the score, the latest news, or you need your Hotmail(R)-get
  your fix.
 
  http://www.msnmobilefix.com/Default.aspx___
  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

_
Helping your favorite cause is as easy as instant messaging. You IM, we give.
http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Steven Sacks

You got it!  :)

You can mix and match with a Dictionary, as well.  You can use strings 
as keys or objects.



Patrick Matte | BLITZ wrote:

Thanks Steven, I never really understood what a dictionary was myself, so 
dictionary would be useful for something like this ?

dictionary = new Dictionary();
button1 = new Button()
dictionary[button1] = http://www.google.com;;
button2 = new Button()
dictionary[button2] = http://www.yahoo.com;;

function onButtonClick(event:MouseEvent){
trace(dictionary[event.target]);
}


BLITZ | Patrick Matte - 310-551-0200 x214
  


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


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Cory Petosky
Point.distance (like pretty much all Flash math functions) is
abysmally slow and shouldn't be used in anything performance-critical.
Write your own replacement (using formula provided above) if you're
doing a bunch of these every frame.

On 3/11/08, Kenneth Kawamoto [EMAIL PROTECTED] wrote:
 Isn't it pointless to do Math.abs() since result is always positive
  number anyway? ;)


  Kenneth Kawamoto
  http://www.materiaprima.co.uk/


 Paul Andrews wrote:
   - Original Message - From: Merrill, Jason
   [EMAIL PROTECTED]
   To: Flash Coders List flashcoders@chattyfig.figleaf.com
   Sent: Tuesday, March 11, 2008 1:53 PM
   Subject: RE: [Flashcoders] calculating distance between two points
  
  
   Your teacher must be cringing!
  
   The square of the hypotenuse equals the sum of the squares of the
   opposite two sides should be familar..  ;-)
  
   Math.sqrt ( Math.pow(Math.abs(x1-x2),2 )+Math.pow(Math.abs(y1-y2),2
   )+))
  
  
   Why not skip the math lessons and use the Point class?
  
   Yes, my explanation was what was completely pointless..
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Claus Wahlers

Dwayne Neckles wrote:


can anyone say why dictionary is better than array.. Im seeing it
used in alot of papervision examples and i dont get why? I will
research this on my own as well..


Keys in an Array can be numeric, strings, or both:

var a:Array = [];
a[0] = something;
a[hello] = something; // associative Array

Keys in a Dictionary can theoretically be of any type:

var d:Dictionary = new Dictionary();
d[0] = something;
d[hello] = something;

var c:SomeClass = new SomeClass();
d[c] = something;

An associative Array behaves similar to a Dictionary.

I might be wrong but i remember seeing that if you want to store data 
with string keys, Dictionary is performing slightly better.


A word of caution if you plan to use E4X XML nodes or function 
references as Dictionary keys: this appears to be buggy.


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


Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Cory Petosky
That's a pretty good use, as long as you call your variable something
more meaningful than dictionary. :)

On 3/11/08, Patrick Matte | BLITZ [EMAIL PROTECTED] wrote:
 Thanks Steven, I never really understood what a dictionary was myself, so 
 dictionary would be useful for something like this ?

  dictionary = new Dictionary();
  button1 = new Button()
  dictionary[button1] = http://www.google.com;;
  button2 = new Button()
  dictionary[button2] = http://www.yahoo.com;;

  function onButtonClick(event:MouseEvent){
  trace(dictionary[event.target]);
  }



  BLITZ | Patrick Matte - 310-551-0200 x214


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
  Sent: Tuesday, March 11, 2008 12:14 PM
  To: Flash Coders List
  Subject: Re: [Flashcoders] dictionary vs array

  An Array is a linear collection.  A Hash is a random access collection
  (lookup table) of name-value pairs.

  Dictionary is a fancy Hash that can take an Object as a key, instead of
  a String, and uses strict (===) equality for its lookups.

  hash = new Object();
  hash.foo = bar;

  array = new Array();
  array.push(hello);
  array.push(world);

  dictionary = new Dictionary();
  dictionary[hash] = array;

  trace(hash.foo);
  -- bar

  trace(array)
  -- hello, world

  trace(dictionary[hash]);
  -- hello, world




  ___
  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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] clean scripting

2008-03-11 Thread Allandt Bik-Elliott (Receptacle)

they're both eager, though, aren't they?

the only difference is that everything is instantiated in the first  
method of the class rather than in the class head


a

On 11 Mar 2008, at 18:10, Mark Lapasa wrote:


Either way to me is a non-issue.

However, it is an issue if I want to implement lazy instantiation.  
That is, instantiating  objects  only right before you need them.
Thus, in your first example, the bulk of instantiation occurs up- 
front.


Lazy instantiation  http://www.javaworld.com/javaworld/javatips/ 
jw-javatip67.html



-mL


Allandt Bik-Elliott (Receptacle) wrote:

hi

just a semantic question really

when writing your classes, would you only declare variables in the  
class and assign variables later or would you assign values  
straight away if you had them?


so for instance, would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;
internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties = new CommonProperties();
private var commonY:uint = cp. commonY;
private var commonCopy:String = cp.commonCopy;
private static var title:String = Title;
private static var subtitle:String = Subtitle;
   public function Class()
{
myFunc1();
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which works fine but is a little messy at the class level

or would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;
internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var commonY:uint;
private var commonCopy:String
private static var title:String
private static var subtitle:String ;
   public function Class()
{
setVars();
myFunc1();
}

private function setVars()
{
cp =  new CommonProperties();
commonY = cp. commonY;
commonCopy = cp.commonCopy;
title = Title;
subtitle = Subtitle;
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which seems cleaner but is more round the houses.

thanks in advance
a


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




Notice of confidentiality:
The information contained in this e-mail is intended only for the  
use of the individual or entity named above and may be  
confidential. Should the reader of this message not be the intended  
recipient, you are hereby notified that any unauthorized  
dissemination, distribution or reproduction of this message is  
strictly prohibited. If you have received this message in error,  
please advise the sender immediately and destroy the e-mail.



___
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] dictionary vs array

2008-03-11 Thread Barry Hannah
The best use for them is to be able to find something you've stored by
its key - as opposed to having to loop through an entire array to find
it.
Pretty damn handy, but sorting them can be complicated.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Patrick
Matte | BLITZ
Sent: Wednesday, 12 March 2008 8:42 a.m.
To: Flash Coders List
Subject: RE: [Flashcoders] dictionary vs array

Thanks Steven, I never really understood what a dictionary was myself,
so dictionary would be useful for something like this ?

dictionary = new Dictionary();
button1 = new Button()
dictionary[button1] = http://www.google.com;;
button2 = new Button()
dictionary[button2] = http://www.yahoo.com;;

function onButtonClick(event:MouseEvent){
trace(dictionary[event.target]);
}


BLITZ | Patrick Matte - 310-551-0200 x214

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven
Sacks
Sent: Tuesday, March 11, 2008 12:14 PM
To: Flash Coders List
Subject: Re: [Flashcoders] dictionary vs array

An Array is a linear collection.  A Hash is a random access collection
(lookup table) of name-value pairs.

Dictionary is a fancy Hash that can take an Object as a key, instead of
a String, and uses strict (===) equality for its lookups.

hash = new Object();
hash.foo = bar;

array = new Array();
array.push(hello);
array.push(world);

dictionary = new Dictionary();
dictionary[hash] = array;

trace(hash.foo);
-- bar

trace(array)
-- hello, world

trace(dictionary[hash]);
-- hello, world




___
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

Scanned by Bizo Email Filter


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


Re: [Flashcoders] Is there any grid component in AS 3.0

2008-03-11 Thread anuj sharma
Hi Jason Merill and Eric
Thanks a lot for your suggestions. i will start exploring FLEX in my project
now.
Any suggestions for good online resources or good books for that. I am going
to google that too.
Appreciate your help,
Anuj

On Tue, Mar 11, 2008 at 11:29 AM, Kerry Thompson [EMAIL PROTECTED]
wrote:

 anuj Sharma wrote:

  can I use my already AS 3.0 code in Flex . i am not sure how do these
 things
  integrate. Please let me know do I have to create a new application from
  scratch in Flex or does my already existing code going to be imported.

 Your AS3 code will probably work, but you'll need to make some
 modifications. For example, if you have declared a document class, that
 will
 be the file you will choose as your project file in Flex. Also, if you
 have
 assets in your Flash file, export them, publish it as a swf (no code, no
 timeline), and you can use the swf essentially as a library in Flex.

 I could go into more detail, but this is really a Flex topic, and this is
 a
 Flash list. Check out FlexCoders--it's high volume (a LOT of people are
 switching to Flex, it appears), but there are some bright guys there (look
 for Jason Merrill's posts), and it is, surprisingly enough, more oriented
 towards Flex.

 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] dictionary vs array

2008-03-11 Thread Hans Wichman
On a sidenote, it's pretty easy to implement for as2 too btw, although the
performance is probably not uber.
I gotta admit once you get used to object-to-object mapping ... ;)
On Tue, Mar 11, 2008 at 9:07 PM, Claus Wahlers [EMAIL PROTECTED]
wrote:

 Claus Wahlers wrote:

  An associative Array behaves similar to a Dictionary.

 (if you are using string keys)

 Cheers,
 Claus.
 ___
 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] Is there any grid component in AS 3.0

2008-03-11 Thread Glen Pike

Look at the Flex Quick Starts on Adobe Devnet...

http://www.adobe.com/devnet/flex/

Total Training do a couple of Flex 2 courses.  I liked James Talbot, but 
I found Leo Schuman's voice very sleep inducing and having been through 
the RIA one first, then the Visual Programming one was too basic 
sometimes - even though it expected a certain level of knowledge, the 
guy kept going over stuff below this.


http://www.totaltraining.com/prod/adobe/flex.asp

If you get Flex Builder - the full version, not SDK - you can follow all 
the tutorials in that, even on the trial, that's a good place to start.



anuj sharma wrote:

Hi Jason Merill and Eric
Thanks a lot for your suggestions. i will start exploring FLEX in my project
now.
Any suggestions for good online resources or good books for that. I am going
to google that too.
Appreciate your help,
Anuj

On Tue, Mar 11, 2008 at 11:29 AM, Kerry Thompson [EMAIL PROTECTED]
wrote:

  

anuj Sharma wrote:



can I use my already AS 3.0 code in Flex . i am not sure how do these
  

things


integrate. Please let me know do I have to create a new application from
scratch in Flex or does my already existing code going to be imported.
  

Your AS3 code will probably work, but you'll need to make some
modifications. For example, if you have declared a document class, that
will
be the file you will choose as your project file in Flex. Also, if you
have
assets in your Flash file, export them, publish it as a swf (no code, no
timeline), and you can use the swf essentially as a library in Flex.

I could go into more detail, but this is really a Flex topic, and this is
a
Flash list. Check out FlexCoders--it's high volume (a LOT of people are
switching to Flex, it appears), but there are some bright guys there (look
for Jason Merrill's posts), and it is, surprisingly enough, more oriented
towards Flex.

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


  


--

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


RE: [Flashcoders] Is there any grid component in AS 3.0

2008-03-11 Thread Merrill, Jason
As far as getting the tools to get started, FlashDevelop + Flex SDK is a
free option.

As for getting started, I would start at the Adobe Developer Connection,
specifically the Getting Started tab in the Flex section:

http://www.adobe.com/devnet/flex/

If you want books, Adobe Flex 2: Training from the Source is a good
tutorial book.  If you have a Lynda.com subscription, that's also a good
place to start.  I think you can get free trial subscriptions for 30
days or something as well.


Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies? 
Check out our internal  GTO Innovative Learning Blog  subscribe.




 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of anuj sharma
Sent: Tuesday, March 11, 2008 4:19 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Is there any grid component in AS 3.0

Hi Jason Merill and Eric
Thanks a lot for your suggestions. i will start exploring 
FLEX in my project now.
Any suggestions for good online resources or good books for 
that. I am going to google that too.
Appreciate your help,
Anuj

On Tue, Mar 11, 2008 at 11:29 AM, Kerry Thompson 
[EMAIL PROTECTED]
wrote:

 anuj Sharma wrote:

  can I use my already AS 3.0 code in Flex . i am not sure how do 
  these
 things
  integrate. Please let me know do I have to create a new 
application 
  from scratch in Flex or does my already existing code 
going to be imported.

 Your AS3 code will probably work, but you'll need to make some 
 modifications. For example, if you have declared a document class, 
 that will be the file you will choose as your project file in Flex. 
 Also, if you have assets in your Flash file, export them, 
publish it 
 as a swf (no code, no timeline), and you can use the swf 
essentially 
 as a library in Flex.

 I could go into more detail, but this is really a Flex 
topic, and this 
 is a Flash list. Check out FlexCoders--it's high volume (a LOT of 
 people are switching to Flex, it appears), but there are 
some bright 
 guys there (look for Jason Merrill's posts), and it is, 
surprisingly 
 enough, more oriented towards Flex.

 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

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


Re: [Flashcoders] Is there any grid component in AS 3.0

2008-03-11 Thread anuj sharma
Hi Glenn  Jason
Thank you very much for your help and resources. i will check them out.
Anuj

On Tue, Mar 11, 2008 at 1:39 PM, Glen Pike [EMAIL PROTECTED]
wrote:

 Look at the Flex Quick Starts on Adobe Devnet...

 http://www.adobe.com/devnet/flex/

 Total Training do a couple of Flex 2 courses.  I liked James Talbot, but
 I found Leo Schuman's voice very sleep inducing and having been through
 the RIA one first, then the Visual Programming one was too basic
 sometimes - even though it expected a certain level of knowledge, the
 guy kept going over stuff below this.

 http://www.totaltraining.com/prod/adobe/flex.asp

 If you get Flex Builder - the full version, not SDK - you can follow all
 the tutorials in that, even on the trial, that's a good place to start.


 anuj sharma wrote:
  Hi Jason Merill and Eric
  Thanks a lot for your suggestions. i will start exploring FLEX in my
 project
  now.
  Any suggestions for good online resources or good books for that. I am
 going
  to google that too.
  Appreciate your help,
  Anuj
 
  On Tue, Mar 11, 2008 at 11:29 AM, Kerry Thompson 
 [EMAIL PROTECTED]
  wrote:
 
 
  anuj Sharma wrote:
 
 
  can I use my already AS 3.0 code in Flex . i am not sure how do these
 
  things
 
  integrate. Please let me know do I have to create a new application
 from
  scratch in Flex or does my already existing code going to be imported.
 
  Your AS3 code will probably work, but you'll need to make some
  modifications. For example, if you have declared a document class, that
  will
  be the file you will choose as your project file in Flex. Also, if you
  have
  assets in your Flash file, export them, publish it as a swf (no code,
 no
  timeline), and you can use the swf essentially as a library in Flex.
 
  I could go into more detail, but this is really a Flex topic, and this
 is
  a
  Flash list. Check out FlexCoders--it's high volume (a LOT of people are
  switching to Flex, it appears), but there are some bright guys there
 (look
  for Jason Merrill's posts), and it is, surprisingly enough, more
 oriented
  towards Flex.
 
  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
 
 
 

 --

 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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AIR and FTP

2008-03-11 Thread Corban Baxter
wow!

On Mon, Mar 10, 2008 at 5:51 PM, Michael Avila [EMAIL PROTECTED] wrote:
 You would need to be able to communicate using the file transfer protocol
  (FTP) ...
  Try starting here:http://maliboo.pl/projects/FlexFTP/



  On Mon, Mar 10, 2008 at 3:36 PM, Corban Baxter [EMAIL PROTECTED] wrote:

   Hey guys I had seen a post a while back about someone talking about
   building a FTP client with AIR? Does anyone remember this or am I
   dreaming? It is possibly to build right?
  
   --
   Corban Baxter
   http://www.projectx4.com
   ___
   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




-- 
Corban Baxter
http://www.projectx4.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] clean scripting

2008-03-11 Thread Cor
I go for the second option.
Instanciate at the point you need it, and clear if no longer needed.
It also keep memory use limited.

HTH
C

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Allandt
Bik-Elliott (Receptacle)
Verzonden: dinsdag 11 maart 2008 18:41
Aan: flashcoders
Onderwerp: [Flashcoders] clean scripting

hi

just a semantic question really

when writing your classes, would you only declare variables in the class and
assign variables later or would you assign values straight away if you had
them?

so for instance, would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;

internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties = new CommonProperties();
private var commonY:uint = cp. commonY;
private var commonCopy:String = cp.commonCopy;
private static var title:String = Title;
private static var subtitle:String = Subtitle;

public function Class()
{
myFunc1();
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which works fine but is a little messy at the class level

or would you...:

package com.receptacle.timeline
{
//package imports
import flash.display.Sprite;

internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var commonY:uint;
private var commonCopy:String
private static var title:String
private static var subtitle:String ;

public function Class()
{
setVars();
myFunc1();
}

private function setVars()
{
cp =  new CommonProperties();
commonY = cp. commonY;
commonCopy = cp.commonCopy;
title = Title;
subtitle = Subtitle;
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
}

which seems cleaner but is more round the houses.

thanks in advance
a


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


--
No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
13:41


No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
13:41
 

No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
13:41
 

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


Re: [Flashcoders] Is there any grid component in AS 3.0

2008-03-11 Thread anuj sharma
One more question guys. I installed Flex 3.0 builder. It is 60 days free
trial. For my purpose do you think I should go for Builder 2.0 and not 3.0as
3.0 is kind of new. What would you recommend guys. i am also finding books
and online material hard to find for 3.0. Please let me know.
Thanks
Anuj

On Tue, Mar 11, 2008 at 2:10 PM, anuj sharma [EMAIL PROTECTED] wrote:

 Hi Glenn  Jason
 Thank you very much for your help and resources. i will check them out.
 Anuj


 On Tue, Mar 11, 2008 at 1:39 PM, Glen Pike [EMAIL PROTECTED]
 wrote:

  Look at the Flex Quick Starts on Adobe Devnet...
 
  http://www.adobe.com/devnet/flex/
 
  Total Training do a couple of Flex 2 courses.  I liked James Talbot, but
  I found Leo Schuman's voice very sleep inducing and having been through
  the RIA one first, then the Visual Programming one was too basic
  sometimes - even though it expected a certain level of knowledge, the
  guy kept going over stuff below this.
 
  http://www.totaltraining.com/prod/adobe/flex.asp
 
  If you get Flex Builder - the full version, not SDK - you can follow all
  the tutorials in that, even on the trial, that's a good place to start.
 
 
  anuj sharma wrote:
   Hi Jason Merill and Eric
   Thanks a lot for your suggestions. i will start exploring FLEX in my
  project
   now.
   Any suggestions for good online resources or good books for that. I am
  going
   to google that too.
   Appreciate your help,
   Anuj
  
   On Tue, Mar 11, 2008 at 11:29 AM, Kerry Thompson 
  [EMAIL PROTECTED]
   wrote:
  
  
   anuj Sharma wrote:
  
  
   can I use my already AS 3.0 code in Flex . i am not sure how do
  these
  
   things
  
   integrate. Please let me know do I have to create a new application
  from
   scratch in Flex or does my already existing code going to be
  imported.
  
   Your AS3 code will probably work, but you'll need to make some
   modifications. For example, if you have declared a document class,
  that
   will
   be the file you will choose as your project file in Flex. Also, if
  you
   have
   assets in your Flash file, export them, publish it as a swf (no code,
  no
   timeline), and you can use the swf essentially as a library in Flex.
  
   I could go into more detail, but this is really a Flex topic, and
  this is
   a
   Flash list. Check out FlexCoders--it's high volume (a LOT of people
  are
   switching to Flex, it appears), but there are some bright guys there
  (look
   for Jason Merrill's posts), and it is, surprisingly enough, more
  oriented
   towards Flex.
  
   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
  
  
  
 
  --
 
  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 mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] clean scripting

2008-03-11 Thread Cory Petosky
To clarify, this difference only matters in the case of static class
members. Anything non-static gets initialized at constructor-time
regardless -- the difference is syntax only.

On 3/11/08, Cor [EMAIL PROTECTED] wrote:
 I go for the second option.
  Instanciate at the point you need it, and clear if no longer needed.
  It also keep memory use limited.

  HTH
  C

  -Oorspronkelijk bericht-
  Van: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Namens Allandt
  Bik-Elliott (Receptacle)
  Verzonden: dinsdag 11 maart 2008 18:41
  Aan: flashcoders
  Onderwerp: [Flashcoders] clean scripting


  hi

  just a semantic question really

  when writing your classes, would you only declare variables in the class and
  assign variables later or would you assign values straight away if you had
  them?

  so for instance, would you...:

  package com.receptacle.timeline
  {
 //package imports
 import flash.display.Sprite;

 internal class Class extends Sprite
 {
 // class variable declarations
 private var cp:CommonProperties = new CommonProperties();
 private var commonY:uint = cp. commonY;
 private var commonCopy:String = cp.commonCopy;
 private static var title:String = Title;
 private static var subtitle:String = Subtitle;

 public function Class()
 {
 myFunc1();
 }

 private function myFunc1()
 {
 trace (function ran);
 trace (commonY is +commonY);
 trace (commonCopy is +commonCopy);
 trace (title is +title);
 trace (subtitle is +subtitle);
 }
 }
  }

  which works fine but is a little messy at the class level

  or would you...:

  package com.receptacle.timeline
  {
 //package imports
 import flash.display.Sprite;

 internal class Class extends Sprite
 {
 // class variable declarations
 private var cp:CommonProperties;
 private var commonY:uint;
 private var commonCopy:String
 private static var title:String
 private static var subtitle:String ;

 public function Class()
 {
 setVars();
 myFunc1();
 }

 private function setVars()
 {
 cp =  new CommonProperties();
 commonY = cp. commonY;
 commonCopy = cp.commonCopy;
 title = Title;
 subtitle = Subtitle;
 }

 private function myFunc1()
 {
 trace (function ran);
 trace (commonY is +commonY);
 trace (commonCopy is +commonCopy);
 trace (title is +title);
 trace (subtitle is +subtitle);
 }
 }
  }

  which seems cleaner but is more round the houses.

  thanks in advance
  a


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



 --
  No virus found in this incoming message.
  Checked by AVG.
  Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
  13:41


  No virus found in this incoming message.
  Checked by AVG.
  Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
  13:41


  No virus found in this outgoing message.
  Checked by AVG.
  Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
  13:41



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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] clean scripting

2008-03-11 Thread Muzak

Allthough the following no longer seems to apply in AS3, it might be good to 
know.

In AS2, if you have the following class:

class MyClass {

private var myArray:Array = new Array();

public function addItem(item:Object) {
 myArray.push(item);
}

public function get data():Array {
 return myArray;
}

}

The myArray class member will be shared across ALL instances of the class.

var instance1:MyClass = new MyClass();
var instance2:MyClass = new MyClass();

instance1.addItem(Hello World);
trace(instance1.data);
trace(instance2.data);

//output:
Hello World
Hello World

regards,
Muzak

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


Re: [Flashcoders] Is there any grid component in AS 3.0

2008-03-11 Thread Muzak

Flex 3 = Flex 2 but better ;-)

Books on Flex 2 should apply to Flex 3 as well, as the language (AS3) hasn't 
changed.


- Original Message - 
From: anuj sharma [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Tuesday, March 11, 2008 10:51 PM
Subject: Re: [Flashcoders] Is there any grid component in AS 3.0



One more question guys. I installed Flex 3.0 builder. It is 60 days free
trial. For my purpose do you think I should go for Builder 2.0 and not 3.0as
3.0 is kind of new. What would you recommend guys. i am also finding books
and online material hard to find for 3.0. Please let me know.
Thanks
Anuj



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


Re: [Flashcoders] clean scripting

2008-03-11 Thread Allandt Bik-Elliott (Receptacle)

thanks for your input everyone

i've gone for the second option because i can template it out better  
and it looks way neater (plus i can still keep all of my  
declarations in one place, the setVars() method)


thanks again

here's a copy of my template if you'd like it


//code:
package com.receptacle.timeline
{
//package imports

internal class Class
{
// class variable declarations

// constructor
public function Constructor()
{
setVars();
}

// set class variables
private function setVars()
{

}
}
}
//code


best
a


On 11 Mar 2008, at 22:20, Cory Petosky wrote:


To clarify, this difference only matters in the case of static class
members. Anything non-static gets initialized at constructor-time
regardless -- the difference is syntax only.

On 3/11/08, Cor [EMAIL PROTECTED] wrote:

I go for the second option.
 Instanciate at the point you need it, and clear if no longer needed.
 It also keep memory use limited.

 HTH
 C

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Namens Allandt
 Bik-Elliott (Receptacle)
 Verzonden: dinsdag 11 maart 2008 18:41
 Aan: flashcoders
 Onderwerp: [Flashcoders] clean scripting


 hi

 just a semantic question really

 when writing your classes, would you only declare variables in  
the class and
 assign variables later or would you assign values straight away  
if you had

 them?

 so for instance, would you...:

 package com.receptacle.timeline
 {
//package imports
import flash.display.Sprite;

internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties = new  
CommonProperties();

private var commonY:uint = cp. commonY;
private var commonCopy:String = cp.commonCopy;
private static var title:String = Title;
private static var subtitle:String = Subtitle;

public function Class()
{
myFunc1();
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
 }

 which works fine but is a little messy at the class level

 or would you...:

 package com.receptacle.timeline
 {
//package imports
import flash.display.Sprite;

internal class Class extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var commonY:uint;
private var commonCopy:String
private static var title:String
private static var subtitle:String ;

public function Class()
{
setVars();
myFunc1();
}

private function setVars()
{
cp =  new CommonProperties();
commonY = cp. commonY;
commonCopy = cp.commonCopy;
title = Title;
subtitle = Subtitle;
}

private function myFunc1()
{
trace (function ran);
trace (commonY is +commonY);
trace (commonCopy is +commonCopy);
trace (title is +title);
trace (subtitle is +subtitle);
}
}
 }

 which seems cleaner but is more round the houses.

 thanks in advance
 a


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



--
 No virus found in this incoming message.
 Checked by AVG.
 Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date:  
11-3-2008

 13:41


 No virus found in this incoming message.
 Checked by AVG.
 Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date:  
11-3-2008

 13:41


 No virus found in this outgoing message.
 Checked by AVG.
 Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date:  
11-3-2008

 13:41



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




--
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 

[Flashcoders] Debugging issue

2008-03-11 Thread anuj sharma
Hi
I am trying to debug my project and it gives me long weird message as
follows. Its saying some Security Sandbox violation.
I am loading external videos in myUILoader component using XML.All of those
directories are in the same folder.
Does anyone has any idea how would i fix that.

Any Help will be appreciated.
Thanks
Anuj

Attemping to launch and connect to Player using URL C:\Documents and
Settings\ASharma\Desktop\VCD Flash Concept\VideoForWeb\Video
Showcase\VideoShowcaseRev32ObjectRunTimeError.swf
[SWF] C:\Documents and Settings\ASharma\Desktop\VCD Flash
Concept\VideoForWeb\Video Showcase\VideoShowcaseRev32ObjectRunTimeError.swf
- 6647189 bytes after decompression
*** Security Sandbox Violation ***
Connection to
file:///C|/Documents%20and%20Settings/ASharma/Desktop/VCD%20Flash%20Concept/VideoForWeb/Video%20Showcase/Settings.xml
halted - not permitted from
file:///C|/Documents%20and%20Settings/ASharma/Desktop/VCD%20Flash%20Concept/VideoForWeb/Video%20Showcase/VideoShowcaseRev32ObjectRunTimeError.swf
SecurityError: Error #2148: SWF file
file:///C|/Documents%20and%20Settings/ASharma/Desktop/VCD%20Flash%20Concept/VideoForWeb/Video%20Showcase/VideoShowcaseRev32ObjectRunTimeError.swf
cannot access local resource
file:///C|/Documents%20and%20Settings/ASharma/Desktop/VCD%20Flash%20Concept/VideoForWeb/Video%20Showcase/Settings.xml.
Only local-with-filesystem and trusted local SWF files may access local
resources.
at flash.net::URLStream/load()
at flash.net::URLLoader/load()
at
VideoShowcaseRev32ObjectRunTimeError_fla::MainTimeline/frame1()[VideoShowcaseRev32ObjectRunTimeError_fla.MainTimeline::frame1:373]
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Debugging issue

2008-03-11 Thread Kerry Thompson
Anuj Sharma wrote: 

 I am trying to debug my project and it gives me long weird message as
 follows. Its saying some Security Sandbox violation.
 I am loading external videos in myUILoader component using XML.All of
those
 directories are in the same folder.
 Does anyone has any idea how would i fix that.

I bet you're running on Windows Vista. I've had the same problem--publish,
double-click the HTML file, and I get the security sandbox violation error.
Yet it runs fine in the IDE.

It so happens that I'm developing in Flex, using FlexBuilder 3. I haven't
seen the same thing in Flash, but then, I haven't been using Flash that much
since I got my Vista machine--most of my gigs these days are Flex gigs, or
for clients who just want a swf and html, and don't care what environment I
use. (I'm not saying Flex is better than Flash, but, as a long-time code
monkey, I like the IDE better than Flash).

I don't know what the answer is. The producers I work with use XP, and it
runs fine for them. One clue--the error I get is on IE7. Firefox gives a
more descriptive error--it says that  I have an .htm file trying to
communicate with a .swf. The .htm file in question is a fairly complex
JavaScript file--I didn't write it, so I'm not entirely sure what it's
doing, so no help there.

This may help, though: it says To let this application communicate with the
Internet, click Settings.

Long story short, try it in a different browser and see if you get a better
error message.

Cordially,

Kerry Thompson


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


RE: [Flashcoders] Debugging issue

2008-03-11 Thread Kerry Thompson
 I am trying to debug my project and it gives me long weird message as
 follows. Its saying some Security Sandbox violation.
 I am loading external videos in myUILoader component using XML.All of
those
 directories are in the same folder.
 Does anyone has any idea how would i fix that.

Oh, another thing I noticed--you have a lot of spaces in your file names.
That's not a good idea for Internet apps. Concatenate, or use an underscore
instead.

Cordially,

Kerry Thompson


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


Re: [Flashcoders] clean scripting

2008-03-11 Thread Steven Sacks

I'm going to chime in here.

Lazy Instantiation is an irrelevant argument when you're instantiating 
in the constructor.  What you perceive as cleaner is merely philosophical.


var container:Sprite = new Sprite();

vs

var container:Sprite;

public function ClassName()
{
   container = new Sprite();
}

I think the single line version is cleaner.  In fact, I would argue that 
instantiating classes in their variable declaration is a very specific 
way of making it extremely clear that those variables are being made 
available immediately to the class, and anything that does not have a 
definition is going to be lazily instantiated later.


I'm a big fan of this type of coding practice where the meaning is 
derived from the style.


My 2 cents,
Steven
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] clean scripting

2008-03-11 Thread Jesse Graupmann
Muzak,

Maybe I missed something, but instance2 in your example has no data. Only
static members can be shared across all instances - did you mean...

 
class MyClass
{
 
 private static var myArray:Array = new Array();
 
 public function addItem(item:Object)
 {
MyClass.myArray.push(item);
 }
 
 public function get data():Array 
 {
return MyClass.myArray;
 }
 
}


regards,
Jesse


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Muzak
Sent: Tuesday, March 11, 2008 4:51 PM
To: Flash Coders List
Subject: Re: [Flashcoders] clean scripting

Allthough the following no longer seems to apply in AS3, it might be good to
know.

In AS2, if you have the following class:

class MyClass {
 
 private var myArray:Array = new Array();
 
 public function addItem(item:Object) {
  myArray.push(item);
 }
 
 public function get data():Array {
  return myArray;
 }
 
}

The myArray class member will be shared across ALL instances of the class.

var instance1:MyClass = new MyClass();
var instance2:MyClass = new MyClass();

instance1.addItem(Hello World);
trace(instance1.data);
trace(instance2.data);

//output:
Hello World
Hello World

regards,
Muzak

___
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] clean scripting

2008-03-11 Thread Fumio Nonaka
Yes, you might be missed something, Jesse.  I got the same result as 
Muzak did.


// ActionScript 2.0
// frame action:
var instance1:MyClass = new MyClass();
var instance2:MyClass = new MyClass();
instance1.addItem(Hello World);
trace(instance1.data);  // Output: Hello World
trace(instance2.data);  // Output: Hello World
_
Jesse Graupmann wrote:

Muzak,

Maybe I missed something, but instance2 in your example has no data. Only
static members can be shared across all instances - did you mean...



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Muzak
Sent: Tuesday, March 11, 2008 4:51 PM
To: Flash Coders List
Subject: Re: [Flashcoders] clean scripting

Allthough the following no longer seems to apply in AS3, it might be good to
know.

In AS2, if you have the following class:

class MyClass {
 
 private var myArray:Array = new Array();
 
 public function addItem(item:Object) {

  myArray.push(item);
 }
 
 public function get data():Array {

  return myArray;
 }
 
}


The myArray class member will be shared across ALL instances of the class.

var instance1:MyClass = new MyClass();
var instance2:MyClass = new MyClass();

instance1.addItem(Hello World);
trace(instance1.data);
trace(instance2.data);

//output:
Hello World
Hello World


Good luck,
--
Fumio Nonaka
http://www.FumioNonaka.com/
My bookshttp://www.FumioNonaka.com/Books/index.html
Flash communityhttp://F-site.org/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] clean scripting

2008-03-11 Thread Jesse Graupmann
I agree with Steven. You may want to put your variable declarations in
another function when they either get suuuper messy or you need more data
(ie. stage.stageWidth).

Going back to style... typically I like to run an INIT() in the constructor
and then break down the tasks into INIT_name(). It cleans up the top pretty
well and makes the code very easy to read/understand.


package
{
import flash.display.Sprite;
import flash.events.MouseEvent;

public class MyClass extends Sprite
{
public static var prop:Number = 0;
public var solid:Sprite;

public function MyClass() 
{
INIT();
}


//  ___
EVENTS


private function click ( e:MouseEvent ):void 
{
//...
}


//  ___
INITIALIZE  

private function INIT ():void
{
INIT_clips();
INIT_vars();
}

private function INIT_clips ():void
{
solid.addEventListener ( MouseEvent.CLICK,
click );
}

private function INIT_vars ():void
{
// ...
}
}
}

2 more cents,
Jesse


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
Sent: Tuesday, March 11, 2008 6:49 PM
To: Flash Coders List
Subject: Re: [Flashcoders] clean scripting

I'm going to chime in here.

Lazy Instantiation is an irrelevant argument when you're instantiating 
in the constructor.  What you perceive as cleaner is merely philosophical.

var container:Sprite = new Sprite();

vs

var container:Sprite;

public function ClassName()
{
container = new Sprite();
}

I think the single line version is cleaner.  In fact, I would argue that 
instantiating classes in their variable declaration is a very specific 
way of making it extremely clear that those variables are being made 
available immediately to the class, and anything that does not have a 
definition is going to be lazily instantiated later.

I'm a big fan of this type of coding practice where the meaning is 
derived from the style.

My 2 cents,
Steven

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


Re: [Flashcoders] clean scripting

2008-03-11 Thread Paul Andrews
- Original Message - 
From: Allandt Bik-Elliott (Receptacle) [EMAIL PROTECTED]

To: flashcoders flashcoders@chattyfig.figleaf.com
Sent: Tuesday, March 11, 2008 5:41 PM
Subject: [Flashcoders] clean scripting



hi

just a semantic question really

when writing your classes, would you only declare variables in the  class 
and assign variables later or would you assign values straight  away if 
you had them?



I generally avoid initialisation in the class member declarations and have 
the constructor do very little, usually just calling an init() function 
(loadVars equivalent). You can then the use the init function to 
re-initialise an instance.


Paul 


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