PDA

View Full Version : just for kicks challenge challenge


junahu
01-06-2004, 10:57 AM
I challenge you to make a challenge that will challenge others so much that many will challenge your challenge. The challenge with the most challengers challenging on march 1st will win reasonable credit and admiration.

The challenge will be creating an effectively challenging challenge to challenge potential challengers into challenging the challenge.


This challenge must therefor be separate from the other challenges to avoid this challenge winning by default (I.e this challenge will not win the challenge challenge)

:p

CyanBlue
01-06-2004, 11:04 AM
Um... Do me a favor and explain what you want to have test on??? I probably will take more than the timeline you have to decyper the question... :(
Here is a little challenge for you to help me to understand your question... Do not use the word 'challenge' to describe it for me cuz that really confuses me... :(

dzy2566
01-06-2004, 11:25 AM
Junahu, I challenge you to post another thread with the word "challenge" in it more times than your last post.

senocular
01-06-2004, 12:53 PM
Originally posted by CyanBlue
Um... Do me a favor and explain what you want to have test on??? I probably will take more than the timeline you have to decyper the question... :(
Here is a little challenge for you to help me to understand your question... Do not use the word 'challenge' to describe it for me cuz that really confuses me... :(

Challenge: Understand this challenge!
:D



(I automatically win as for anyone to partake in this challenge they must first understand it)

splict
01-06-2004, 01:36 PM
Wow, I really need a job :D
Its got some very basic grammar checking but not much.

http://www.splicedbreaks.net/misc/challenge.html

ps works with dirty words. :p

dzy2566
01-06-2004, 01:41 PM
Busted. :D

senocular
01-06-2004, 01:50 PM
rockon splict!

dzy2566
01-06-2004, 01:53 PM
Seriously though. I'd like to see a new challenge. It's been a while. I'd start one, but mine never seem to catch on.

CyanBlue
01-06-2004, 01:53 PM
Hm... I seriously think that I should gather all those jobless people in AS.org to make a company... We then conquer the whole world... What do you think??? Oh, I am going to pay all of you with my post count... :D

splict
01-06-2004, 01:56 PM
hmm, I liked the 25 lines or less type challenges I saw over at the were-here forums. I think it should probably have some sort of length limit like that to keep it from getting crazy.

I don't really know how these things work though.

How about an image manipulation challenge? Just trying to throw an idea out there - will keep thinking.

senocular
01-06-2004, 01:58 PM
splict: http://www.actionscript.org/forums/showthread.php3?s=&threadid=28070

splict
01-06-2004, 02:01 PM
my backlight on my LCD for my laptop (currently my only comp) went out two days ago. Do you think the repair shop will accept payment in the form of post counts? If so, send me an application. :)

Maybe the challenge could be focused on interaction, like with the mouse or something similar.

splict
01-06-2004, 02:02 PM
gotcha thanks, I guess I should have looked myself :o

dzy2566
01-06-2004, 02:02 PM
Yeah, line limits are good. You can do quite a bit in 25-35 lines. All AS though, so we can paste into flash and view without having to download anything.

CyanBlue
01-06-2004, 02:11 PM
Um... Yes, splict... Recruit that repair man to AS.org... Problem solved... :D

That sounds pretty good... I will probably stand out here and watch you guys adding oil on your brain... That sorta contest always amazes me how differently you can approach the problem... :)

subquark
01-06-2004, 04:38 PM
http://www.splicedbreaks.net/misc/challenge.html

what fun, now I have something productive to do at my EvilDayJob! :D

a 25 line challenge? ha, I would win in one line with my super-secret ball code! :rolleyes:

senocular
01-06-2004, 05:11 PM
your ball code in your footer? The one that moves the timeline the ball is in rather than the ball itself because of a mis-referenced _x property?

subquark
01-06-2004, 05:19 PM
what? in my footer!!! it moves the timeline? no way, it's been approved by CyanBlue!

so ball.onEnterFrame = function (){
_x += 5;
} is wrong!

Should it be ball.onEnterFrame = function (){
ball._x += 5;
}??? :confused:

CyanBlue
01-06-2004, 05:24 PM
Whether I approve it or not, if senocular says no, then it means no... :D

subquark
01-06-2004, 05:45 PM
Well, the important thing is to fix it (I'll beat CyanBlue with a wet noodle later).

So what's the dilio? Is my second version correct? What gives? Now I have to start at square one again.

Please help.

splict
01-06-2004, 05:57 PM
Yeah the second version is correct. In the first version the _x automatically refrences 'this'. Since the code is wriitten in the timeline of ball's parent it moves ball's parent.
:)

senocular
01-06-2004, 05:57 PM
it needs to be a this._x ;)

(though technically, ball would work too)

splict
01-06-2004, 06:02 PM
well, maybe my explanation wasn't exactly right, cause like you say, this._x would work too, but just _x doesn't. So maybe I'm confused as to exactly why :(

senocular
01-06-2004, 06:35 PM
when you have a function, its given access to 3 scopes.
1) its own local scope for arguments and local variables
2) the scope of the object its defined in, accessible with 'this'
3) the scope of the timeline in which the script was written

the ball.onEnterFrame has all three and all three are different scopes.

1) Its local scope is unused. Theres no arguments passed nor any temporary variables created. No big deal

2) The scope in which the function is defined is the scope of the ball. Since the function is the onEnterFrame function in the object ball, to onEnterFrame, this is the ball. So to that function, this ... err, um... is, well, the ball.

3) all scripts are written in the scope of a movieclip object. whether it be on the timeline (the timeline movieclip object) on a movieclip (that movieclip object) or on a button (the movieclip in which that button exists) script is always in a movieclip. In writing functions, functions always have access to the scope in which they are written - meaning the movieclip in which they were written. If you have a function on the main timeline, its written in the scope of _root and can access variables from it.
num = 2;
function getNum(){
trace(num); // 2
}
Now, since ball.onEnterFrame was written in a scope which can reference ball directly through "ball" we can only assume that ball resides in the timeline in which ball.onEnterFrame was written. This means that the onEnterFrame function was written in the scope of ball's parent and therefore has access to that parent's timeline and the values (AND properties) on it. Just in the same way that getNum accessed num from the timeline it was written, so will too, ball's onEnterFrame access the _x in the timeline it was written. Without the this reference, you're not targeting the object the function was defined to (ball) but the scope the function was written in. Of course since ball esxists within that scope, that makes ball._x acceptable as much as this._x.

:D

subquark
01-06-2004, 06:40 PM
ah, see I put the function in the _root timeline and an instance ball on the main timeline, so my original function would have appeared to work even if the instance was not named

so I gather I should use this if the code was on the ball and not on the timeline?

as I have it (you would not have known, well maybe YOU would have known), the code is on the timeline and only moves the frame out from under the ball. this indicates that I don't even realize things are moving in the opposite direction!

thanks for the good explanation, I guess I'll paly with this tonight!

senocular
01-06-2004, 06:53 PM
yes use this :) and yes I knew (Ive dont it before myself ;))

splict
01-06-2004, 07:20 PM
Thanks for the explanation senocular. The one in the manual never made much sense to me but yours helped. At least I know how it works. I suppose sooner or later it will click as to why they made it work that way. :)

subquark
01-06-2004, 09:40 PM
so if I put all my code in the first frame of a swf, and I have a ball mc on the stage, I still would use this even though there is no code on the ball mc itself?

no need to answer, I MUST do this myself and be redeemed, but first I have to find CyanBlue; he has an appointment with a wet noodle! :p

Thanks senocular! :)

subquark
01-06-2004, 10:20 PM
well, now have this:
onEnterFrame = function (){
ball._x += 5;
}

and it works fine, any errors with this style of coding?

senocular
01-06-2004, 11:04 PM
onEnterFrame = function (){
ball._x += 5;
}

works, but through a slightly different method. There you're calling the main timelines onEnterFrame event, not balls. nothing wrong with that. ball is still being referenced right because its within the scope of where the function was written. It works that way just fine :) just slightly different than the ball.onEnter this._x deal


:cool:

subquark
01-06-2004, 11:16 PM
hmm, so what would be the ultimate OOP way of doing this, in your opinion?

I presume that would mean creating the function, somewhat as it is now, but then formally invoking it?

I really appreciate your time on this. It is vital that I get this right as it will forge the way I do OOP in the future.

senocular
01-06-2004, 11:41 PM
if one line, the best you could get is

ball.onEnterFrame = function(){ this._x += 5; }

For more OOP-ness you'd go through a class, either the movieclip prototype class or create a class specific to the ball like

/* ActionScript 1.0 */
ballClass = function(){};
ballClass.prototype = new MovieClip();
ballClass.prototype.onEnterFrame = function(){
this._x += 5;
};
Object.registerClass("ballID", ballClass);

this.attachMovie("ballID", ball1, 1);

// or

/* ActionScript 2.0 */
// in ballClass.as
class ballClass extends MovieClip {
function onEnterFrame():Void {
_x += 5;
}
}
// associate ball symbol with "ballClass" in linkage options

And yes, ActionScript 2.0 doesnt require the this, but it also isnt defined with [object ref].onEnterFrame ;)

subquark
01-06-2004, 11:48 PM
perfect! I see the beauty of OOP! And I see that AS2.0 is gonna be tough for me.

Thank you senocular for both examples, this does make it clearer for me (not an easy task as you have seen).

congrats on the move to k____.com, btw, how much space do you need for senocular.com? PM if you want . . .

Thanks again for your valuable time and the glimpse at AS2.0! :)

boyzdynasty
01-07-2004, 02:37 AM
tough on me too... i was trying to get the hang of as 1 ...now I have to move on up to 2.0 w/out know OOP. *smile* ....

CyanBlue
01-07-2004, 06:58 AM
Class??? OOP??? Waaaaaaaaaaaaa... I'm outta here... :(

What do you mean by 'move to k____.com', subquark???

subquark
01-07-2004, 08:08 AM
hmm, you should visit senocular's site and read his news *hint, hint* :D

subquark
01-07-2004, 08:12 AM
ah ha, I see the linkage thingy and need for external as file! Thanks again! :)

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 15: Classes may only be defined in external ActionScript 2.0 class scripts.
class ballClass extends MovieClip {

junahu
01-07-2004, 09:47 AM
Hey! What's everyone doing in MY thread? And asking questions still? I thought I'd never see the day. Everyone should be out there making challenges for people to participate in.

subquark
01-07-2004, 09:54 AM
what? I'll blab all day long, don't worry about that! so what challenge do you want to do? Why not give me a drink recipe?

dzy2566
01-07-2004, 10:13 AM
Good lord! This thread was only one page when I left it last. Informative to say the least, but hardly a challenge ;) Come on people, I need something to do. It's a slow day at work.

junahu
01-07-2004, 10:18 AM
That's what I was thinking! I posted this thread to try and garner interest in making challenges by challenging them to do so.i.e. the incentive to make challenges is that they win this challenge in doing so.

dzy2566
01-07-2004, 10:30 AM
Well, it seems to be coming along, without producing a challenge. Ha. Oh, the lemmings is coming along nicely. It's a little hard to play when it's so tiny. Maybe you could also post it somewhere larger and put a link in your footer. A perpetual, rather than popup, menu would be helful too. Though I know you did this with the prototype to conserve space in the footer. Long story short (too late, right?) I'd like to see it larger somewhere because it seems to be coming along very nicely.

subquark
01-07-2004, 10:37 AM
how about making 2 identical swfs, one just AS and one just tweens, crap I don't know, no, that is lame, how about something practical? the coolest, most customxzable buttons?

*eyes glazed and drooling*

dzy2566
01-07-2004, 10:45 AM
Damn dude, you went to town on the site check forum! :)

dzy2566
01-07-2004, 10:46 AM
And the cool sites too. :eek:

subquark
01-07-2004, 11:01 AM
well, 2 factors: I woke up at 2am and could not go back to sleep and work is slow, but I did answer a few questions.

Thanks for watching my back big daddy! :p

dzy2566
01-07-2004, 11:21 AM
Right on. Just doing the same thing actually. Work is super slow, so I'm just bouncing around the forums. I actually just ran into an old posting about making a basketball game. So I think I'm going to try and make a prototype for moving a clip (2d) with a trajectory. I figure I'll use that in a game some day, right? :)

senocular
01-07-2004, 11:22 AM
just fyi, I have an OOP in AS1 tutorial at kirupa.com now, and AS2 should be done hopefully tonight. That is, I should be done writing it tonight. It may take a few days to find its way online. The AS1 could use some more tweaking, and Ill get around to that a little later (after fixing some of the 3d tut issues) so if you do decide to go read it and still get confused. Its ok, its tough stuff. Let me know whats bad and Ill try to friendly it up a bit :D

dzy2566
01-07-2004, 11:27 AM
off topic? I don't think there's really an "on" topic in this thread. :D

subquark
01-07-2004, 11:28 AM
@ dzy2566 - sounds like a neat thing, so you REALLY are looking for things to do?

@ senocular - yes, an OOP tutorial would be fantastic! I really would like to lay down a solid foundation for my programming approaches and habits, even minor things like nomenclature. I can't wait to see your tutorila! Thank you! :)

dzy2566
01-07-2004, 11:29 AM
Yeah, I've been meaning to do something with trajectory motion anyway, so now's a good time while I'm twiddling my thumbs at work. And I agree, as much as I understand OOP, there's always something new to learn. I would be very interested in seeing that as well.

senocular
01-07-2004, 11:38 AM
this is oop for AS1
http://www.kirupa.com/developer/oop/index.htm

(start from the top ;))

subquark
01-07-2004, 11:57 AM
OOH! Nice OOP! I took a quick look and your tutorial looks quite thorough. I will print it and study it well. Thank you so much for putting that together. That's an enormous task and you have done a wonderful job with it. If you need some space, let me know ;)

dzy2566
01-07-2004, 12:00 PM
Yeah, damn. That's a heck of a tute. There was someone I ran into earlier today who was wondering about OOP. Now if I could only remember who...............

splict
01-07-2004, 12:09 PM
:eek: WOW! if only i was still working in 1.0. Oh well, I'll read it anyways I'm sure it will help - then I'll just read the 2.0 one when it comes out :) Thanks!

subquark
01-07-2004, 12:14 PM
Originally posted by dzy2566
Yeah, damn. That's a heck of a tute. There was someone I ran into earlier today who was wondering about OOP. Now if I could only remember who............... probably me! I am clueless on OOP, AS1.0 or as2.0, I need the foundation. I don't know why it is so difficult for me, I have a Master's in Geoscinec, I minored in math, but it was in the day of doing FORTRAN on punch cards (no kidding).

dzy2566
01-07-2004, 12:19 PM
Masters in Geoscience? How about that. And here you are flashing it up. I love hearing stories about all the different jobs and programs people have gone through to end up where they are. I know these guys who own and operate their own company, a two man operation. They do database stuff, and hanging in their office are their two pharmaceutical masters degrees. Ha! They're making tons now, whatever works I guess. :D

splict
01-07-2004, 12:27 PM
hmmm. I hate to get on topic here, but;), I would really like to see a challenge. A lot of times challenges end up being cool drawing designs and stuff like that. Instead, something useful when designing a site might be a good focus for a challenge. Then we would have another few tools to use after we were done having fun.
dzy2566, you said you'd come up with one but no one wants to do them - well give it a shot, I'm game.

senocular
01-07-2004, 12:28 PM
AS2 compiles to AS1 so its good to know AS1 too. The AS2 tut does borrow off the AS1 one a bit, though much of AS2 is keeping you away from confusing things like the 'prototype' object. Come to think of it, I might want to elaborate a little more in the AS2 stuff for those who didnt or dont want to (or get confused by) AS1. AS2 is still in rough draft form. Much of the content is thrown in in the pages that make it up; it just needs a good read through and revision. :) Like I said, I hope to have that done today (plowng through it tonight)

splict
01-07-2004, 12:29 PM
yeah, I definately think a better foundation in 1 would help me, I just don't want to get too much of that prototype stuff in my head, as I am trying to get rid of it now that I moved to 2004

dzy2566
01-07-2004, 12:30 PM
Alright, I'll think about it and see if I can come up with something. I gues if it's only the two of us, it'll still be fun :D Though I can think of a few people who won't be able to resist if we get the ball rolling.

subquark
01-07-2004, 12:38 PM
no more prototype stuff (is it classes or objects now). thank God, 'cause I never understood protypes.

what do you mean just the two of us? the challenge?!!? OMG :eek: if you can do more than a stop(); then you win! :p

dzy2566
01-07-2004, 12:50 PM
Speaking of which..........NEW CHALLENGE ALERT!

http://www.actionscript.org/forums/showthread.php3?s=&threadid=40141

subquark
01-07-2004, 12:57 PM
:cool: yeah, but I drink first, then code! :p

boyzdynasty
01-07-2004, 02:21 PM
Originally posted by dzy2566
Damn dude, you went to town on the site check forum! :) dam! ....no kidding.... LMAO... subquark is that bored! Well...i hope you can answer my question I posted in General Chat....

subquark
01-07-2004, 02:23 PM
yeah, my EvilDayJob really blows, but I'll be quitting in the next few months. 10 years just rotting here (is the bitter undertone coming through) :D

answer a question? nah, especially if it has to do with coding! :p

subquark
01-07-2004, 02:28 PM
that map question, I did not want to answer it over there to leave it open for a real answer. You have to make it dynamic? Otherwise, I'd just stick a bunch of mc buttons over a map and have a rollOver display the second frame of an information mc.

you might also look at extensions for tooltips, I hade found one that was very customisable that might actually work very well.

good luck!

boyzdynasty
01-07-2004, 02:40 PM
do you have the link for that tooltip?

btw: Subquark, you know more than you are leading on. You are a AS guru...so stop denying it :mad:

subquark
01-07-2004, 02:50 PM
I have to get it for you when I get home, if I have it I'll zip it, can you pm your email address to me please. ;)

boyzdynasty
01-07-2004, 03:17 PM
what! you don't have my e-mail? ... I am hurt. You didn't save my email address when I had email you? :(

subquark
01-07-2004, 03:36 PM
I might have it, but I'm not very organized (CyanBlue yelled at me yesterday for not coding my emails :( )

actually, is it on the other forum?

boyzdynasty
01-07-2004, 03:46 PM
lol... yea flashvaccum


hey...is CyanBlue babysitting you? How mux does he charge an hour? :p

subquark
01-07-2004, 03:55 PM
hah, he pays to keep an eye on me, I'm rather suave you know . . . :p

One thing I can say about CyanBlue is that he is very PATIENT! :)

boyzdynasty
01-07-2004, 04:10 PM
patient? hmm...you make him sound mean...hehe

subquark
01-07-2004, 04:19 PM
oh he can be mean, I mean to tell ya . . . he ripped me a new one yesterday over my email organization! :p

boyzdynasty
01-07-2004, 04:45 PM
btw: do you have anything on zooming? i need to seem some example codes of zooming and focusing at the area of an image the user had hit/clicked on.

subquark
01-07-2004, 05:01 PM
yeah, I think I do aheve a map type component, we better straighten up, the entire Design Briefs thread has been deleted, most uncool, guess I'm gonna have to hang out at a less restrictive forum eh? One with less censorship! :p

boyzdynasty
01-07-2004, 06:07 PM
wow...really...i didn't check. o well. i guess he was not into swapping drink recipes *smile*

senocular
01-08-2004, 11:53 AM
... in case anyone's still interested, I finished the AS2.0 tutorial and it should be up within a matter of days. For anyone desperate enough, I can send it to them now. :)

splict
01-08-2004, 12:01 PM
well, since I have some free time today, I'd like to look at it soon. But not if its much trouble. I can be patient and wait a few days to learn from the great actionscript OOP guru if I have to. :p :D

subquark
01-08-2004, 12:37 PM
Sure senocular, I'd love to start reading it so that I can try it out this weekend. If you would be so kind; email it to me at ___@____.com. Thanks alot! :)

Edit: Very high quality, thanks!

senocular
01-08-2004, 12:46 PM
will do :D

dzy2566
01-08-2004, 01:08 PM
Hey! We all want to see it. Post a link soon. :D

splict
01-08-2004, 02:34 PM
Great stuff, senocular! I'm only part of the way through, but so far things are well written and easy to understand - more so than many books I've read. :) (and free :D)
I have noticed a typo or two, very minor and not code related, is there somewhere I should send them to?

senocular
01-08-2004, 02:49 PM
yeah! I did the proof-read this morning and I was only half awake. ;) just give me the page, paragraph # and the word and Ill fix it :)

Stimpson
01-19-2004, 06:00 PM
Yep great stuff senocular.

And I'll just repost my suggestion lost on last weeks AS.org blackout. Perhaps you could also put on some printable version, pfd or the like. Love reading this kind of stuff from my comfy chair ;) :p.

subquark
01-19-2004, 06:38 PM
pfd or the like or a pdf would be good (okay, don't get touchy, I'm the King of typos!).

really good tutorials senocular. Thank you very much! :)

Stimpson
01-19-2004, 06:54 PM
What, you don't pfd........Perfect For Documents? It's the very latest thing, you got to have heard of it ;).

subquark
01-19-2004, 07:26 PM
speaking of typos, did you hear about the 17 year old with www.MikeRowesoft.com?

Great story, Microsoft lawyers said he better stop using the name and offered him $10 for it! Great story!

http://www.cnn.com/2004/TECH/internet/01/19/offbeat.mike.rowe.soft.ap/index.html

Stimpson
01-19-2004, 08:11 PM
How big compagnies can be so small.........:p.

junahu
03-29-2004, 06:19 AM
:( makes me wish I had a name like Soh Nii. But what would I do with 300 yen?