Be a Supporter!
Response to: [As3] FileReference makes me crazy Posted December 17th, 2009 in Game Development

I just realized I'm still thinking too much in As2 Terms. Any hints to what to do to clean up the code and correct the fails?

Response to: [As3] FileReference makes me crazy Posted December 16th, 2009 in Game Development

At 12/16/09 09:33 AM, GustTheASGuy wrote: The cancel function does nothing to stop the upload.

Your code is a mess.

I tried uploadlistener.cancel(); but that just produced an error


I have recently started to get into As3. Since I learn better when having a target, I thought I'd make an uploading app because I had some experience with As2. I browsed through tutorials, Google and LiveDocs without finding a solution for my problem, it almost seems as if there's nothing wrong with the code, after all the file gets uploaded and the variables are being transferred though...

a) The loading bar starts from around 0%-40% and then suddenly jumps to 100% in a split second while the actual upload is still running. I've traced bytesLoaded and bytesTotal:

Loaded: 98304 of 639372 (15.375086803926353%)
Loaded: 639372 of 639372 (100%)

b) Clicking the cancel button does change the status text and hides the button but does nothing to the upload. It keeps running for some reason!

Complete Code:

var v_category:String = "picture";
var v_type:String = ".jpg";
var URLrequest:URLRequest = new URLRequest("http://meinedomain/upload.php");
var imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png");
var textTypes:FileFilter = new FileFilter("Text Files (*.txt, *.pdf)", "*.txt; *.pdf");
var animTypes:FileFilter = new FileFilter("Animation (*.gif, *.swf)", "*.gif; *.swf");
var codeTypes:FileFilter = new FileFilter("Code (*.exe, *.zip, *.rar, *.txt)", "*.exe; *.zip; *.rar; *.txt");
var resTypes:FileFilter = new FileFilter("Ressources (*., *.zip, *.rar, *.txt)", "*.exe; *.zip; *.rar; *.txt");
var allTypes:Array = new Array();
var uploadlistener:FileReference = new FileReference();
var variables:URLVariables = new URLVariables();

uploadlistener.addEventListener(Event.SELECT, syncVariables);
uploadlistener.addEventListener(Event.COMPLETE, completeHandler);
uploadlistener.addEventListener(ProgressEvent.PROGRESS, progressHandler);

swapbtns.browse_btn.addEventListener(MouseEvent.CLICK, browseBox);
swapbtns.cancel_btn.addEventListener(MouseEvent.CLICK, cancel);
swapbtns.cancel_btn.visible = false;

function browseBox(event:MouseEvent):void {
	if(v_category == "art"){
	allTypes.push(imageTypes);
	uploadlistener.browse(allTypes);
	}
}

//dialogue box closes
function syncVariables(event:Event):void {
	swapbtns.cancel_btn.visible = true;
	progressBar.width = 2;
	v_type = uploadlistener.type;
	variables.Category = v_category;
	variables.Type = v_type;
    URLrequest.method = URLRequestMethod.POST;
    URLrequest.data = variables;
	uploadlistener.upload(URLrequest);
}
//upload starts
function progressHandler(event:ProgressEvent):void {
	status_txt.text = "Uploading...";
    progressBar.width = 200*(event.bytesLoaded/event.bytesTotal);
	trace("Loaded: "+ event.bytesLoaded + " of " + event.bytesTotal + " ("+(100*(event.bytesLoaded/event.bytesTotal))+"%)");
}
//upload is complete
function completeHandler(event:Event):void {
	swapbtns.cancel_btn.visible = false;
	swapbtns.browse_btn.visible = false;
    status_txt.text = "Done!";
}
function cancel(event:Event):void {
	status_txt.text = "Canceled.";
	swapbtns.cancel_btn.visible = false;
}

Thank you in advance!

Response to: Searching Pro - As2/as3 Programmer Posted October 13th, 2008 in Game Development

At 10/13/08 11:21 AM, CaiWengi wrote: I can tell you from experience this guy is very good to work with. Good luck to anyone who accepts the offer.

Same to you, buddy.

Response to: Searching Pro - As2/as3 Programmer Posted October 13th, 2008 in Game Development

At 10/13/08 10:57 AM, PrettyMuchBryce wrote:
At 10/13/08 10:24 AM, ProudOne wrote: Well some people might like what we accomplished already and join our efforts?
Thanks for bumping the thread.
Gust is right. Any good programmer has enough to do already. Without compensation you are out of luck. Do people really think flash developers are so bored that they will do any job for free?

Do people really think designers are so bored that they will do any job for free?

I do lots of jobs like these because its fun and you get in the know. Also, probably someone out there is actually interested in benefitting a community like newgrounds from the start. If you can't see any good in that, but only want to have money i can't be helped i guess.

Response to: Searching Pro - As2/as3 Programmer Posted October 13th, 2008 in Game Development

At 10/13/08 08:34 AM, GustTheASGuy wrote: From your forum history you look like an incompetent. People have plenty to do themselves, if you can't do as much display what you have, too bad.

Well some people might like what we accomplished already and join our efforts?
Thanks for bumping the thread.

Response to: Searching Pro - As2/as3 Programmer Posted October 12th, 2008 in Game Development

At 10/12/08 05:16 PM, liaaaam wrote:
At 10/12/08 05:04 PM, ProudOne wrote: Also, it's just ONE of the assignments we have for the person taking the Job.
Oh, more than one job that I don't get paid for, lol.

Indeed XD, Cruel world!

I'd do it myself but im actually glad that'ive gotten AS2 to an extent where i can say i can do average things. But total webintegration? HMPFH. I tried for 6 months now and slowly i understand that My brain's not capable of it XD

Response to: Searching Pro - As2/as3 Programmer Posted October 12th, 2008 in Game Development

Also, it's just ONE of the assignments we have for the person taking the Job.

Response to: Searching Pro - As2/as3 Programmer Posted October 12th, 2008 in Game Development

At 10/12/08 04:52 PM, liaaaam wrote: So you need someone to make you something that loads an XML file, or something that reads an XML playlist and plays those songs?

Also what sort of pay are you talking.

Oh I forgot to mention that we're not paying anything. You're getting into developement of a Anticipated Community Site Project as an admin. Sure its not as much of a YAY factor as money but hey - commercials can make money, too. Probably in the future ^^


All the Info you need can be found here:

http://clubs.sheezyart.com/TheArtSitePro ject/clublog/16039/

here:

http://clubs.sheezyart.com/TheArtSitePro ject/

And here:

http://clubs.sheezyart.com/TheArtSitePro ject/gallery/

The first assignment will be developement of a Flash player capable of Loading XML - Playlists for multiple users but also needs to work with one special song in the gallery of the musician.

Thanks for your time!

Response to: A question about dynamic texts Posted October 11th, 2008 in Game Development

on(press){
	if(_root.ammo >= 2){
		_root.ammo -= 1
		_root. cash +=50
	} else if (_root.ammo <2){
		_root.ammo=5
	}
}

If ammo is bigger or equal 2, subtract one and add 50 to cash, else, if it's actually smaller than 2, just add some to ammo.

I hope this helped.
P1

Response to: Why can you vote without watching? Posted September 2nd, 2008 in Where is / How to?

Well, not really. But if they would make a text field where the creator could type the length of the flash and after the flash is started theres a countdown until unlck? That way you could measurte the time a flash loop tkes to run through twicke or once and then unlock it. Plus, on games it can be determined by saying: The dude spent time on it and clicked "x" times, that should be possible, no?

Response to: Question for the world. Posted August 11th, 2008 in Politics

At 8/11/08 02:01 AM, LazyDrunk wrote: Like an immigrant. Without an invitation, too. Or a welcoming host.

When will you lean that it's not important from which side of a border you descent because we're all human?

I don't follow this particular set of refusals. Refusing to obey Krinkels is like not paying taxes.. sure
it's nice for awhile but Jesus will eventually kill you.

I see a difference between paying taxes and going to war. Paying taxes helps your country and does not "hurt" anyone else than yourself, and that money should normally come back to you by streets and social plan, y' know, that kind of stuff.

.."theirselfes" is such a fucking butchery I feel like weeping into a Kleenex.

Im german. Can you speak German half as good as i can speak english?

Response to: Question for the world. Posted August 11th, 2008 in Politics

At 8/10/08 09:58 PM, freddorfman wrote: look war is one thing that can never be stoped EVER only a retard could not realize that

Well, Imagine the following:

Ten thousand soldiers get the order to leave the US or what country ever.
And they just stay the heck where they are.
They REFUSE to kill!
They REFUSE to obey the Madness!
They REFUSE to dehumanize theirselfes.

Well.
That's never going to happen, you know why?
Because soldiers earn so much money they don't need a conscience.
Or do not WANT that thing because it is their job to kill and be killed.

Madness.

Question for the world. Posted August 10th, 2008 in Politics

In what ways must mankind change so actual global problems, such as poverty and war, cease to exist?

Discuss.

Response to: Nazi is a German political party Posted July 16th, 2008 in Politics

Oh now i get it.

You're talking about the NSDAP
N
ationalsozialistische Deutsche Arbeiterpartei

Response to: VCam messes up my hittest Posted July 13th, 2008 in Game Development

Thanks, gee, thanks :D

VCam messes up my hittest Posted July 13th, 2008 in Game Development

Ok, this is the weirdest thing i have EVER seen.

I got the normal as2 VCam from the page of the people who coded it, imported it to my Game engine (Sloped terrain plattformer made after a AS:Main Tutorial) That works totaly fine until i enable VCam. The player starts spazzing out then and when jumping he falls through the platforms. When you land on a platform thats below the topmost, the player starts jumping on the platform, as if it was made of rubber.
I tried several alternaties, putting the action of the vcam into a function etc but nothing works, really.

This is the hittest. I hope you can find the problem. For sure it is not the whole code, just a slice so you can see how i hittest.

//Jump       
		if (Key.isDown(key_j) && _root.platf.hitTest(_x, _y+3, true) && var_up == 0) {
			var_up = 1;
			var_grav = -var_jumpmax;
			_y -= 4;
			boo_dj = true;
			this.gotoAndStop(2);
		}
		//Double Jump   
		if (!Key.isDown(key_j) && !_root.platf.hitTest(_x, _y+3, true && var_up == 1)) {
			var_up = 2;
		}

Find the Camera and code here: VCam

Thanks already :D
ProudOne

Response to: Nuclear Warheads Posted July 12th, 2008 in Politics

At 7/12/08 08:49 PM, LordJaric wrote:
At 7/12/08 08:44 PM, ProudOne wrote:
Certanly not. I'm just not american. I'm allowed to hear that stuff.
wtf are you talking about

Well about americans getting censored and locked up under circumstances close to those in Nazi germany or the DDR where everyone was subject of spionage?

Patriot Act I + II. Look at them! They're like the "Ermöchtigunsgesetze" hitler signed! They're killing your beautiful country!

Response to: Nuclear Warheads Posted July 12th, 2008 in Politics

At 7/12/08 08:18 PM, animehater wrote:
At 7/12/08 07:47 PM, ProudOne wrote: You know, President Bush said, at the end of his period he'll start a nuclear war against Iran.
Were you stoned when you posted that?

Certanly not. I'm just not american. I'm allowed to hear that stuff.

Response to: Nuclear Warheads Posted July 12th, 2008 in Politics

You know, President Bush said, at the end of his period he'll start a nuclear war against Iran. I know - Bush talks a lot of crap when the day's long, but... that's kind of uncomfortable news seeing that every soldier here in Germany is called in for no obvious reason whatsoever. There's something going on and I guess we won't like it much.

Also Obama promised a war against Iran to AIPAC...

Hech... seems like they're all the same assholes, no matter whom you vote for.
Cheers, my buddies!
Welcome to the 21st century :D

Response to: Nazi is a German political party Posted July 12th, 2008 in Politics

You know, the higher politicians might have known - but the ordinary people just did NOT know about what was going on in the KZs. I once asked my grandmother and she told me that she was totally overwhelmed when the French soldiers told her about what they saw in Bisingen where Jews had to produce oil from slate.

It's quite the same thing that happens in America. Your Reichstag burned on 9/11 and your Afghanistan was our Austria. Now there's Poland... or was it Iraq? When will your KZ... oh sorry I meant Guantanamo - be filled up with your Jews or Moslems?

See; Hitler was also financed by the FED; Supported by GM and you Americans got "Kruppstahl" from Germany. Who are we kidding! We're all balls in a gigantic Flipper machine of those who make our money! We sold our Freedom, our security, our ideals and our impartiality to capitalism or communism, to the CIA, BND or FBI, to the media and to what you might call Patriotism!

When will we wake up and see that it doesn't matter if you come from right or from left of a border?
When will we wake up to find religion as a tool, a key to our minds?
When will we wake up and live and recognize others as what we are?

Human beings, damn it!

Don't make the word "human" sound like the opposite of what it means!

Api Cam Zoom Function Posted July 12th, 2008 in Game Development

I have a bit of a problem with the API Cam (as seen in this tutorial: http://www.newgrounds.com/bbs/topic/5312 95)

I have figured how to make it zoom in the script generated state the tutorial teaches. But then I noticed that it won't Focus ANYTHING anymore when I do it like that. So I made a 300x300 movie clip and recoded the cam to work with a MC already existing. Not much of a problem so far, the cam focuses correctly again.

But WHY won't the size of the MC influence the zoom factor anymore? The camera always shows stuff in the size of the stage (800x600)

Have a look at the code. The cam focuses a player object on _root., not the mouse.

onClipEvent (load) {
	CamX = _x;
	CamY = _y;
	this._visible = false;
}
onClipEvent (enterFrame) {
	if (_root.player.boo_dead == false) {
		this._xscale = _root.var_zoom;
		this._yscale = _root.var_zoom;
		_x = _root.player._x;
		_y = _root.player._y;
		CamX = CamX+(_x-CamX)/10;
		_root._x = Stage.width/2-CamX;
		CamY = CamY+(_y-CamY)/10;
		_root._y = Stage.height/2-CamY;
	}
}

Any ideas how to make the zoom work?

Thanks :D

Response to: AS:Platformer Posted July 6th, 2008 in Game Development

At 7/6/08 06:35 AM, henke37 wrote: We need less clueless programmers and more skilled programmers.

So start working XD

Response to: AS:Platformer Posted July 5th, 2008 in Game Development

I got a question Oo What does "state = 3" do exactly? I don't se another referrer.... is that some type of property or is it a special variable? Slightly cunfused because there's no flv to playback?

Plus, you should stop use "air" as a variable becuase since Adobe Air came out the air variable is used to transfer stuff between air and flash code.

Response to: Spore Flash Game Developement Posted July 8th, 2007 in Game Development

eh, and before i forget it, heres a link to a blog im holding:

http://ppdevelopers.blogspot.com/

contains all info you need ^^

Sorry for not adding this at the beginning ^^;

Response to: Spore Flash Game Developement Posted July 8th, 2007 in Game Development

At 7/8/07 12:30 PM, hashbrown wrote: ... but if u put it in the intro people might think that ea is sponsoring you or the game is made by ea personel, and you might have a problem with ea because if your game isnt as good as the game you will be spreading bad vibes about it

There you got a point... i think ill erase it. And thanks for "defending" me ^^

Response to: Spore Flash Game Developement Posted July 8th, 2007 in Game Development

Well im a big fan! Thats everything ^^ and due the fact SPORE was just delayed to 08 theres alot of time to pass...

Response to: Spore Flash Game Developement Posted July 8th, 2007 in Game Development

the links under the initial post links to some concept and alpha stuff... I know im a blank sheet here on NG, but im not like a great comic animator, i just started a movie on Splintercelll...


You might heard from EAs newest franchise, if not, check ot this video:

Google Video - Spore Gameplay Video

Yeah, the link is down there, have a look. If you want to join me (Im mostly responsible for design) as a coder, animator or Designer, write a E-Mail (or MSN) to:

proudone@hotmail.de

PM me

or Write a reply ^^

I hope badly somebody joins our small team, im at the end of my AS Knowledge, but theres a lot of work to put in!

Please help!

Preview for foodpods
Older version of the game, Phase 1 of 5