Be a Supporter!
Error, or not an error? Posted October 6th, 2008 in Game Development

I am making a movie and this "error" keeps popping up when I run it

SWF contains multiple copies of a sound item

I know why it's saying that I just want to know if it's going to be a problem or if I can just ignore it.
(and if I can ignore it, how do I make it stop saying that without changing why it's saying that)

Scene looping Posted August 4th, 2008 in Game Development

I have a game that so far is one frame long. I accomplish things by using the function:

onClipEvent(enterFrame)

And because it's only one frame the game "enters frame" many times per second.

However, I want to add a scene (or perhaps just another frame) but I don't want it to go to that frame/scene unless something happens and I want the first frame to continue looping without having to go to the new frame/scene until I want it to.

Does anyone know how I might do this?

Response to: Actionscripting glitch Posted August 3rd, 2008 in Game Development

:D Thank you so much!

It works perfectly now

Response to: Actionscripting glitch Posted August 3rd, 2008 in Game Development

:| what does that mean?

Actionscripting glitch Posted August 3rd, 2008 in Game Development

Alright, I have a game where when you click this button:
----------------------------------------
----------------------------------------
---------
on (press) {

_root.lemonTime = Math.floor(Math.random() * 450000) + 1;
_root.assigNumLemon = _root.assigNumLemon + 1;
_root.numberOfLemons++;

lemonK = Math.floor(Math.random() * 80) + 152;
lemonJ = Math.floor(Math.random() * 35) + 90;
duplicateMovieClip (_root.lemon_mc, "lemon_mc" + _root.assigNumLemon, _root.assigNumLemon);

_root.lemonInfo_mc.lemonAmount_txt.text = _root.numberOfLemons;
_root.lemonTimeArray[_root.assigNumLemon ] = getTimer() + _root.lemonTime;

setProperty ("lemon_mc", _x, lemonK);
setProperty ("lemon_mc", _y, lemonJ);

}
----------------------------------------
----------------------------------------
-----------------------------

It duplicates a lemon movie clip in random places. However, when I click this button:

----------------------------------------
----------------------------------------
----------
on (press) {

_root.limeTime = Math.floor(Math.random() * 450000) + 1;
_root.assigNum = _root.assigNum + 1;
_root.numberOfLimes++;

k = Math.floor(Math.random() * 57) + 89;
j = Math.floor(Math.random() * 30) + 99;
duplicateMovieClip (_root.lime_mc, "lime_mc" + _root.assigNum, _root.assigNum);

_root.limeInfo_mc.limeAmount_txt.text = _root.numberOfLimes;
_root.timeArray[_root.assigNum] = getTimer() + _root.limeTime;

setProperty ("lime_mc", _x, k);
setProperty ("lime_mc", _y, j);

}

----------------------------------------
----------------------------------------
------------------------------------
it SHOULD only do the same thing but with limes.

HOWEVER! It also gets rid of any lemons that are on the screen. One lemon for every time you click.
I cannot for the life of me figure out why. I hope you can figure it out from this but if you need more code please let me know

PS. this also happens but reversed if you click the lime button first (ie. the lemon button gets rid of the limes)


I have an array that I want to take an element out of permanently. I tried to use arrayName.splice() but that did not work. Or maybe I was just using it wrong.

So could someone suggest another way to get an element out of an array and or explain how to use the .splice() function?

Response to: movie clip won't go away Posted July 26th, 2008 in Game Development

using "this" would not work because the code is not in the Movie Clip I want to get rid of.

I tried unloadMovie("lime_mc" + i) but it just did the same thing as the removeMovieClip

movie clip won't go away Posted July 26th, 2008 in Game Development

I am trying to get rid of a movie clip after a certain amount of time occurs. I have the timing working. I can get things to happen after a specified amount of time. The problem however is getting the movie clip to go away

this is a button that duplicates the movie clip and assigns it an ascending number and puts the duplicated clip in a random place

on (press) {

_root.timeArray[1] = getTimer();
_root.assigNum = _root.assigNum + 1; //random(200);
k = Math.floor(Math.random() * 60) + 84;
j = Math.floor(Math.random() * 30) + 99;
duplicateMovieClip (_root.lime_mc, "lime_mc" + _root.assigNum, _root.assigNum);

_root.timeArray[_root.assigNum] = getTimer();
trace("timeArray[" + assigNum + "]" + _root.timeArray[assigNum]);

setProperty ("lime_mc", _x, k);
setProperty ("lime_mc", _y, j);
}

this is an empty movie clip that goes through the array that holds the times of when you click the button. It should also get rid of the movie clip after 5 seconds of it's existance. However it does nothing.

onClipEvent (enterFrame){
for(i = 0; i < _root.assigNum; i++)
{

if (getTimer() - _root.timeArray[i] >=5000)
{
removeMovieClip("lime_mc" + i);
}
}
}

Response to: Making a movie clip dissapear Posted July 26th, 2008 in Game Development

Ok, I understand what you mean and I tried to implement it however I hit a snag that I don't seem to be able to figure out

on (press) {

assigNum = assigNum + 1;
timeArray = new Array();
k = Math.floor(Math.random() * 60) + 84;
j = Math.floor(Math.random() * 30) + 99;
duplicateMovieClip (_root.lime_mc, "lime_mc" + assigNum, assigNum)
timeArray[assigNum] = getTimer();
setProperty ("lime_mc", _x, k);
setProperty ("lime_mc", _y, j);
--->
}

I've created the array and tried to put the timer in and if I click once timeArray[1] gets a number. However if I click twice, timeArray[1] suddenly becomes undefined. I have no idea why.


I am trying to make a bunch of movie clips called "lime_mc" to go away when a certain number of seconds has passed.

The problem with this is that I duplicate one movie clip using this method:

on (press) {

assigNum = assigNum + 1;
k = Math.floor(Math.random() * 60) + 84;
j = Math.floor(Math.random() * 30) + 99;
duplicateMovieClip (_root.lime_mc, "lime_mc" + assigNum, assigNum);
setProperty ("lime_mc", _x, k);
setProperty ("lime_mc", _y, j);
trace(assigNum);
}

which assigns an ascending number to each duplicated movie clip.

Since all the movie clips are named the same I don't know how to get rid of them gradually and automatically

Response to: Enabling buttons problem Posted April 12th, 2008 in Game Development

Any other suggestions

Response to: Enabling buttons problem Posted April 12th, 2008 in Game Development

Unless that's default, that's not the case

Enabling buttons problem Posted April 12th, 2008 in Game Development

Hia,

I am trying to enable a disabled button once a movie clip reaches a certain point. I tried doing

fore_btn.enabled = true;

in the movie clip at the point I want the button enabled but the button stays disabled.

Suggestions?

Response to: Video clips in flash Posted January 31st, 2008 in Game Development

Yes, I did try that but that does not work for some reason. It gives me only the audio and not the video.

Also, when it gets to the "Encoding" part of the importing it shows black on the screen on the right.

Video clips in flash Posted January 31st, 2008 in Game Development

I am trying to put a video clip into a flash document but it never works.
Does the clip need to be a certain size or type or legnth or anything like that?

Response to: Putting the icon on Posted January 10th, 2008 in General

...ok, I tried LittleRena's and it didn't work, then I tried Ozcar's and it worked

Does anyone know why :-S so I can stop it from hapening in the future?

Response to: Putting the icon on Posted January 10th, 2008 in General

I'm using paint, and here it is:

Putting the icon on

Putting the icon on Posted January 10th, 2008 in General

I have a 46x46 gif icon that I want to represent my flash with but whenever I try to put it on, it says I can't use tranparent backgrounds. But here's the weird part: I have no transparent background.

Anyone know why this might be happening?

Response to: Duplicating Posted September 23rd, 2007 in Game Development

I take that back, thank you! it worked!!

Response to: Duplicating Posted September 23rd, 2007 in Game Development

But if I do that, every time I press the button i will go back to zero.

Duplicating Posted September 23rd, 2007 in Game Development

I have some code that I think should be working but it doesn't

on (press) {
i = i + 1;
k = Math.floor(Math.random() * 60) + 84;
j = Math.floor(Math.random() * 30) + 99;
duplicateMovieClip (_root.lime_mc, "lime_mc" + i, i);
setProperty ("lime_mc", _x, k);
setProperty ("lime_mc", _y, j);
}

This code puts a duplicated movie clip in random places within a specific area. The problem comes from the i = i + 1, I output the number that i is and it always comes out to NaN when it should be 1 then 2 then 3 then 4.

Any ideas why it's doing that and perhaps how to fix it?

Response to: Loading Videos into Flash Posted September 12th, 2007 in Game Development

OK here's exactly what I do:

I go to File -> Import -> Import to Library(or Stage)
And I choose a video from my files on my computer, either an AVI or MPEG or MPG

It pops up the box for "Import Video" and I choose the radio button for "On your computer" (and I push "next)

I choose the radio button for "Embed video in SWF and play in timeline (then next)

I choose symbol type "Embedded Video" Check both boxes and slect the radio button for "Embed the entire video" (Click next)

The next part has a black screen where there should be the video even when I choose every Quality

Then it loads and all I get is the audio from the video.

Now, I've done this before with other files with the same file types and they worked fine but some do not and I can't figure out what the difference is.

Response to: Loading Videos into Flash Posted September 12th, 2007 in Game Development

It would have to load first before I can do that. I can get the audio every time but the video won't play.

Loading Videos into Flash Posted September 12th, 2007 in Game Development

I've been trying to put some recorded videos onto a flash program but oddly only some of them work, I know that it's not size or file type that prevents some from being loaded. Would anyone know what is required to load a video?

Response to: Programming A Fake Clock Posted September 10th, 2007 in Game Development

That worked :-) thanks. What does Math.floor do?

(also, that fixed the hour problem but the seconds continue to go past 60 after the hour has changed. Any thoughts on that?

Response to: Programming A Fake Clock Posted September 10th, 2007 in Game Development

Is there a better way to do the same thing the modulus does? And the =+ part wasn't the problem, I had it before as ++ and the problem was still there.

Programming A Fake Clock Posted September 10th, 2007 in Game Development

I'm trying to program a fake clock onto my game. So far I've gotten it to count up every second but when it gets to 60 it changes the way I want it to but once it passes 60 the changes change back

Here is my code:

_root.onEnterFrame = function()
{
var seconds = Math.round(getTimer()/1000);

var timeHour = 0;
var timeMinute = seconds

//this if statement doesn't keep
if(timeMinute % 60 == 0)
{
seconds = 0;
timeHour =+ 1;
}
if(timeMinute < 10)
{
timeMinute = "0" + timeMinute;
}
clock_txt.text = (timeHour + 8) + ":" + timeMinute;

}

Response to: Rookie Actionscript Question Posted September 7th, 2007 in Game Development

Ok...it's still not working,

I have this code above it and I know this works but with the arrow keys instead. What I did was just replace the arrow key code with the ASCII code for the letter keys

function moveStuff()
{
if (Key.isDown(Key.LEFT))
{
this._x -= 5;
}
if (Key.isDown(Key.RIGHT))
{
this._x += 5;
}
if (Key.isDown(Key.UP))
{
this._y -= 5;
}
if (Key.isDown(Key.DOWN))
{
this._y += 5;
}
}
ball_mc.onEnterFrame = moveStuff;

Response to: Rookie Actionscript Question Posted September 7th, 2007 in Game Development

put that code on the ball_mc along with the code I already have?

Rookie Actionscript Question Posted September 7th, 2007 in Game Development

Ok, this is probably a really simple problem but I just don't know enough about actionscript yet to work though it:

I am trying to move a symbol using the WASD keys and this is how I tried to do it:

function moveOtherStuff()
{
if (Key.isDown(97))
{
this._x -= 5;
}
if (Key.isDown(100))
{
this._x += 5;
}
if (Key.isDown(119))
{
this._y -= 5;
}
if (Key.isDown(115))
{
this._y += 5;
}
}
ball_mc.onEnterFrame = moveOtherStuff;

However nothing happens when I push the WASD keys

Any thoughts?