Be a Supporter!

Is there a way to export all frames of a movieclip as seperate images in one shot?

Using External Interface Posted June 3rd, 2011 in Game Development

I have an object with a bunch of methods. They must be called by the object. If I want to call these methods from outside flash using javascript, can I achieve this effect through External Interfaces? I want to register callbacks of methods that are within a class basically.

Never used this before

Response to: Malformed xml data error? Posted June 1st, 2011 in Game Development

I'm just going to parse it manually...whatever.

Malformed xml data error? Posted June 1st, 2011 in Game Development

<?xml version="1.0" encoding="UTF-8"?><data><text>call john</text><confidence>0.890162587165833</confidence><result>success</result></data>

var xmldata:XML=new XML(string_containing_above_xml);

Getting this:
Error #1088: The markup in the document following the root element must be well-formed.

???

Response to: Can't use custom class Posted June 1st, 2011 in Game Development

With actionscript 3, putting the class file in the same folder as your .fla is not enough for it to be recognized. Flash doesn't reference files from a relative location, it references through the actionscript source directory defined in edit>preferences>actionscript>actionscri pt2.0/2.0 settings

I'm not sure if that path is completely correct, but I am pretty sure it's in edit>preferences.

If you make a source directory directly locate a class file, all you need is "package{....}" with no reference to a folder anywhere. If you make one that locates the folder which contains a folder with your class file, your class should start with the line "package folderwithclassinit{....}".

Try directly referencing you class file directory first

Response to: Determine whether ipad or iphone Posted May 25th, 2011 in Game Development

Well anyway, I solved this using the Capabilities.screenResolutionX or Y property. On a computer, this will output your computer monitor resolution, for the iPad, either 768 or 1024, and for the iphone 3gs, either 320 or 480.

Response to: AS3 display movement Posted May 25th, 2011 in Game Development

At 5/25/11 12:57 PM, UnknownFury wrote:
At 5/25/11 12:34 PM, pt9-9 wrote: So you can achieve this easily by using the VCAM
This is not recommended. vCAM is a tool for animators, not programmers.

Could you explain that a bit more?

Response to: Help Me Programers! Posted May 25th, 2011 in Game Development

The difficulty in what you're doing is that you have platforms that are slightly tilted. If you were to make a completely side-scrolling platform jumper, that would be much easier. In the case you drew, the jump "failing" depends on your y coordinate. If you don't know how to program that well, I suggest you stick to a complete side-scroller with no perspective.

Response to: AS3 display movement Posted May 25th, 2011 in Game Development

So you can achieve this easily by using the VCAM, here's a link:
http://bryanheisey.com/blog/?p=5

If you center the vcam on your player, it will follow him throughout your flash. You could also achieve the same effect by parallax scrolling, having the objects about the player move instead of the actual player move when the key is pressed.


I'm trying to make an app through a flash iOS project, and I need to be able to detect whether the app is running on the ipad or the iphone in order to resize the app correctly.

I was trying to use the Capabilities.manufacturer property, but it kept returning "Adobe iOS" for all devices.

Is there a way to do this? Like, are there features that are exclusive to the iPad, iPhone 4, and iPhone 3GS that I can detect to see which one it is?

I've googled this like crazy haha

Response to: Timer Efficiency Posted May 22nd, 2011 in Game Development

I can't do a bunch of if statement because I don't know when they begin beforehand, everything is known externally.

But you're right about that Idea of constant checks. All i need to do is reset my one timer

Timer Efficiency Posted May 22nd, 2011 in Game Development

How badly would timers lag a mobile flash app (iphone/ipad) if I needed around 500+ timers? I need these timers because I am loading clips externally at the beginning of my flash file and they need to appear at specific points corresponding to an audio file.

Response to: External files and Bitmaps Posted May 20th, 2011 in Game Development

Right so the code above grabs that one image, but you still need to crop it dynamically. Assuming each individual image is the same dimensions, you can used getPixels() and setPixels() until some counter reaches the amount of pokemon images.

so once you use that code, turn the Loader into a Bitmap. Use the bitmapData property from this bitmap to call the getPixels(rectangle) command. The rectangle is an actual Rectangle object, the width and height properties will be constant while the x and y changed, they indicate the top left coordinate of the image you're trying to crop from the large image.

You want to make an array of bitmapData, each index will store a different bitmap, use setPixels(rectangle, bytearray) to place the data inside the index. The bytearray is what is returned from the getPixels method.

Response to: Event-driven function returning? Posted May 20th, 2011 in Game Development

At 5/20/11 04:28 PM, PSvils wrote: Unfortunately you'll need to break up your current single function into 2 functions, the function that sets everything up and requests the number, and another function that picks up the processing of the number after it's loaded. It really doesn't make a difference though...

I'm trying to replicate a method in the java version of this code that has a single function do it all.

Since I can't, my solution will be as you said, dividing it up into two functions and then dispatching an event saying that the number has been stored for other handling.

Response to: Event-driven function returning? Posted May 20th, 2011 in Game Development

To further explain, I'm making a generic class so that others may be able to call a function that simply returns a value. I don't want them to have to check a property that stores a value after the call if they don't have to. That's how my current set up works...

Response to: Event-driven function returning? Posted May 20th, 2011 in Game Development

I could do that, but regardless I want to return that number value from this preliminary call. It's not about having the number instantly; it's about using one line of code to get the number.

There's a very sloppy way I can do this with timers, but I'd rather not if there is a better solution


I want a number to be returned from a function.

But in order for the function to acquire the number, it needs to load a url request.

So the function tells a URLLoader object to load a URLRequest, and in this loader's COMPLETE event handler, only then do I get this number that I want to return in the other function.

Hopefully that makes sense, the state of the value I want to return is event driven and I can't return it in the same function that requests it.

Is there a way around this?

Response to: XMLsocket for mulitplayer game Posted April 17th, 2011 in Game Development

Ok so I'm storing the list and data tables somewhere though, like in an xml file?

Response to: XMLsocket for mulitplayer game Posted April 17th, 2011 in Game Development

At 4/16/11 06:04 PM, knugen wrote: Not really answering your question, but have you looked into the already existing alternatives for example SmartFoxServer?

I actually have no idea which way is better. Based on the actionscript livedocs on the XMLsocket class, I'm a bit discouraged to use it because of the technicalities on the server side end.

Smart fox seems to be the way to go, thanks


So I want to develop a very simple game that allows two random players to connect to each other. a game where the person who pushes the button first and guesses the answer correctly wins, kind of like jeopardy.

I know an xmlsocket would allow me the real time window to the server that I need, but I do not know how to have multiple pairs of players engaging at the same time.

If I have a single port that has the socket server connection, how exactly do I assign the equivalent of "rooms" for multiple games to occur together? Would I have to store the "sessions" in a database? Or could the "address" of a particular game be stored client side?

Response to: Removing regions from bitmapData Posted April 3rd, 2011 in Game Development

At 4/3/11 07:05 AM, GustTheASGuy wrote: surface=new Bitmap(surfaceData);

Doesn't do anything, and isn't necessary. You're creating a new display object that you don't put anywhere.

surface is a movieClip initially added to the stage, I thought i was updating it with that command.

Thanks for all the help btw

Response to: Removing regions from bitmapData Posted April 3rd, 2011 in Game Development

At 4/3/11 07:05 AM, GustTheASGuy wrote: That won't cause erasure, 'draw' mixes the image onto the bitmap, if alpha is zero it just doesn't draw anything.

So, draw wouldn't set the ARGB of pixel points on the pixels it writes over to an alpha of 0?

3) The solution is to manually modify the pixel data in a circular area.

Are you sure that isn't a waste of time? Lets say I don't set the alpha to zero, and leave it in its original width and color. Since the projectile is black, and the surface is always nonblack. I could delete the black I drew onto the surface pixel data using threshold().

The only problem I don't see the effects of draw() anywhere


So I'm trying to re create a game in flash, where you have tanks on hills, and you can adjust the trajectory of their cannons to shoot projectiles.

When the projectile hits the surface, I want the surface bitmap to have all data values near the point of collision (a sweeping circle of points) have an alpha value of zero, so the ground is permanently destroyed.

So my code looks somewhat like this:

if(surface is hit){
  make_bullet_10x_larger()
  
  transformMatrix=new Matrix();
  transformMatrix.translate(bullet.x,bullet.y);
  
  transparentMatrix=new ColorTransform();
  transparentMatrix.alphaOffset=-255;

  surfaceData.draw(bullet, transformMatrix, transparentMatrix);
  surface=new Bitmap(surfaceData);
  
  delete_bullet()
}

And nothing really happens, the surface bitmap doesn't update or anything. And the projectiles seem to be immediately disappearing when i instantiate them

I use the transformMatrix to make sure the draw() occurs at the location of the bullet.

Am I approaching this the right way or does the draw command have another purpose?

Response to: Love (Philisophical) Posted December 31st, 2009 in Politics

Fools.

Love is a delusion caused by feminist indoctrination in popular media of your childhood, specifically Disney movies in this era, all for the purpose of forcing men into individualism-depleting families while women, with a natural ability to bare a family, progress further towards being the superior gender.

Love is slavery, because every male by intrinsic nature wants to spread their seed indiscriminately. Look at every large mammal on this planet, and tell me that isn't true.

Watch as we slowly become a tool for female breeding alone, devoid of a voice in society and forever underneath the vaginal mandate.

Response to: Would this sell if I finished it? Posted December 26th, 2009 in Game Development

At 12/26/09 11:06 PM, the1manwiththeplan wrote:
At 12/26/09 09:14 PM, freedumbring wrote: I like the idea!

Maybe instead of the mouse having control of Santa, the arrow keys could?
I agree having Santa sleigh and the reindeer rotate on the axis of the sleigh just looks gross
(reindeer don't fly sideways) some sort of slow rotation with the arrow keys would look more natural

especially when Santa and his reindeer are flying down the street at a backwards diagonal angle

I think you should either have Santa fly and drop presents from a helicopter
(so that the strange angles and rotation look more normal and natural)

or... have the sleigh traveling in one direction ( sleighs don't fly sideways down the street)

I want to keep the rotation like motion there, but I can change the pivot point from the sleigh to the last deer and use arrow keys to make it seem more realistic. I don't see what's so unrealistic about it though, deers don't move linearly. I'll have to slow everything else down a bit though, the missiles go too fast for key movement.

Thanks for the advice

Meh, I'm not going to change the theme. I think it's too specific

Would this sell if I finished it? Posted December 26th, 2009 in Game Development

http://megaswf.com/view/17d342919a6680cf 59c424de7dbbefb8.html

It's a little late for christmas, and it's not exactly coming out the way I wanted it to, but if i finished this game could it possibly be sold?

It's a survival mode game where your santa and you're running late on your deliveries, so you decide to chuck them down the chimnies of houses. The missiles have a plot too, too stupid for me to explain though -.- You have a time limit till day break.

There's a but more of it done, but I don't have the latest version of flash on this laptop to publish it and could only find this version on my flash drive.

I guess I'm asking what could I improve on, because I'm going to finish it regardless.

Thanks

Response to: Shifting the axis of rotation Posted December 7th, 2009 in Game Development

I guess I'll place everything in a nested movieclip. Which was not what I wanted to do...but it gets the job done.

Response to: Shifting the axis of rotation Posted December 7th, 2009 in Game Development

At 12/6/09 10:15 PM, Glaiel-Gamer wrote: clip center = point + V;
clip rotation += theta

How exactly does this part work? I know the angle that it needs to rotate from the new center of axis.

Is there a property that defines it?

I'll try some trig for now...

Shifting the axis of rotation Posted December 6th, 2009 in Game Development

Is there anyway to program an object to shift its axis of rotation? I'm trying to simulate center of mass physics, and I need the axis of rotation to change with respect to the point that is hitting the floor and/or other object.

I don't want to fiddle around with moving all the movie clips...because then I would have to worry about putting the axis back where it should be, and i'd also have to reposition the entire object once I move everything. Right?

Response to: data in mysql for turn based game Posted August 18th, 2008 in Programming

At 8/18/08 05:06 PM, BoneIdol wrote:
At 8/18/08 04:57 PM, pt9-9 wrote: And this makes the data for the units store differently?
Could you elaborate on what you mean by this? It has been nearly 12 hours since I wrote that post; my trail of thought has been lost, found by bad people, had its feet set in concrete and then finally dropped into a very deep river.

What I was trying to get at was that if you design your database properly you can very easily get the results you want with trivial amounts of code.

Sorry for the delay

Originally I was asking if there was a way to avoid using strings that have data separated by characters that require exploding/imploding, or just a better way of storing the unit data entirely. You spoke about benchmarking, but I didn't know if that was an answer to my question or not.

From my understanding, your post organized all of my data, but did not explain how I could do what I mentioned above. I would still have to condense data into a string with that method of organization.

Sorry for misleading you