Hello All,
Long time. If your available at the moment, I could use your help with
some AS3.
I finally got an AS3 job! Yay! But I am stuck on the most simple of
things.
All I am trying to do is make some buttons work... lol
Here is my code.
button1_btn.buttonMode = true;
Try removing:
button1_btn.mouseChildren = false;
button2_btn.mouseChildren = false;
Your code is a bit convoluted!
divers_btn.addEventListener(MouseEvent.CLICK, function() {
gotoAndStop(divinedivers); });
scuba_btn.addEventListener(MouseEvent.CLICK, function() {
gotoAndStop(scubadudes); });
Hi Karl,
jus keep breathin;), this will pass and you'll never go back to as2 again;).
Anyway on subject, have you tried out the standard SimpleButton class?
If it doesnt fit your need, why not, maybe we can help with that, but
that class should work for most simple cases.
In addition, do you
function() { gotoAndStop(divinedivers); });
Yeah, this is weird and unnecessary. Anonymous functions are recommended
against in AS3.
Jason Merrill
Instructional Technology Architect II
Bank of America Global Learning
703.302.9265 (w/h)
___
-Original
On 24/10/2012 14:43, Merrill, Jason wrote:
function() { gotoAndStop(divinedivers); });
Yeah, this is weird and unnecessary. Anonymous functions are recommended
against in AS3.
Really?
I used to be of the same opinion, but certainly not as a blanket rule.
It all depends.
Jason Merrill
Plus, anonymous functions can throw off your scope, so your buttons could
fail...
Jason Merrill
Instructional Technology Architect II
Bank of America Global Learning
703.302.9265 (w/h)
___
-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
Ok, what's a good case to use them? Just curious, I have never found a
situation where they were warranted.
Jason Merrill
Instructional Technology Architect II
Bank of America Global Learning
703.302.9265 (w/h)
___
-Original Message-
From:
anon functions benefit from coding speed and lose all benefits of static typing,
this is why they are perfectly suited to javascript and poor tools in as3.0,
although i try to avoid them in js also because i prefer code organization over
script size -- i let uglify.js take care of that part.
That still isn't an argument to use them in my opinion, personally I think the
code is much more convoluted that way. Your argument is essentially it's a
preference in coding style, not that there are situations that specifically
call for their use.
Jason Merrill
Instructional Technology
On 24/10/2012 15:08, Merrill, Jason wrote:
Ok, what's a good case to use them? Just curious, I have never found a
situation where they were warranted.
Sometimes (depending on what your buttons do), it seems rather
artificial to have to fabricate a stand-alone function to handle an
event when
Jason, I wasn't arguing anything except that IMHO using them makes code
more readable in some circumstances. It's not an either/or.
We can agree to differ.
On 24/10/2012 15:23, Merrill, Jason wrote:
That still isn't an argument to use them in my opinion, personally I think the
code is much
Right, it's cool, we're on the same page, my only point is there is no
functional reason to use them (no pun intended) and in my personal opinion,
they have more potential to introduce problems.
Jason Merrill
Instructional Technology Architect II
Bank of America Global Learning
Hi Karl,
Hahahaha, AS3 is very much easier then AS2.
But can be a little tricky to grasp when you are switching.
Believe me, once you see the structure, you don't understand that AS2 has ever
existed.
First the Q: How do you use a button instead of a MC.
There is no difference, they are
Thanks Paul.. I will try that.
On Oct 24, 2012, at 7:33 AM, Paul A. wrote:
Try removing:
button1_btn.mouseChildren = false;
button2_btn.mouseChildren = false;
Your code is a bit convoluted!
divers_btn.addEventListener(MouseEvent.CLICK, function()
{ gotoAndStop(divinedivers); });
Your not the only one who has said that about AS2.. lol
I know nothing about any AS3 classes. Frankly they confuse me with the
whole extend and static and public and aa!
Makes my brain hurt just thinking about how I MUST learn them or fade
into AS2 history.
Karl
On Oct 24, 2012, at
OH? What is the best coding standards way?
I used an annon function because
button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1));
Does not work.
Karl
On Oct 24, 2012, at 8:43 AM, Merrill, Jason wrote:
function() { gotoAndStop(divinedivers); });
Yeah, this is weird and
I am glad I could get the blood stirring in this list again. :P
Karl
On Oct 24, 2012, at 10:02 AM, Merrill, Jason wrote:
Right, it's cool, we're on the same page, my only point is there is
no functional reason to use them (no pun intended) and in my
personal opinion, they have more
Thank you Cor!
The buttons are MCs placed on the stage. At first they were Buttons,
but when they wouldn't change even the states within the Button, so I
converted them to MCs.
Also, what does the
, false, 0, true);
do? Does it have to do with removing the listener?
uhg im not going to
Hi Karl,
when you are starting with as3: whatever works :)).
Basically both will work (anon and nonanon (double wow)), but anonymous
is harder (read impossible) to remove.
So if you create a view that exists throughout the lifetime of the app,
with buttons that do the same, either way will
I've got Todd Perkins book
But project is due today, so no time to read.
Must dive head first into this empty pool. :P
Karl
On Oct 24, 2012, at 2:58 PM, Hans Wichman wrote:
Hi Karl,
when you are starting with as3: whatever works :)).
Basically both will work (anon and nonanon (double
Karl DeSaulniers skriver:
Thank you Cor!
The buttons are MCs placed on the stage. At first they were Buttons, but
when they wouldn't change even the states within the Button, so I
converted them to MCs.
Also, what does the
, false, 0, true);
do? Does it have to do with removing the
So will this work?
divers_btn.addEventListener(MouseEvent.ROLL_OVER, function()
{ this.gotoAndStop(OVER);});
I mean. Will this = divers_btn? or do I HAVE to specify
divers_btn.gotoAndStop()?
After all I am applying the listener to it.
@jason Not that I am going to continue with annon
Karl,
, false, 0, true);
I need the false, 0, to get to the third param.
Which when set (weak reference) to true gives the garbage collector the
oppurtunity to clear the listener and free up resources.
Not necessary but I like to clean up.
@Being that this is a clients FLA, I am not able to
try this:
divers_btn.addEventListener(MouseEvent.ROLL_OVER, function(e:MouseEvent):void
{ e.target.gotoAndStop(OVER);});
Karl DeSaulniers k...@designdrumm.com schreef:
So will this work?
divers_btn.addEventListener(MouseEvent.ROLL_OVER, function()
{ this.gotoAndStop(OVER);});
I
Thanks Henrik,
Well for this, there are two buttons on stage.
When you hover over one it makes a message appear, if the other
another message appears.
So if I dont use those, your saying that when I roll out, the listener
is removed automatically?
I dont want my project to make peoples
On 24/10/2012 21:13, Karl DeSaulniers wrote:
So will this work?
divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() {
this.gotoAndStop(OVER);});
I mean. Will this = divers_btn? or do I HAVE to specify
divers_btn.gotoAndStop()?
My bad, you're right.
I put divers_btn because
Karl DeSaulniers skriver:
Thanks Henrik,
Well for this, there are two buttons on stage.
When you hover over one it makes a message appear, if the other another
message appears.
So if I dont use those, your saying that when I roll out, the listener
is removed automatically?
I am saying
if you were writing as2 without extending classes etc, why arent you just
working in JS, its the new hot chick on the block, afterall...
On Oct 24, 2012, at 3:45 PM, Karl DeSaulniers k...@designdrumm.com wrote:
Your not the only one who has said that about AS2.. lol
I know nothing about any
That kinda made sense. Will have to read about 5 more times though..
lol :P
thanks Henrik.
Time to go vote. I will be back later to see if I can pull an elephant
out my WHOO HOO.
Best,
Karl
On Oct 24, 2012, at 3:32 PM, Henrik Andersson wrote:
Karl DeSaulniers skriver:
Thanks Henrik,
Ok, I tried suggestions and things are still not working. The hand
cursor doesn't even show.
Here is the set up
Scene 2 -
frame 1 :
Main MC - Scene2MC
frame 96:
Layer 1 : (Actions were working on)
Already have Javascript and jQuery under belt. (well mostly)
This job is primarily AS3 so I thought I'd give it a try.
Karl
On Oct 24, 2012, at 3:35 PM, Ross P. Sclafani wrote:
if you were writing as2 without extending classes etc, why arent you
just working in JS, its the new hot chick on
as3 is so great. you should heed other's warning about never being able to look
back.
i love the language so much, i rewrote it in javascript pretty much. i even
ported my classical inheritance engine to Node.js
then i recreated most of the the Flash API, but im less sold now that mimicking
When I first started in AS3, there were two blocks that caught me up a
lot. I started from an older AS2 FLA and then converted to AS3 - that
was the cause of the problem.
If you do that, you end up with an AS3 fla that doesn't have the right
settings in the AS3 Properties panel. You won't
Sometimes anonymous and inline functions as terms are used interchangeably.
I wrote an addOnce method that utilized a closure - an inline function
(it wasn't anonymous though) that subscribed to the main add (this is a
Signals implementation) method, then removes itself from within itself,
I did start with a AS2 FLA and switched to AS3.
So your saying the IDE does not add the appropriate stuff when you
just convert?
WTF! Good to know Kevin.
Thanks
Best,
Karl
On Oct 24, 2012, at 4:25 PM, Kevin Newman wrote:
When I first started in AS3, there were two blocks that caught me
That didn't fix my problem. :(
I got all excited too.. lol
Karl
On Oct 24, 2012, at 5:38 PM, Karl DeSaulniers wrote:
I did start with a AS2 FLA and switched to AS3.
So your saying the IDE does not add the appropriate stuff when you
just convert?
WTF! Good to know Kevin.
Thanks
Best,
There might be other problems I have forgotten about (I made the switch
a long time ago) - do you have any specific examples of problem areas?
(You should at least be getting line numbers during errors with permit
debugging checked - that's a huge help).
If you've already gone down the path
37 matches
Mail list logo