Re: [Flashcoders] using graphics from flash 8 with flex 2 sdk

2008-01-19 Thread Gregory N
Thanks, Jan and Glen :-)
Even embedding each symbol separately is great.

Yesterday I've just (mistakenly) supposed to access internal clips by
their names, as we did in AS2...
Obviously it's not possible.
Just out of curiosity:
if we access them via getChildAt() , do you think there's some relation
between clip's position/layer/name/etc in container mc (in Flash 8 IDE)
and the position in child list (idx variable in Glen's code below)?

Glen Pike wrote:

I have managed to access movie clips inside an embedded symbol, but
 purely to manipulate them as movieclips.

To avoid confusion - I have no code inside the SWF file I am
 embedding, I am merely using Flash 8 IDE to author graphical symbols 
 animations which I embed individually.  Some of these clips have nested
 clips too.

Here is an example:

//Embed the symbol Block, which has a number of clips inside it.
[Embed (source = ../resources/graphics.swf, symbol=Block)]
private var Block:Class;

//...

//Create an instance of a Block
_block:MovieClip = new Block() as MovieClip;
//Loop through and stop all the child clips using the child access
 methods of AS3
var children:int = _block.numChildren;
for (var idx:int = 0; idx  children;idx++ ) {
  var child:MovieClip = _block.getChildAt(idx) as MovieClip;
  child.stop();
}



//Later in the code, do collision detection on each child clip in
 the Block and manipulate it as a movieclip.
function hitTestBlock(block:MovieClip, ball:Sprite) {
var children:int = block.numChildren;
for (var idx:int = 0; idx  children;idx++ ) {
  var child:MovieClip = block.getChildAt(idx) as MovieClip;
  if(child.hitTestObject(ball)) {
  child.nextFrame();
  //optimise for speed by removing clips that are dead.
  if(child.totalFrames == child.currentFrame) {
  block.removeChild(child);
  }
  return true;
  }
   }
   return false;
}



HTH

Glen


 Ian Thomas wrote:
  I can just embed one container mc symbol ?


  In short, I don't know - never tried using the container mc idea.
 
  Thinking about it, though, I suspect that you won't be able to access
 the
  subclips via new MySubClipSymbolID(); however, if you instantiate the
  containing clip (new MyTopLevelSymbolID() or whatever) you may be able
 to
  access the children via getChildAt() etc.
 
  That's probably not a hugely useful thing to be able to do, though.
 
  I'm guessing it's most useful to embed each symbol.
 




-- 
-- 
Best regards,
GregoryN

http://GOusable.com
Flash components development.
Usability services.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] osX - ActionScript Editor

2008-01-19 Thread Cor
Try FlashDevelop.
It has a very nice auto-completion. 

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Karim Beyrouti
Verzonden: donderdag 17 januari 2008 14:20
Aan: 'Flash Coders List'
Onderwerp: [Flashcoders] osX - ActionScript Editor

 Hi All, I know this is an old topic. I am looking for a good As2 ( and
maybe As3 ) editor for OS-X. for the moment I have found these:

http://macromates.com/ - which has not got great reviews.
http://www.jedit.org/ - 

I have tried SEPY but was unable to get it working. 

Am I missing anything?... do you have any good recommendations? 


regards


Karim

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


--
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.6/1230 - Release Date: 17-1-2008
16:59


No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.6/1230 - Release Date: 17-1-2008
16:59
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.7/1232 - Release Date: 18-1-2008
19:32
 

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


Re: [Flashcoders] How much memory elements on the display list take?

2008-01-19 Thread Helmut Granda
Thanks for the comments Eric... When writing code I was thinking more on the
lines of this:

current Coding:

var myelement1 = new Element
myelement1.alpha = 0;
addChild(myelement1);
var myelement2 = new Element
myelement2.alpha = 0;
addChild(myelement2);
var myelement3 = new Element
myelement3.alpha = 0;
addChild(myelement3);
var myelement4 = new Element
myelement4.alpha = 0;
addChild(myelement4);

new Idea of coding:

private function initElements() : void {
var myelement1 = new Element;
var myelement2 = new Element;
var myelement3 = new Element;
var myelement4 = new Element;
}

private function addToDisplay: void {
addChild(myelement1);
addChild(myelement2);
addChild(myelement3);
addChild(myelement4);
}

during the application controling the view of each elment with alpha
rather than adding them or removing them from the displaylist

element1.alpha = 0
element2.alpha = 1

With the second idea when some one looks at the application it might be
easier for some one to read it than the first option...

On 1/18/08, eric e. dolecki [EMAIL PROTECTED] wrote:

 i believe you can remove children from the displayList without destroying
 them... which is better than using alpha or visible because alpha and
 visibility are still on the as2 display list eventhough you cant see em.

 On Jan 18, 2008 5:39 PM, Helmut Granda [EMAIL PROTECTED] wrote:

  I was wondering if anyone knows how much memory any object that is added
  to
  the display list take... for example I have 4 main elements that I need
  during the time the application is running, this 4 main elements contain
  many children so at the time I am adding and deleting items to the
 display
  list as needed (addChild). but to make my application more readable I
 was
  wondering if I could just have a function that instantiate all the
 objects
  and a second method that adds all the elements i need to the display
 list
  and then control  the elements with the alpha or visible property.
 
  TIA
 
  --
  ...helmut
  ___
  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




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


RE: [Flashcoders] osX - ActionScript Editor

2008-01-19 Thread Karim
I really really liked eclipse - for the moment I am using ASDT ( for AS2
project ), and will get FDT as that seems better. 

However, 

I cannot find the shortcut to toggle code folding for branches. 
I have found the keys, customization in Eclipse, but can't get it to work?

Any ideas..?


Thanks for the suggestions.



- karim



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 17 January 2008 13:40
To: Flash Coders List
Subject: Re: [Flashcoders] osX - ActionScript Editor

Eclipse with FDT

good luck,
Elia
- Original Message - 
From: Karim Beyrouti [EMAIL PROTECTED]
To: 'Flash Coders List' flashcoders@chattyfig.figleaf.com
Sent: Thursday, January 17, 2008 2:20 PM
Subject: [Flashcoders] osX - ActionScript Editor


 Hi All, I know this is an old topic. I am looking for a good As2 ( and
 maybe As3 ) editor for OS-X. for the moment I have found these:
 
 http://macromates.com/ - which has not got great reviews.
 http://www.jedit.org/ - 
 
 I have tried SEPY but was unable to get it working. 
 
 Am I missing anything?... do you have any good recommendations? 
 
 
 regards
 
 
 Karim
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.6/1230 - Release Date: 17/01/2008
16:59
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.7/1232 - Release Date: 18/01/2008
19:32
 

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


Re: [Flashcoders] How much memory elements on the display list take?

2008-01-19 Thread Paul Andrews
Helmut, I think you are finding yourself a tricky way of building 
applications.


If you can give us an idea of what you're trying to build I'm sure we can 
chime in with a lot of good ideas that will be easier than your current 
route.


For example if you attach elements to a movieclip, you can control panel 
displays by moving/hiding the movieclip to which they are attached, rather 
than have to mess around with every individual element.


Paul

- Original Message - 
From: Helmut Granda [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Saturday, January 19, 2008 5:07 PM
Subject: Re: [Flashcoders] How much memory elements on the display list 
take?



Thanks for the comments Eric... When writing code I was thinking more on 
the

lines of this:

current Coding:

var myelement1 = new Element
myelement1.alpha = 0;


snip 


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


Re: [Flashcoders] How much memory elements on the display list take?

2008-01-19 Thread Paul Andrews
Well, it sounds as though each of these elements should be on separate movie 
clips each with elements attached. Extract as much functionality into 
separate classes and put as little actionscript onto the timeline as you 
can. You can switch between the main elements by hopping to different frames 
on the timeline. Try and look at a few Flash application examples, 
particularly flash frameworks (just google flash frameworks) that will help 
structure your code if you follow them.


It also sounds like an application rather than a game or eye candy. I know 
this is a flash list, but Flex is better suited to this kind of development.


Paul
- Original Message - 
From: Helmut Granda [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Saturday, January 19, 2008 6:55 PM
Subject: Re: [Flashcoders] How much memory elements on the display list 
take?




Hi Paul,

I am building an application with 4 main elements that talk to each other
during the life of the application, each element contains several elements
that vary from 10 to maybe 100.

As I am writing this application I am trying to write it with the idea 
that
in the future when I need to make updates I could see clearly what is 
going
on or if some one else picks up this application they are able to 
understand
it. often we pick/develop applications that only we can understand add 
that

AS3 and you have a lot of spaghetti code that is passed around from
developer to developer and few years later the applications have to be
rewritten because there was not a basic structure followed since the
beginning.

In the end it might be just a personal code style rather than a software
developer question... thanks for chiming in.

On 1/19/08, Paul Andrews [EMAIL PROTECTED] wrote:


Helmut, I think you are finding yourself a tricky way of building
applications.

If you can give us an idea of what you're trying to build I'm sure we can
chime in with a lot of good ideas that will be easier than your current
route.

For example if you attach elements to a movieclip, you can control panel
displays by moving/hiding the movieclip to which they are attached, 
rather

than have to mess around with every individual element.

Paul

- Original Message -
From: Helmut Granda [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Saturday, January 19, 2008 5:07 PM
Subject: Re: [Flashcoders] How much memory elements on the display list
take?


 Thanks for the comments Eric... When writing code I was thinking more 
 on

 the
 lines of this:

 current Coding:

 var myelement1 = new Element
 myelement1.alpha = 0;

snip

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





--
...helmut
___
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] How much memory elements on the display list take?

2008-01-19 Thread Helmut Granda
Thanks for the comments Paul... in fact this application is timeline
independent, I am using flash for 2 purposes, 1 to add items to the library
and 2 to compile the movie. The reason why I couldnt go the Flex route is
because first I dont know Flex enough to develop something like this in
there and second the app is very eye candy. Sorry I can share more info or
show some screen shots but its one of those things that you cant discuss
openly until is out.. thanks again...

On 1/19/08, Paul Andrews [EMAIL PROTECTED] wrote:

 Well, it sounds as though each of these elements should be on separate
 movie
 clips each with elements attached. Extract as much functionality into
 separate classes and put as little actionscript onto the timeline as you
 can. You can switch between the main elements by hopping to different
 frames
 on the timeline. Try and look at a few Flash application examples,
 particularly flash frameworks (just google flash frameworks) that will
 help
 structure your code if you follow them.

 It also sounds like an application rather than a game or eye candy. I know
 this is a flash list, but Flex is better suited to this kind of
 development.

 Paul
 - Original Message -
 From: Helmut Granda [EMAIL PROTECTED]
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Sent: Saturday, January 19, 2008 6:55 PM
 Subject: Re: [Flashcoders] How much memory elements on the display list
 take?


  Hi Paul,
 
  I am building an application with 4 main elements that talk to each
 other
  during the life of the application, each element contains several
 elements
  that vary from 10 to maybe 100.
 
  As I am writing this application I am trying to write it with the idea
  that
  in the future when I need to make updates I could see clearly what is
  going
  on or if some one else picks up this application they are able to
  understand
  it. often we pick/develop applications that only we can understand add
  that
  AS3 and you have a lot of spaghetti code that is passed around from
  developer to developer and few years later the applications have to be
  rewritten because there was not a basic structure followed since the
  beginning.
 
  In the end it might be just a personal code style rather than a software
  developer question... thanks for chiming in.
 
  On 1/19/08, Paul Andrews [EMAIL PROTECTED] wrote:
 
  Helmut, I think you are finding yourself a tricky way of building
  applications.
 
  If you can give us an idea of what you're trying to build I'm sure we
 can
  chime in with a lot of good ideas that will be easier than your current
  route.
 
  For example if you attach elements to a movieclip, you can control
 panel
  displays by moving/hiding the movieclip to which they are attached,
  rather
  than have to mess around with every individual element.
 
  Paul
 
  - Original Message -
  From: Helmut Granda [EMAIL PROTECTED]
  To: Flash Coders List flashcoders@chattyfig.figleaf.com
  Sent: Saturday, January 19, 2008 5:07 PM
  Subject: Re: [Flashcoders] How much memory elements on the display list
  take?
 
 
   Thanks for the comments Eric... When writing code I was thinking more
   on
   the
   lines of this:
  
   current Coding:
  
   var myelement1 = new Element
   myelement1.alpha = 0;
 
  snip
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 
  --
  ...helmut
  ___
  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




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


Re: [Flashcoders] How much memory elements on the display list take?

2008-01-19 Thread Paul Andrews
- Original Message - 
From: Matt S. [EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Saturday, January 19, 2008 11:29 PM
Subject: Re: [Flashcoders] How much memory elements on the display list 
take?




On Jan 19, 2008 2:43 PM, Paul Andrews [EMAIL PROTECTED] wrote:
can. You can switch between the main elements by hopping to different 
frames

on the timeline.


I know this was a common AS2 technique, but is that true of AS3? I
thought that the timeline was kind of out the window (except for true
frames-over-time actions within individual MC's) with AS3. And just to
be clear, I'm not asking to be critical, but rather because I'm in the
middle of trying to wrap my AS2-mind around AS3 :)


I do virtually all my AS3 coding using Flex, with no timeline, but often 
using the layout containers and other features that I don't think are in 
Flash CS3. I have developed using Flash AS1/2 without using the timeline, 
but usually using a hybrid - small animations using the time line but 
contained in MovieClips, loaded and controlled from actionscript in a main 
movie only having actionscript on one frame (to kick off) - sometimes in 
classes, sometimes not.


Yes, you're right about my suggestion being a common AS2 technique, but I 
thought it's an easier approach for Helmut rather than the full blown thing. 
I don't think that using AS3 necessarilly means abandoning all flash 
techniques from the past.


Paul


.m
___
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] How much memory elements on the display list take?

2008-01-19 Thread Helmut Granda
Hi Matt,

You can use the timeline if you like and still develop a project with AS3
the similar way as you would do with AS2. You have your library, your
timeline your tweens... it is just a matter of the process on what you are
working on.

I hope this doesn't confuse you more! :)

On 1/19/08, Matt S. [EMAIL PROTECTED] wrote:

 On Jan 19, 2008 2:43 PM, Paul Andrews [EMAIL PROTECTED] wrote:
  can. You can switch between the main elements by hopping to different
 frames
  on the timeline.

 I know this was a common AS2 technique, but is that true of AS3? I
 thought that the timeline was kind of out the window (except for true
 frames-over-time actions within individual MC's) with AS3. And just to
 be clear, I'm not asking to be critical, but rather because I'm in the
 middle of trying to wrap my AS2-mind around AS3 :)

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




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