Comments on: MGAS3FD 6: Click it like it's hot https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/ rapid prototyping of games using flash Tue, 14 Feb 2017 09:15:06 +0000 hourly 1 https://wordpress.org/?v=5.1.1 By: Gert Myburgh https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-18226 Fri, 18 Oct 2013 04:21:31 +0000 https://prototyprally.com/?p=306#comment-18226 Hi Everyone,

I also wonder what happened to our AS3 “teacher”. I really enjoyed his/her teaching. I hope he/she will return one day and continue the teaching. I would like to learn how you handle sprite collisions, scoring, removing objects when hit by other objects, scrolling of backgrounds, taking/porting the game to IOS and Android etc, etc.

A tip for those of you that follows the tutorial to the teeth but got no response when clicking the “enemy” object, remember to look in your toolbar at the top of your development tool for the dropdown saying “Release”. It should be next to the blue triangle. That dropdown value should be “Debug”. You will only see the “trace” messages displaying in your “Output” window when that setting is “Debug” just before you “Build” or “Test/Run” your project.

When you sometimes download the project files and overwrites your project with his/her project files you will find that setting is set to “Release” and you need to set it back to “Debug”.

Happy Flashing.

Gert Myburgh
South Africa

]]>
By: Austin https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-17521 Mon, 22 Jul 2013 06:49:38 +0000 https://prototyprally.com/?p=306#comment-17521 4 years and no more parts… Are you dead?

]]>
By: Pro Newb https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-17365 Tue, 02 Jul 2013 04:02:29 +0000 https://prototyprally.com/?p=306#comment-17365 MORE MORE MORE PLEASE I WANT TO COMPLETE GAME

]]>
By: Tyler https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-13513 Sun, 24 Jun 2012 07:52:42 +0000 https://prototyprally.com/?p=306#comment-13513 AddEventListener dosnt seem to work in any class except main. it compiles and runs, but dosnt catch and clicks on its assiged object.

help??

]]>
By: Kyle T https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-12994 Wed, 23 May 2012 23:18:54 +0000 https://prototyprally.com/?p=306#comment-12994 These are really great tutorials, but it gets kind of hard near the end, but I eventually figured it out. If anyone comes by here and needs some help, here is my final code.

package
{
import enemies.Enemy;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;

public class Main extends Sprite
{
public var enemy:Enemy;
public var player:Player;

public function Main():void
{
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
addEventListener(MouseEvent.CLICK, handleClick);

player = new Player();
addChild(player)

enemy = new Enemy();
addChild(enemy)
enemy.x = 500;
enemy.y = 400;

for (var i:int = 0; i < 5; i++)
{
var tmpEnemy:Enemy = new Enemy();
tmpEnemy.x = Math.random() * 800;
tmpEnemy.y = Math.random() * 600;
addChild(tmpEnemy);
}

}

private function handleEnterFrame(e:Event):void
{
player.x += 1;
player.x = mouseX;
player.y = mouseY;
}

private function handleClick(e:MouseEvent):void
{
trace("clicked in main");
var targetEnemy:Enemy = e.target as Enemy;

if (targetEnemy)
{
targetEnemy.y += 20;
}

}

}

}

Hope this helps!!!

]]>
By: Anon https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-10146 Sun, 11 Dec 2011 23:36:08 +0000 https://prototyprally.com/?p=306#comment-10146 Correction: Just found the download at the top of part 6. It displays the graphics, but nothing moves. Don’t know why it threw an error before as I can’t see any difference in the code or folder structure.

]]>
By: Anon https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-10145 Sun, 11 Dec 2011 23:20:00 +0000 https://prototyprally.com/?p=306#comment-10145 Stopped working in part 4. Even the downloaded code does not work & no downloads in the final parts. “Error: Unable to transcode ../../../../../../assets/gardengnome.png”. Spent a lot of time working out where to put code & why & the difference between static & const. A bit half-hearted, but would be a good tutorial if complete. Thanks a bit !

]]>
By: Joseph Marlin https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-7552 Fri, 05 Aug 2011 01:05:59 +0000 https://prototyprally.com/?p=306#comment-7552 @Mac, you probably did the same thing I did and forgot to add:

addEventListener(MouseEvent.CLICK, handleClick);

In your Main() section. That is what tells the Main() function to pay attention to mouse clicks and call handleClick() whenever it notices one.

]]>
By: Mac https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-6755 Sat, 09 Jul 2011 01:04:07 +0000 https://prototyprally.com/?p=306#comment-6755 I’m having the exact same problem as Jeff :/ new to this though I have had quite a bit of experience in C/C++. any ideas? thnx 🙂

]]>
By: Aldo Marsilio https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-6571 Wed, 29 Jun 2011 09:30:03 +0000 https://prototyprally.com/?p=306#comment-6571 Nice tutorial, tnx for all.

]]>
By: Stefano https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-4760 Wed, 23 Mar 2011 21:42:14 +0000 https://prototyprally.com/?p=306#comment-4760 For those still struggling with the e.target function. Took me a while to figure it out, but turns out to be a relatively simple omission: just put it inside the handler in the Main class (eg. the one where he asks you to trace click in main). I guess this is because the handler defines what e is at its start, so there!

Thanks again for the tutorials -lol definitely doesn’t hold your hand but definitely very informative, ta!

]]>
By: AMc https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-3183 Wed, 26 Jan 2011 16:01:59 +0000 https://prototyprally.com/?p=306#comment-3183 Really interesting. I’m looking into returning to content creation after a 10 year break so pretty much back at the beginning – 1st tutorial I’ve found that made any real sense 🙂
I really enjoyed reading – I hope you find the time and impetus to continue with these at some point!

]]>
By: Aki https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-2682 Tue, 11 Jan 2011 16:49:04 +0000 https://prototyprally.com/?p=306#comment-2682 Thanks for the tutorials, they’ve been a real help.

I didn’t really understand the piece on e:target, I think you wanted me to make another eventlistener of some kind but I couldn’t find target in any of the drop down options when I used Event or MouseEvent. Maybe it requires a different event to be used to access it?

Also, I’m not sure why we made a player class, it just seems to be there to act as another trace statement.

Either way, I’m sure I’ll figure it out the e:target thing on my own, thanks for providing the initial steps into programming for me.

]]>
By: Brian https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1664 Sat, 20 Nov 2010 23:10:41 +0000 https://prototyprally.com/?p=306#comment-1664 Can someone please post the final working code for this?

I am having issues with Error: Access of undefined property e.

]]>
By: Leonardo "Brazil Rules" https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1625 Fri, 12 Nov 2010 21:41:02 +0000 https://prototyprally.com/?p=306#comment-1625 It’s kind of awkward the way you tell us to make a player class and then don’t touch in the subject anymore.

]]>
By: CellarDorre https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1494 Fri, 29 Oct 2010 05:37:05 +0000 https://prototyprally.com/?p=306#comment-1494 I’m really new to programming in general and I’m having trouble figuring out where to put this:

private function handleClick(e:MouseEvent):void {
trace(“clicked in main”);
}

and the loop:

for (var i:int = 0; i < 5; i++) {
var tmpEnemy:Enemy = new Enemy();
tmpEnemy.x = Math.random() * 800;
tmpEnemy.y = Math.random() * 600;
addChild(tmpEnemy);
}

]]>
By: Jeff https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1178 Tue, 03 Aug 2010 11:58:56 +0000 https://prototyprally.com/?p=306#comment-1178 Thanks for the tutorial! I’m having the opposite problem as above, my document class handleClick function does not seem to get called at all. I don’t get any errors it just seems like the bubbling is not working/turned on?

]]>
By: Ben https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1177 Mon, 31 May 2010 18:48:55 +0000 https://prototyprally.com/?p=306#comment-1177 Hi grapefrukt,

Thanks for the tutorial! I am having a little trouble with adding another listener in the main class. I get an error Duplicate function definition. Could you post the final code?

]]>
By: Marty https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1176 Thu, 06 May 2010 19:37:20 +0000 https://prototyprally.com/?p=306#comment-1176 I really like this tutorial series. Should be required reading for anyone trying to get up to speed on Action Script 3 with Flash Develop. I see the last installment was posted a year ago :(. Sure hope it picks up again, it’s very helpful!

]]>
By: zsombor https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1175 Tue, 04 May 2010 18:43:06 +0000 https://prototyprally.com/?p=306#comment-1175 Hello grapefrukt,
I really like your tutorials, however I have a problem. I have added the Click eventlistener to my Enemy class which extends Sprite, yet the event doesn’t occur when I try to do it runtime.

What could be the problem?

]]>
By: Evil Amoeba https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1174 Fri, 26 Mar 2010 13:24:41 +0000 https://prototyprally.com/?p=306#comment-1174 Hey! Very helpful tutorials. Thanks for helping guys like me get started in ActionScript 3.

]]>
By: Silver Sword https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1173 Sun, 14 Mar 2010 16:25:50 +0000 https://prototyprally.com/?p=306#comment-1173 My ship sails in the morning.
I wonder when the next part will be posted…

]]>
By: b https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1172 Mon, 08 Mar 2010 06:16:37 +0000 https://prototyprally.com/?p=306#comment-1172 These are great, two thumbs up!

]]>
By: Gambit https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1171 Sun, 17 Jan 2010 21:52:00 +0000 https://prototyprally.com/?p=306#comment-1171 Nevermind I figured it out, the click in the main detects it for all the enemies. It’s a bit unclear there.

]]>
By: Gambit https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1170 Sun, 17 Jan 2010 21:38:21 +0000 https://prototyprally.com/?p=306#comment-1170 When I put the trace for “Clicked in the main” It only shows up when I click on the gnome along with the other trace. And nothing shows up when I just click the background. I put everything where u said, maybe I should check the source files real quick 😛

]]>
By: grapefrukt https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1169 Fri, 08 Jan 2010 09:48:35 +0000 https://prototyprally.com/?p=306#comment-1169 @LopTank – Did you put the e:GumMixEvent in the arguments for the eventhandler? (See the second code block in the post)

]]>
By: LopTank https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1168 Fri, 08 Jan 2010 09:37:28 +0000 https://prototyprally.com/?p=306#comment-1168 I’m using the most update version of FlashDevelop (3.0.6) and when I try using “e.target” the compiler comes back with tears in it’s eyes and proceeds to tell me “Error: Access of undefined property e”. Can anyone explain to me why the e.anything expression won’t work?

Thanks 😮

]]>
By: Fraser https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1167 Sun, 08 Nov 2009 16:20:33 +0000 https://prototyprally.com/?p=306#comment-1167 Huh. That should be a “troubled” emoticon, not an angry one.

]]>
By: Fraser https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1166 Sun, 08 Nov 2009 16:19:15 +0000 https://prototyprally.com/?p=306#comment-1166 Aaaaaaahhhhhhhhhh hurr.

I spent two hours trying to work out an apparently nonsensical “Access of undefined property x in package player” error message. I finally randomly guessed the problem: I had saved the Player class in a folder called “Player”, instead of in the root folder. All the code referred to the Player folder correctly, but the word must be reserved for something else in Actionscript, because when I renamed the folder it worked perfectly.

Ok, now that I’ve proved my credentials as a total n00b, I’ll give you a little feedback on what it’s like for a novice to read these tutorials. The information is great, it’s broken down well step-by-step, and it’s explained clearly for the most part, but towards the middle you stop explaining where to put things: a lot of passages say “now add this code” without any hint as to where to write it. I muddled through mostly by trial and error.

But I got there in the end! It feels like a victory, but it’s daunting to think how much there is still to learn. 😡

Thanks for taking the time to write out this very helpful tutorial. You’ve earned good internet karma!

]]>
By: davidp https://prototyprally.com/mgas3fd-6-click-it-like-its-hot/#comment-1165 Sun, 01 Nov 2009 23:44:50 +0000 https://prototyprally.com/?p=306#comment-1165 awesome tutorials 🙂 learned quite a bit from it 🙂

]]>