PDA

View Full Version : Newbie here in need of help



blzrd
09-25-2006, 08:33 PM
So I have wanted to learn how to code this stuff for as long as I have learned HTML. But for the longest time, JS has eleuded me. I have decided that I want to learn how to code some basica javascript. I have one script in mind that I would like to tackle. I would appreciate any help people could give me.

I have here a site that has a flash game. What I want to do is right after the picture of the monkey is gone, there is a cube with "BM" on it. When you move the mouse, pixels trail and fall down, then when you click, it explodes pixels. I want to do this for my web page for a background (wherever I go on the page it will do this). But it is not possible to my knowledge to embed a flash animation as a background and I beleive it to be possible to do this with javascript.

http://209.0.146.17/1/graphics/games/game_adrenaline_challenge.swf

I am going to try and splice things together from other script examples if I can find them, but I would really like some help to try and learn how to do this from scratch.

Thanks for any help.

blzrd
09-25-2006, 10:52 PM
So I was thinking that I should do something like having it choose a random number between 0 - 360 For "launch" direction. Then choose a random number between 1 - 10 for speed for each pixel. Then have the activation be when the mouse moves one pixel in any direction. Then each pixel would "accelerate" by subtracting say one number the y coordinate of the pixel every couple miliseconds. What do you guys think of that? I don't know how I would do this, but I think that would make the pixels do what I want them to do if I can get the script to work....

keep in mind, I just want to work on the trail pixels. Hopefully once I have that good enough, I will know enough to make the click work flawlessly.

jscheuer1
09-27-2006, 05:51 AM
That's not a javascript. It's Flash.

blzrd
09-27-2006, 05:54 AM
If you read my post, you will see that I already stated this. I said this is a flash animation, but I can't embed a flash app into the page, so I want to do this with javascript......

jscheuer1
09-27-2006, 06:12 AM
So I have wanted to learn how to code this stuff for as long as I have learned HTML. But for the longest time, JS has eleuded me. I have decided that I want to learn how to code some basica javascript. I have one script in mind that I would like to tackle. I would appreciate any help people could give me.


That's not a javascript. It's Flash.


If you read my post, you will see that I already stated this. I said this is a flash animation, but I can't embed a flash app into the page, so I want to do this with javascript

Sorry about that. But, that being the case, you would be much better off starting with something less challenging. I'm pretty advanced at javascript and I would find doing that swf as javascript pretty hard.

blzrd
09-27-2006, 05:10 PM
Well that is why I wanted to tackle this one. Because it would be hard. It would take a while, and by the time I am done with it, I would pretty much be an advanced javascript user.

I have looked for web sites that teach you how to do things, but they don't go into anything too advanced. They basically just tell you how to do math with the javascript which is easy enough. I want to learn how to use that math to manipulate objets.

Would you like to help me?

mwinter
09-27-2006, 07:00 PM
Well that is why I wanted to tackle this one. Because it would be hard. It would take a while, and by the time I am done with it, I would pretty much be an advanced javascript user.

I really don't think it's that simple. A single project doesn't teach you about the language. You'll only be using a restricted subset of it, and interacting with limited number of host objects. To become really proficient, it takes time. A lot of time - one person who I would call an expert put an estimate at six months, if not longer.

The more practical issue is that animation in browsers tends to come off really quite badly, with a lot of tearing and stuttering. It's just the wrong tool for the job.

Mike

blzrd
09-27-2006, 07:02 PM
K then where would I go to learn how to do javascript?

Twey
09-27-2006, 07:08 PM
I think it would be more a test of your maths skills than a Javascript challenge.

blzrd
09-27-2006, 07:10 PM
YES YES I know it would test my math skills. But I am decent at math. I just want to learn how to apply my math skills to a real world thing. Javascript is a perfect way to do that, correct?

Twey
09-27-2006, 07:22 PM
I suppose it's not a bad idea. It's unlikely you'll be able to create anything viable for online use, but as a pet project it's fairly decent.

mwinter
09-27-2006, 07:23 PM
K then where would I go to learn how to do javascript?

That would depend, in part, on how proficient a programmer you are. I would first refer you to a post I made earlier this month. I'll also add that you should be wary: they are a large number of sources on the Web that extremely poor sources of information. The same thing goes for books, too. The comp.lang.javascript newsgroup only recommends one book (http://www.jibbering.com/faq/#FAQ3_1) (now in its fifth edition), though some only consider it the least bad. Personally, I wouldn't know: I've never read a single book on the subject (and never will).

Mike

jscheuer1
09-27-2006, 08:24 PM
K then where would I go to learn how to do javascript?

Hire all three of us as your personal tutors. :)

Like Mike (mwinter) says, there is a wealth of information available on the web, almost all of it is flawed but, it will get you started. You can almost always learn something though, even from the most misleading information, as long as the code works in the browser that you are using.

Just keep in mind that the not every browser responds the same way to any given code and that even when something works in all browsers, there usually is a better way to do it from the standpoints of economy of code and the resources it requires from the user's machine, browser, and the web.

So, keep an open mind, and always be ready to learn new and better ways of coding.

I learned most of what I know from trying to make existing scripts do different things than they were originally designed to do. Along the way I've seen and continue to see all kinds of things I never dreamt of. Often these are nightmares but, other times they are strange new ways to code that really are better than what I was used to.