14,574 Forum Posts by "Denvish"
Who what when where how why now?
hapy burfdai tyler
if'n(isBirthday){GETDRUNK();}
Find the bit of code that checks for floor contact, if it comes back as true then move the character upwards by enough to make him stand on the surface.
At 5/19/09 06:01 PM, KaynSlamdyke wrote:At 5/19/09 05:04 PM, Glaiel-Gamer wrote: One thing I do is give solutions in psuedo-code or faux-c++ or just type some AS in the "post reply" box without testing.Yeah. I've done that a few times.
So the logic is there, but if people want to make it work they have to understand what it does.
But then the reply is immediately "So how do I do that in AS?" from the half of the people who aren't here to learn.
It's not that they aren't here to learn, it's that they have no coding experience, so don't have a clue how to go about tackling a problem. I firmly believe that the best way to help new Flash coders is to simply solve their problem, in AS. Yes, they may just copy/paste it into their fla, but as I said above, they're either gonna have to learn to adapt it in order to make a unique game, or they're just going to get a hell of a lot of 'you copied xxxxx' reviews.
By posting an answer in another language or using pseudocode, you're automatically making the assumption that the OP has some kind of clue about scripting or coding. Which is naive, considering that many, MANY users only learn to code by starting with AS. Some have a natural affinity with loops, classes, if...elses, listeners, etc etc. But many simply do not have a clue about the logical aspect of coding, or even the syntax. There's really no shame in actually fixing a user's code/fla, giving them the working code, and moving on. I personally would really like to see more of the experienced users do exactly that.
Never assume that the newbs have even a fraction of the skills you had when you STARTED with Flash, let alone those you have now after years of using it.
The original point of AS: Main was to provide answers to the most regularly asked questions - to help prevent the tedium of writing the same thing out over and over again. Obviously things have moved on since then, but there are still a lot of people using AS2, and those links are still useful (and of course AS3: Main) - but I never see people using them to help newbs.
Although linking them to the main topic is useful, it's definitely better to grab the URL of the specific tut that deals with their problem - it can be a bit of a trial for new internet users finding the one they need.
In terms of specific AS questions that aren't covered by the AS: Main threads, I personally actually quite enjoy spending 10 minutes solving problems with users' flas or code, I just wish I had more time to dedicate doing it because it can actually prompt me to try things I haven't.
Myself, I learnt partly by copying (from web samples or decompiling), understanding and adapting other Flashers' codes, and while I'm aware there are some who won't even attempt to understand why the code they copied from the internet won't work, it certainly shouldn't be looked down on as much as it is as a way for users to learn.
In general, new Flash users should be treated with tolerance rather than hostility. So they tried to create a game by copying someone else's work... who cares? If they want their game to be unique, they're going to have to learn how to understand AS. There is no place on the Flash forum for the virtual bullying and insulting I've seen in some instances, more often than not by posters who don't have a clue themselves.
The Flash forum is here for the experienced users to help the less experienced, whether it be in the artistic or the coding side of the program. We were all newbs once, some people would do well to remember that and chill out on the abuse. If you think you might have an answer to a question, then post... if you're just going to flame, be aggressive, or give bad guidance... don't bother.
At 5/18/09 02:20 PM, Dereks wrote: Hmm is there a way to do it using AS ?
Yes.
txt="GUMBOOT MOFO "; //TEXT TO DISPLAY
circRad=200; //RADIUS OF CIRCLE
function CREATECIRCLE(str){ //CREATE CIRCLE
letterAngle=360/(str.length); //GRAB ANGLE OF LETTERS
txtArr=str.split(""); //CONVERT TEXT TO ARRAY
var c=createEmptyMovieClip("circ",1); //NEW MC
c._x=Stage.width/2;c._y=Stage.height/2; //PLACE CENTRALLY
var ang=-90; //ANGLE OF FIRST LETTER
for(var i=0;i<txtArr.length;i++){ //LOOP LETTER ARRAY
var nl=c.attachMovie("letter","l"+i,i); //CREATE NEW LETTER MC
nl.t=txtArr[i]; //SET LETTER
nl._rotation=ang+90; //SET ROTATION
nl._x=Math.cos(TRAD(ang))*circRad; //SET X BASED ON ROTATION/RADIUS
nl._y=Math.sin(TRAD(ang))*circRad; //SET Y BASED ON ROTATION/RADIUS
ang+=letterAngle; //INCREMENT THE ANGLE
} //
c.onEnterFrame=function(){this._rotation+=5;} //ROTATE HOLDER MC
}
function TRAD(xxx){return(xxx*Math.PI/180);} //FUNCTION: DEGREES TO RADIANS
CREATECIRCLE(txt); //DO THE FUNKY THANG
Change
_root.player.attachMovie
to
_root.attachMovie
var counter:Number = 0;
raindrop.onEnterFrame = function() {
if (this._y>0) {
this._y -= 30;
} else {
clone();
}
};
function clone() {
if (counter<150) {
var dx:Number = random(500);
var dy:Number = random(200);
var myObject = new Object();
myObject._x = dx;
myObject._y = dy+Stage.height;
myObject._alpha = random(100);
myObject._xscale = 50+myObject._alpha;
myObject._yscale = myObject._xscale;
myObject.onEnterFrame = function() {
if (this._y>0) {
this._y -= this._alpha/10;
} else {
this._y += 348+Math.floor(Math.random()*348);
this._x = Math.floor(Math.random()*444);
}
};
raindrop.duplicateMovieClip("nr"+counter, this.getNextHighestDepth(), myObject);
counter += 1;
}
}
Ability to edit the AS window without having to close the find/replace dialogue first.
Annoys the hell out of me
At 5/11/09 03:19 AM, Denvish wrote: You should then be able to use SFXA.setVolume(0); and SFXB.setVolume(0); to adjust each sound
In terms of fading in or out, something like this should work:
function FADEMUSIC(snd,io){ //SOUND, INOUT
clearInterval(fm); //CLEAR INTERVAL
if(io){ //FADE IN
fm=setInterval(function(){ //INTERVAL
if(snd.getVolume()<100){ //NOT TOO LOUD
snd.setVolume(snd.getVolume()+1); //VOLUME UP
}else{ //ENOUGH
snd.setVolume(100);clearInterval(fm); //CLEAR
} //
},100); //MS
}else{ //FADE OUT
fm=setInterval(function(){ //INTERVAL
if(snd.getVolume()>0){ //STILL GOING DOWN
snd.setVolume(snd.getVolume()-2); //DOWN
}else{ //ZERO
snd.setVolume(0);clearInterval(fm); //CLEAR
} //
},100); //MS
} //
} //
The snd parameter for the function in this case would be either SFXA or SFXB, and the io would be either 1 (fade in) or 0 (fade out). For example, to fade in sound1:
_root.FADEMUSIC(SFXA,1);
When you attach each sound, you need to attach it to a new Movieclip if you want to be able to adjust its volume/pan independently of other sounds.
createEmptyMovieClip("SA",_root.getNextHighestDepth());
SFXA=new Sound(SA);
SFXA.attachSound("sound1");
createEmptyMovieClip("SB",_root.getNextHighestDepth());
SFXB=new Sound(SB);
SFXB.attachSound("sound2");
You should then be able to use SFXA.setVolume(0); and SFXB.setVolume(0); to adjust each sound
30-day trial of Adobe Flash is here
Locking this topic now because any discussion beyond this is likely to end up about piracy, which is a bannable offence.
At 5/6/09 01:58 AM, Klemzo wrote: No it doesn't work. I dunno like its something wrong. If I put a button into a movie clip it doesn't work at all...
But if I put it seperetly and pit that script in it works but It still doesn't put you where I want. It puts you to scene 1, 1st frame! WTF is that :(
The script clearly says:
on(release){
gotoAndPlay("Scene 2", #);
}
(I put number where # is afcourse)
So whats the problem?
THanks~
I've had this problem with buttons inside MCs/Scenes before. The solution I used was to have a function on the root timeline, first frame:
function GOTOIT(fr){
gotoAndPlay("Scene 2",fr);
}
Then add this to the button instead:
on(release){
_root.GOTOIT(1);
}
At 5/6/09 12:08 AM, farfenwaffle wrote: -whats the proper use for: _root.[movieclip].deleteMovieClip to make all of the spawned enemys go away?
for (i = 1; i<nrEnemies; i++){
_root["Enemy" + i].removeMovieClip();
}
-what the heck does my code mean?
This is a FOR loop that runs repeatedly.
It will start looping from the point where i (a counter) =1.
for (i = 1;
It will stop looping when i stops being less than max number of enemies (variable: nrEnemies).
i<nrEnemies;
Every loop, i will be incremented by one
i++){
Everything that's inside the curly brackets is the code that will be executed each loop - in the case of your code, it duplicates a new enemy on each loop.
for (i = 1; i<nrEnemies; i++){
//DO STUFF
}
-should I ever do something stupid like this ever again?
You should check out the Flash help files (press F1 in Flash) and maybe AS: Main if you're keen on learning how to code games.
Happy happy joy joy joy
Not too sure, but can't you just add or subtract the vcam _x or _y from the spawn point? That seems like it should place them at the correct positions
At 4/10/09 10:03 AM, Kirk-Cocaine wrote:At 4/10/09 09:52 AM, 4urentertainment wrote: I may not know AS3, but I know that that was AS3.No it was AS2.
Aye, AS2 does have some listener capabilities, just not as extensive or necessary as AS3. Most people seem to prefer to use an enterFrame Key.isDown check, but the Key.Listener is definitely a better method in some (most?) cases.
At 4/10/09 08:34 AM, Spikedit wrote: Thanks guys, what are the key numbes for "p" and "ctrl"? (like A is 65)
Put this code on frame 5:
kl=new Object();
kl.onKeyDown=function(){
if(Key.getCode()==65){
gotoAndStop(6);
Key.removeListener(kl);
}
}
Key.addListener(kl);
stop();
At 4/8/09 08:32 AM, Rig wrote: SCREW YOU ALL
Promises, promises
If you're importing mp3, it needs to be 44.1 KHz and I believe at least 16bit
You should be able to change this in the File>Save As dialogue in Audacity
Senocular's explanation is a fairly good one
At 4/7/09 12:39 AM, AlexisGOAR wrote: oooo sorry
No worries, it's nothing personal, just necessary to prevent the Flash forum being overrun by collab threads
Look up onSoundComplete in the Flash help files
onSoundComplete = function() {}
Invoked automatically when a sound finishes playing. You can use this handler to trigger events in a SWF file when a sound finishes playing.
Sound.duration and Sound.position might also be useful to you
At 4/6/09 03:58 AM, CinisterGames wrote: How do you just make your crosshair zoom in so it wont seem blank??
Clarify please, not sure exactly what you're asking
Posting a list of games currently with medals here, for easy reference
-
Alkie Kong 2 by PsychoGoldfishClick to view.
- Type
- Game
- Rated
- Ages 13+
-
Deliver That Fulp by PaperBatClick to view.
- Type
- Game
- Rated
- Ages 13+
-
Fear Unlimited Issue2 by DizimzClick to view.
- Type
- Game
- Rated
- Ages 17+
-
Newgrounds Pass 3 by Nicholas-DearyClick to view.
- Type
- Game
- Rated
- Ages 13+
-
Portal Defenders by LuisClick to view.
- Type
- Game
- Rated
- Ages 17+
-
Thing-Thing Arena 3 by WeaselClick to view.
- Type
- Game
- Rated
- Ages 17+
Games with medals (maintained by Wylo)
Flash Newbie Help by -ArcticHigh-
Flash (noob) tutorial by -hellraiser-
Starting with Flash by Otacon
NG's best tutorial movies
Flash tuts list by AGH
Flashkit
actionscript.org
AS: Main
Kirupa
good-tutorials.com
Of course, the correct answer given the situation would've been 'That's OK, I'm gay'
At 3/31/09 09:13 AM, ResidentOEvil wrote: Ok, about 1 hour til' school.
What do you think has a little radiation for me to find
Wind-up clocks/watches with luminous paint
Maybe she was just saying that married life doesn't include excitement

