Recent posts by tivaelydoc on Kongregate

Flag Post

Topic: Game Programming / Need help with dynamic url button!

Ya know, I’ve been staring at this for awhile and trying various shit, and I still can’t figure it out.

 
Flag Post

Topic: Game Programming / Switch multiple arrays via buttons.

I’ve got 26 arrays, one for each letter of the alphabet, that store words. I also have 26 buttons. Is there a way to make the buttons switch the arrays?

 
Flag Post

Topic: Game Programming / How do you tell one MC to move another MC? (need someone to look at my FLA)

Is it the file format? I can save it in F8 if you want.

 
Flag Post

Topic: Game Programming / How do you tell one MC to move another MC? (need someone to look at my FLA)

Sweet thanks, think you could look at my FLA and tell me why it’s so glitchy?

http://tivaelydoc.110mb.com/help.fla

 
Flag Post

Topic: Game Programming / How do you tell one MC to move another MC? (need someone to look at my FLA)

Well, I did something like this:

http://tivaelydoc.110mb.com/help.fla

But I still can’t get it to work.

 
Flag Post

Topic: Game Programming / How do you tell one MC to move another MC? (need someone to look at my FLA)

do you know how i can assign 2 onPress buttons?

I was thinking something like:
if (root.MovieClipName frame 1) {
button.onPress {
//whatever1
}
if (
root.MovieClipName frame 2) {
button.onPress {
//whatever2
}
Is this possible?

 
Flag Post

Topic: Game Programming / How do you tell one MC to move another MC? (need someone to look at my FLA)

I’ve got a button (levels2) nested in a MC so that it has a fancy animation.
I want it so that when that button is pressed, it goes to the stage and plays another MC to frame 2.

 
Flag Post

Topic: Game Programming / Looking for a save/load tutorial.

I’ve read this one, but it briefly addresses my issue:

“You can send text and numbers to the savefile, using script variables or text input”

The main thing I need to know is how would I do this:

So, I’ve a game that generates a string of text in a dynamic text box. What I want it to do, is have a button that when pressed saves that string of text. My variable for the text box is called result and I was thinking that I could setup another text box somewhere on a different frame to load that text. I want to have 5 of these save/load features, but I don’t know how I would set it up.

I think that if I had 5 buttons for each save thing, then onPress of the save button, it would send the variable result of generated text to another text field, called save1, save2, etc. Then from there, the save text fields (which on are on a different frame or something) would be blank until the adjacent load button is pressed. Like load1 would load save1’s generated text and put it into the save1 text box.

I understand a little about the save and load feature from the tutorial, but I’m not sure how I would accomplish this.

 
Flag Post

Topic: Game Programming / _root. in removeMovieClip()

They ARE sigh Is there a way I can put the game up WITHOUT publishing it? Or show you my entire project T_T

Yea, actually, use 110mb.com
They let you upload your fla and swf and as or anything else! If your file size it too large (more than 10mb), then use mediafire.com

 
Flag Post

Topic: Game Programming / Need help with dynamic url button!

Oh yea, in the for loop. That makes sense.

So, why does it still load the wrong ones?

Here is my FLA:

http://tivaelydoc.110mb.com/soundbut.fla

 
Flag Post

Topic: Game Programming / Need help with dynamic url button!

Like, I just changed everything to exactly what you said. I took out the words.onPress inside the makeButtonFunction and left everything alone.

 
Flag Post

Topic: Game Programming / Need help with dynamic url button!

Yea I know it’s horribly wrong :p

I was that as an example cuz I don’t understand closures at all.

Ohh, I see. So like this without the onPress cuz it calls it from the makeButtonFunction:

words.onPress = makeButtonFunction(i);

function makeButtonFunction(i) {
return function() {
if (Key.isDown(Key.SPACE)) {
getURL(“http://www.urbandictionary.com/”+wordlist[i],“_blank”)
} else {
//sound shit
}
}
Then I just leave all the shit in my for loop?

 
Flag Post

Topic: Game Programming / Need help with dynamic url button!

thats what i thought, but i tried that earlier when i was moving things around and I still can’t get it to work:


words.onPress = makeButtonFunction(i);

function makeButtonFunction(i) {
return function() {
words.onPress = function() {// makes each instance clickable
if (Key.isDown(Key.SPACE)) {
getURL(“http://www.urbandictionary.com/”+wordlist[i],“_blank”)
} else {
root.ss = new Sound(this);
_root.ss.setVolume(vol);
_root.ss.attachSound(this.butt
text.text);
_root.ss.start(0,1);
}
};
}
}

for (i=0; i<5; i++) {//the array’s first value has its 0’ path
words = attachMovie(“wordbut”, "wordbut"+(i+1), getNextHighestDepth());
words.x = (words.width/2)10;
words.y = mcStarty;
mcStart_y += (words._height
10);// gives the next button a new location on screen
words.butt_text.text = wordlist[i];// prints the text to a dynamic text field in each instance of the movieclip
words.onRollOver = function() {
this.gotoAndPlay(2);
};
words.onRollOut = function() {
this.gotoAndPlay(1);
};
}

 
Flag Post

Topic: Game Programming / Need help with dynamic url button!

where do i put the for loop?

 
Flag Post

Topic: Game Programming / Need help with dynamic url button!

Alright. So where do I put what code?

I guess I don’t understand your syntax. If I put the script for the link and for the sound button to play in the makeButtonFunction, and the rest in the words.onPress = function() { it doesn’t work. I tried this before and it don’t load the buttons.

 
Flag Post

Topic: Game Programming / Need help with dynamic url button!

That makes sense, but where do I put the attached buttons?

If I do this:


function makeButtonFunction(i) {
return function() {
words = attachMovie(“wordbut”, "wordbut"+(i+1), getNextHighestDepth());
words.x = (words.width/2)10;
words.y = mcStarty;
mcStart_y += (words._height
10);// gives the next button a new location on screen
words.butt_text.text = wordlist[i];// prints the text to a dynamic text field in each instance of the movieclip

words.onPress = function() {// makes each instance clickable
if (Key.isDown(Key.SPACE)) {
getURL(“http://www.urbandictionary.com/&#8221;wordlist[i],“_blank”)
} else {
root.ss = new Sound(this);
_root.ss.setVolume(vol);
_root.ss.attachSound(this.butt
text.text);
_root.ss.start(0,1);
}
};
words.onRollOver = function() {
this.gotoAndPlay(2);
};
words.onRollOut = function() {
this.gotoAndPlay(1);
};
}
}
for (i=0; i<5; i
+) {//the array’s first value has its 0’ path
words.onPress = makeButtonFunction(i);
}

It’s doesn’t attach them. I tried moving them around and whatnot, but I can’t seem to get it to work.

 
Flag Post

Topic: Game Programming / Need help with dynamic url button!

The easiest way to show you is with this fla:

http://tivaelydoc.110mb.com/soundbut.fla

Or swf (hold space and click on button to notice error):

http://tivaelydoc.110mb.com/soundbut.swf

Pretty much, as you can see from the swf, I have an array of words stored on buttons. What I want to do is when you hold space and click on the button, it loads the link with whatever word is in the array. This is the AS:


var wordlist:Array = Array(“dog”, “bowl”, “fighting”, “chair”, “venezuela”, “dog”, “bowl”, “fighting”, “chair”, “venezuela”, “bowl”, “fighting”, “chair”, “venezuela”);

for (i=0; i<5; i++) {
//button shit
words.onPress = function() {
if (Key.isDown(Key.SPACE)) {
getURL(“http://www.urbandictionary.com/&#8221;+wordlist[i],&#8220;_blank&#8221;)
} else {
//play sound
}
}
}

How come it’s not loading the right word? It’s only opening chair.

 
Flag Post

Topic: Game Programming / Store text into a variable for saving and loading?

So, I’ve this text box and I want it to store the text into a variable, like a MC with a dynamic text field on it. I was thinking I could but a button under the text box so that when clicked it stores into the dynamic text field. I think it would be something like:

words.onPress = function() { //words is the button
words.dynamictextfield.text = something //to put the text in the box
}

The reason I’m trying to figure this out is so that I can save/load the MC with the dynamic text field as a variable.

 
Flag Post

Topic: Game Programming / Best and smallest audio file format that's compatable with flash?

Damn, not even ogg?

 
Flag Post

Topic: Game Programming / Best and smallest audio file format that's compatable with flash?

But wav is the largest. If I converted all my audio to wav, I would have 50mb worth of audio. Would flash help reduce the size?

 
Flag Post

Topic: Game Programming / Best and smallest audio file format that's compatable with flash?

I’ve got 1500 audio clips to add to my game, but they’re all relatively small; from 10kb to 30.

Even at that, I’ve got 600 recorded and now it’s at 11mb.

I’m using mp3 file format right meow, but I see that there are tons of other ones:

WAV, OGG, AAC, AMR, FLAC, MPC, MMF, AU, AIFF, QCP, real audio, 8SVF, MAUD, PRC, SNDT, SF, WVE, VOC, AVR, TXW, MOD, 3GP, XM, etc.

Which one would be the best to use with flash to help conserve space?

 
Flag Post

Topic: Game Programming / JSFL for adding all sound clips to frames in a MC.

I think I could do this:


for (var j, i = 0; i < library.items.length; i++)
if (library.items [i].itemType == “sound”)
{
document.getTimeline().layers0.frames[j].soundLibraryItem = library.items [i];
j++;
}

But I can’t seem to get it to work because i need to define library.

 
Flag Post

Topic: Game Programming / Will Kongregate Support X Width?

What I would do is scale it down to 700 by 438 then add a full screen feature similar to youtube.

Here’s a great example:

http://www.megadev.co.uk/t4c.htm

 
Flag Post

Topic: Game Programming / JSFL for adding all sound clips to frames in a MC.

I’ve got pieces but I’m not sure how to finalize it.

I know that this:


var document = fl.getDocumentDOM();
var soundItem = document.library.items[ document.library.findItemIndex( “mySound” ) ];
document.getTimeline().layers0.frames0.soundLibraryItem = soundItem

Adds the sound clip mySound to the first frame. I was looking and I think this would add all items instead just one:

if (lib.items [i].itemType == “sound”) lib.selectItem (item.name)

From there, I need it to add one sound clip to one frame and then make another frame, which I think this should do it:

document.getTimeline().insertFrames();

But I don’t know how I would make it add the frames to a specific MC or how to put this all together.

 
Flag Post

Topic: Game Programming / Increase scroll rate when held down by mouse.

I got this button that scrolls when clicked. Is there a way to increase the rate if the button is held down?


butt_up.onPress = function() {
if (ison>0) {
ison -= 1;
rebuild();
}
};
butt_dwn.onPress = function() {
if (ison<wordlist.length-5) {
ison += 1;
rebuild();
}
};