Hi,

I'm making a site in AS3 with lots and lots of buttons.

I'm worried that all the listeners on the buttons will clog the memory.

I realize that sprites that are not in the display list cannot receive mouse events, but do they still listen for them, taking up memory?

I'm not sure how to test that.

If they do, then in the buttons I'll

1) add listeners for "added" and "removed" events to detect when the buttons are added to the display list, and

2) handle these events by toggling the mouseEnabled and mouseChildren properties off and on (that will kill and revive the listeners)

But it seems funny to kill listeners that cannot hear anything, and a hassle to add this code to all the button species I'm working with.

Thanks

Matt

On Nov 12, 2006, at 9:00 AM, flashcoders- [EMAIL PROTECTED] wrote:

Send Flashcoders mailing list submissions to
        flashcoders@chattyfig.figleaf.com

To subscribe or unsubscribe via the World Wide Web, visit
        http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Flashcoders digest..."


Today's Topics:

   1. Re: functions outside a class (Helmut Granda)
2. Re: Faking 3D perspective of a 2D map in Flash 8..? (Zeh Fernando)
   3. Re: OO way to start RIA app (Mark Lapasa)
4. Re: Faking 3D perspective of a 2D map in Flash 8..? (Hans Wichman)
   5. Re: Faking 3D perspective of a 2D map in Flash    8..? (Mike Nowak)
   6. RE: functions outside a class (Mike Keesey)
   7. Re: Faking 3D perspective of a 2D map in Flash    8..? (Mike Nowak)
   8. Noob question: Text effects, apps/components? (Micky Hulse)
   9. Google queries / iweb services / API in A.S. 2.0. (Millie Niss)
  10. frustrated with textFields: getting height while text     isn't
      fully 'there' (grimmwerks)


----------------------------------------------------------------------

Message: 1
Date: Fri, 10 Nov 2006 13:45:34 -0600
From: "Helmut Granda" <[EMAIL PROTECTED]>
Subject: [Flashcoders] Re: functions outside a class
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

ok, i figured it out.

it works if i make reference to where the function is.

this.function();
_parent.function();

if i just call the function:

function();

it is where I was getting stuck, but it all works now.

...

On 11/10/06, Helmut Granda <[EMAIL PROTECTED]> wrote:

I have several classes that will use a function. for scope reasons i have placed the function in a different file but i would like to be able to
access that file from within the classes.

If the function has been declared outside the class, what is the best way
to accces those functions?

sample:

utils.controls:
classA
classB

utils/functions:
functionA
functionB

main timeline:
include functionA
include functionB

now I would like to access functionA or functionB within the class...

TIA

--
...helmut




--
...helmut
helmutgranda.com


------------------------------

Message: 2
Date: Fri, 10 Nov 2006 17:46:11 -0200
From: "Zeh Fernando" <[EMAIL PROTECTED]>
Subject: Re: [Flashcoders] Faking 3D perspective of a 2D map in Flash
        8..?
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
        reply-type=original

So far I've only been able to achieve that in Illustrator and then saving the perspectively squished vectors as a .swf What I'd love to do is to
get
that perspective squish done within Flash 8 using script.
I know about 3D program extensions for Flash like Sandy, but I find them
cryptic (at best) and over kill for my simple needs.

Using something like Sandy is the only choice you have. For example:

http://sandy.media-box.net/blog/distortimage-20-the-fastest-way-to- freely-distort-image-with-flash-in-actionscript.html http://sandy.media-box.net/blog/distordimage-the-way-to-distord- bitmaps-by-code.html

You need something like this. This is done by dividing an image in triangles
and then projecting them.

But you'd still have to be careful, as simple distortion ISN'T perspective. The above examples are simply distorting the image, but not accounting for proximity (it's just squishing the texture). If you get a side too thin,
it'll just look thin, not "far".

This is an old example, but uses a similar approach but with correct
calculation (each side of the box is made of 4 triangles):

http://www.nkag.co.jp/

For something like that, you'd need to either build a complex plane with Sandy, using a bunch of squares (so it will do correct perspective, or close to it anyways), or build the whole calculation and projection yourself.
Which can be done, but will probably take some time.

If you have a VERY simple drawing, you could directly draw it using the drawing API. You'd need to encode all your points and redraw based on 3d positions. This would be the best choice quality wise, but again depends on
how your 'image' is, and could be quite slow.



Zeh



------------------------------

Message: 3
Date: Fri, 10 Nov 2006 14:51:34 -0500
From: Mark Lapasa <[EMAIL PROTECTED]>
Subject: Re: [Flashcoders] OO way to start RIA app
To: Flashcoders mailing list <flashcoders@chattyfig.figleaf.com>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

This is advice is not exclusive to the realm of ActionScript but to OO
in general. Unless carefully orchestrated, making method calls from
within the constructor can result in unexpected results. It becomes more
apparent when derived classes are instantiated and there is confusion
between expecting a derived class to be initialized but the base class
has not been fully initialized.

The other thing to note is that ActionScript does not have
deconstructors (with the exception of MovieClip.onUnload which I find
great). So when finishing an application, your objects must also know
how to 'finish' themselves and those objects that it created. If you put great care into making a constructor method in each of your classes, you should put some thought in a dispose() method which will be responsible
for cleaning up what it started (for example, remove the movieclips it
created dynamically).


-mL
http://knowledge.lapasa.net

[EMAIL PROTECTED] wrote:
Hello,

Recently had to re-jig the start-up sequence to an AS2 flash app - caused
lots of unexpected side-effects

Struck me that there must be an agreed OO way to start/finish an
application.


Does anyone have some useful advice on best practice for app start- up from
an AS2 perpective?


regards

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com







------------------------------

Message: 4
Date: Fri, 10 Nov 2006 20:54:54 +0100
From: "Hans Wichman" <[EMAIL PROTECTED]>
Subject: Re: [Flashcoders] Faking 3D perspective of a 2D map in Flash
        8..?
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

do you mean something like this:
http://www.strille.net/works/misc/z_mapping/z_mapping.html

greetz
JC


On 11/10/06, Paul Steven <[EMAIL PROTECTED]> wrote:

This site will hopefully help you on your way

http://www.kirupa.com/developer/actionscript/3dindex.htm



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew
Murphy
Sent: 10 November 2006 18:32
To: Flash Coders
Subject: [Flashcoders] Faking 3D perspective of a 2D map in Flash 8..?

Hello.

I'm trying to take a vector map of North America and produce the sense of 'flying over' it. I want to have the flat map tipped along the X axis, so that the bottom (Florida, Texas, etc.) appear closer and the top (Nunuvut,
Greenland, etc.) appear farther away.

Then I want to be able to pan the map left and right, up and down, and 'zoom' in by scaling it.. scaling it a little faster vertically so that it
seems to flatten out a bit as you "get closer to the ground".

So far I've only been able to achieve that in Illustrator and then saving the perspectively squished vectors as a .swf What I'd love to do is to
get
that perspective squish done within Flash 8 using script.

I know about 3D program extensions for Flash like Sandy, but I find them
cryptic (at best) and over kill for my simple needs.

Any suggestions..?

Thanks. :)


- - - - - - - - -
-[andrew murphy]-
flash developer
[EMAIL PROTECTED]

delvinia interactive inc.
214 king street west, suite 214
toronto canada M5H 3S6
voice 416.364.1455 ext. 232
cell 416.820.8723
fax 416.364.9830
www.delvinia.com

CONFIDENTIALITY NOTICE
This email message may contain privileged or confidential information. If
you are not the intended recipient or received this communication by
error,
please notify the sender and delete the message without copying or
disclosing it.

AVIS DE CONFIDENTIALITÉ
Ce message peut contenir de l'information légalement privilégiée ou
confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir reçu
par
erreur ce message, nous vous saurions gré d'en aviser l'émetteur et d'en
détruire le contenu sans le communiquer a d'autres ou le reproduire.



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.14.1/527 - Release Date: 09/11/2006
6:00 PM

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



------------------------------

Message: 5
Date: Fri, 10 Nov 2006 14:11:53 -0600
From: "Mike Nowak" <[EMAIL PROTECTED]>
Subject: Re: [Flashcoders] Faking 3D perspective of a 2D map in Flash
        8..?
To: <flashcoders@chattyfig.figleaf.com>, <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII

[EMAIL PROTECTED] 11/10/2006 1:32:09 PM >>>
Hello.

I'm trying to take a vector map of North America and produce the sense of 'flying over' it. I want to have the flat map tipped along the X axis, so that the bottom (Florida, Texas, etc.) appear closer and the top (Nunuvut,
Greenland, etc.) appear farther away.

--------

Like so?

http://www.kaourantin.net/2006/11/spidermonkeys-relative-tamarin- joins.html






------------------------------

Message: 6
Date: Fri, 10 Nov 2006 12:27:05 -0800
From: "Mike Keesey" <[EMAIL PROTECTED]>
Subject: RE: [Flashcoders] functions outside a class
To: "'Flashcoders mailing list'" <flashcoders@chattyfig.figleaf.com>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;       charset="iso-8859-7"

If these are functions that don't reference a particular instance (i.e.,
don't use the "this" keyword), then it's better to make a static
utilities class (similar to, e.g., Flash's Math class):

class utils.controls.MyFunctions { // Think of a better name....
        public static function functionA():Void {
                // ...
        }
        public static function functionB():Void {
                // ...
        }
}

// In your class:

import utils.controls.MyFunctions;
class utils.controls.ClassA {
        public function someFunction():Void {
                // ...
                MyFunctions.functionA();
                MyFunctions.functionB();
        }
}

¯
Mike Keesey

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Helmut Granda
Sent: Friday, November 10, 2006 11:30 AM
To: Flashcoders mailing list
Subject: [Flashcoders] functions outside a class

I have several classes that will use a function. for scope reasons i
have
placed the function in a different file but i would like to be able to
access that file from within the classes.

If the function has been declared outside the class, what is the best
way
to
accces those functions?

sample:

utils.controls:
classA
classB

utils/functions:
functionA
functionB

main timeline:
include functionA
include functionB

now I would like to access functionA or functionB within the class...

TIA

--
...helmut
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



------------------------------

Message: 7
Date: Fri, 10 Nov 2006 14:36:09 -0600
From: "Mike Nowak" <[EMAIL PROTECTED]>
Subject: Re: [Flashcoders] Faking 3D perspective of a 2D map in Flash
        8..?
To: <flashcoders@chattyfig.figleaf.com>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII

[EMAIL PROTECTED] 11/10/2006 1:32:09 PM >>>

Any suggestions..?
---

Sorry, pasted the wrong URL. I meant this:
http://gotoandplay.it/_articles/2005/10/mode7.php

Or just do a search for "mode7" and "Flash". Not "true" 3D, but I think it's what you're trying to do.




------------------------------

Message: 8
Date: Sat, 11 Nov 2006 19:52:16 -0800
From: Micky Hulse <[EMAIL PROTECTED]>
Subject: [Flashcoders] Noob question: Text effects, apps/components?
To: Flashcoders mailing list <flashcoders@chattyfig.figleaf.com>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi all,

Sorry if this is noob question, but it has been several months since I
have had to do fancy text effects in Flash... I am on XP pro using
FP8... What is currently the best component or external app for creating
flash-based text effects?

Swishmax still the standard?
<http://snipurl.com/iwzt>

I do not need a ka-zillion effects, just looking for a tool to help
streamline production (but prefer non-cheezy FX).

Any links/tips/suggestions you guys/gals can give me would be fabulous. :)

Many thanks in advance.
Cheers,
Micky

--
  Wishlist: <http://snipurl.com/vrs9>
    Switch: <http://browsehappy.com/>
      BCC?: <http://snipurl.com/w6f8>
        My: <http://del.icio.us/mhulse>


------------------------------

Message: 9
Date: Sun, 12 Nov 2006 11:07:15 -0500
From: "Millie Niss" <[EMAIL PROTECTED]>
Subject: [Flashcoders] Google queries / iweb services / API in A.S.
        2.0.
To: <flashcoders@chattyfig.figleaf.com>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
        reply-type=response

Please forgive me if this is a repost. It did not appear for over 24 hours after I posted it. I changed the subject line in case the spam filters
blocked it due to killwords in the subject...

This may be a very stupid question, but I did search online and not find the answer. I saw examples of Flash apps (eg the quite fun Guess-the- Google http://grant.robinson.name/projects/guess-the-google/ game) that grab images from Google Image search, but I couldn't find any coding examples. I don't even know if the right way to do it is stupidly low-tech (by making a query string URL and parsing the page Google returns) or involves web services
etc. (which I have never used).

I am supposed to call the potential client tonight to tell her whether I can do it and how much work is involved etc. She hired someone else a few years ago (a "professional programmer" on her campus IT staff) to do it who was unable to figure out how to grab Google images and incorporate them into the page. He used Javascript/DHTML as the front end. I intend to use Flash as
there are many multimedia elements.

I have a potential client who wants their site to incorporate Google Image Search results. I have never used Google web services or their APIs, so I don't know how much work this will involve and what server side resources
are required.  I will be using Flash 8 and PHP (if necessary).

Also, do people use the Flash webservices component/class for anything real or does one always end up doing one's own server-side coding (aside from wrapping the web services call to get around security restrictions)? Is there a reason to use a web service rather than constructing a query
string and parsing the results?

Forgive me if this is newbieish. I am a server side newbie, but not an
Actionscript newbie.

Millie Niss
[EMAIL PROTECTED]
http://www.sporkworld.org




------------------------------

Message: 10
Date: Sun, 12 Nov 2006 02:09:15 -0500
From: grimmwerks <[EMAIL PROTECTED]>
Subject: [Flashcoders] frustrated with textFields: getting height
        while text      isn't fully 'there'
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

This is totally driving me crazy.

I'm creating a textfield as a sub to another clip, setting it's width,
making it autosized, giving it a stylesheet. I then toss in it's
htmlText.

I just want to know if the darn thing is one or more lines. Trouble is
it's not reporting back properly...it seems as if it's just in the
middle of adjusting itself or something, as if I trace out a lot of
stuff, it works out fine. But I shut off tracing, and it stops
working.

For example:

var mTitle:TextField = mcTxt.createTextField("mc_title", 6, tR.x+20,
tR.y-14, 230, 0);
mTitle.autoSize = "right";
mTitle.wordWrap=true;
mTitle.selectable=false;
mTitle.html = true;
mTitle.border=true;
mTitle.multiline = true;
mTitle.styleSheet =_global.gPrefs.CSS;
mTitle.htmlText = title;

fontsize = 30; // i know this
lCnt = (mTitle.textHeight/fontSize);

Sometimes lCnt works and sometimes it doesn't -- and I'm tracing out
all elements.

I've even tried to do something like
while(mTitle.htmlText!=title){
  trace("not there");
}

But that doesn't work either.


------------------------------

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

End of Flashcoders Digest, Vol 22, Issue 35
*******************************************


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to