3,804 Forum Posts by "Sam"
To begin with you should make a PHP script to echo out the data you need in a similar fashion (forgive me, I don't really have experience in PHP):
echo "username=" + $sessionUser; // Where sessionUser is the username of the current session
From here, you can make a request to that page:
var request:URLRequest = new URLRequest("myPhpPage.php");
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(request);
loader.addEventListener(Event.COMPLETE, loadedRequest);
Your loadedRequest method would look something like this:
private var playerName:String;
private function loadedRequest(e:Event):void
{
playerName = e.currentTarget.data.username;
}
"playerName" should now be equal to what "username" would be upon calling the PHP page. Your PHP page can also include loads of information about the user in the current session, which every game could then utilise.
At 3/20/13 08:37 PM, egg82 wrote: I did, however, discover I have an ambition to become popular on youtube. I dunno why, I just think it'd be a cool experience.
Anyway, that's my current goal.
Good luck on that. I feel like most of the stuff I see my friends watching is just rehashed stuff from other popular channels, done in such a way that their only goal is to become "YouTube famous". I suppose if you can bring something new and interesting (which is a feat in itself, considering YT size), then I'd definitely give it a watch.
Oh also, PRODUCTION VALUE.
What're you all up to?
It's been the last week of my first year at uni, so starting Saturday I aim to revise. Unlikely that's how it'll go to plan but there you go. Aside from that I've been working on a couple of games which I'll have tons more time for when I finish tomorrow. Game grumps everyday, too.
At 3/21/13 03:49 AM, PSvils wrote: I on the other hand have useful ambitions like working on my NeuroPulse game, which I'm starting to do morning - night, so making good progress.
How do you keep motivation to work on a project day after day? Just interested,
In other news, freelance mobile app project using Haxe/NME. But NeuroPulse is starting to define my life.
I really enjoy writing in Haxe/NME, but nothing has really come of it. I've tested some Android stuff but that's as far as it's gone.
As a cheap-way out (without having to change anything to your collisions), you can use a boolean. Whenever the ball hits a wall or the paddle, have the boolean set to true. Upon hitting a block, set the boolean to false - but only allow for a block to break if the boolean is true when the ball hits it.
At 3/17/13 06:58 PM, Aprime wrote: function confirmed (){
if(f1_mc.favouriteName_txt.text!=""||f2_mc.favouriteName_txt .text!=""||f3_mc.favouriteName_txt.text!=""){
f1_mc.favouriteName_txt.text==""&&f2_mc.favouriteName_txt.te xt==""&&f3_mc.favouriteName_txt.text==""
}
}
By having the == there are no longer any errors. However when I call the function the code doesn't actually work as it doesn't clear those text boxes.
You can't chain statements together with && and have them correspond to the same if || section. You could do:
if(f1_mc.favouriteName_txt.text!="")
{
f1_mc.favouriteName_txt.text=="";
}
And so on for each textbox. You could also throw them into an array and loop through them to minimise the amount of code you have to write. Aside from being straight up honest and telling you to learn to program correctly, there aren't many other options.
For reference, assignment:
=
Comparison:
==
!=
At 3/17/13 06:43 PM, Aprime wrote: I've got the following code inside a function
I call the function whenever I wantif(favouriteName_txt.text!=""||favouriteName_txt.text!=""||f avouriteName_txt.text!=""){
favouriteName_txt.text=""&&favouriteName_txt.text=""&&favour iteName_txt.text=""
}
If I am correct... && means and and || means or
Either way... I get the following error
Scene 1, Layer 'MemoryScript', Frame 1, Line 89 1050: Cannot assign to a non-reference value.
89 being this code here
favouriteName_txt.text=""&&favouriteName_txt.text=""&&favour iteName_txt.text=""
Each of those statements in your if are the same. I'm unsure where you've picked up that syntax. All you need is something like:
if(favouriteName_txt.text!="")
{
favouriteName_txt.text="";
}
Every time you press a different key you're setting all the others to false. You can press up and right at the same time, but your code won't allow it. Something like this:
if(event.keyCode == Keyboard.UP)
{
upPressed = true;
}
else
{
upPressed = false;
}
And so on for the other booleans. Then you can just do checks for your booleans. As an example:
if(upPressed)
{
if(rightPressed)
//diagonal up and right
else if(leftPressed)
//diagonal up and left
else
//just up
}
You might have better luck in the Collab forum.
=
Is used for assignment.
==
I used for comparison.
I have a HTC One X, but have owned Samsung phones in the past. Right now? It really depends. My sister has an SIII and thinks it's too big (yes, that's what she said). But I've also used (quite extensively) the iPhone 4S and 5, and in experience I don't think it's a viable upgrade. I really like the screen on the SIII, the iPhone 5 seems a bit lackluster in terms of the hardware it's packing - even more so than other iterations of the iPhone.
Get whatever you want really.
At 2/27/13 12:24 AM, Diki wrote: Mike recently released Swivel which will convert SWF to MP4, which is a format accepted by YouTube. It can probably convert to other formats as well, but I've not actually used it, so I don't know for sure.
Should be able to do what you need.
"What video formats does Swivel export?
By default, Swivel exports H.264 encoded video in an MP4 container. It also currently allows exporting WebM (VP8), Ogg (Theora), Windows Media Video, Uncompressed AVI, and QuickTime Animation (mov)."
For a little bit more information.
I assumed OP wanted it so the shift still happened while the input is being held just not so fast, I misread the post. Have a boolean to check if a shift has happened: shiftOccurred. On the input (key press, click, whatever) have something like:
if(!shiftOccurred)
{
shiftFunction();
shiftOccurred = true;
}
And when there's no input, set the shiftOccurred back to false.
At 2/25/13 09:36 PM, PrettyMuchBryce wrote: Guys you'll have to excuse egg. He did a bunch of LSD earlier today.
And then wigged out to the weirdest advert on the planet: Mr. Soft.
On a serious note I've watched it about 30 times already.
At 2/25/13 09:03 PM, igotnolife wrote:At 2/25/13 06:09 PM, Sam wrote: Have a timer that once finishes flicks on a boolean that allows for shifting to occur.thats what we thought at first, but would that still allow rapid shifting?
No. The shift should only be allowed to happen if the boolean is true (or false, doesn't really make a difference). Order of events could be:
1) Boolean begins as true - let's call it "allowShift"
2) Shift occurs (if statement to check if allowShift is true allows it to happen)
3) allowShift is set to false and timer begins counting
4) Once timer finishes, allowShift is set back to true.
This means a shift can only happen at most, every t seconds the timer is set count.
I've had to delete two posts in this thread now. I'd like to remind you all of the rules:
Things that will get you banned:
Linking to pornographic or NSFW material without a clear warning.
I don't consider a link with the text: "This", as a clear warning, let's make it a little bit more obvious guys.
At 2/25/13 12:14 AM, allflashgames123 wrote: Hello everybody i have no coding experience but i was wondering if there is a easy solution out there to create a flash game help please?? Want to make a tower defense game.
You're asking an extremely broad question. Learn about programming and design as a general concept to begin with. There's no magic recipe or easy solution to make a game, and two games written by two different programmers will be different in various ways.
There is no tutorial that will teach you to program from complete beginner to pro - because programming isn't linear like that. You develop your own style and pick things up along the way.
Best of luck.
Have a timer that once finishes flicks on a boolean that allows for shifting to occur.
God I can't believe Hannah, she gets Adam for free and doesn't want him uurrghhh
Happy birthday EJR.
I swear I don't watch it.
At 2/24/13 01:38 PM, egg82 wrote: judging by the amount of security they put behind the content, i'm not 100% sure they want you to pull the .swf files off the site...
It has to be downloaded at some point to view it, so I don't see much harm in having a local version of it. Although a lot of the time it's probably for de-compiling reasons, rather than just wanting to view/play the swf offline.
I remember having Portal Defenders on my pen drive so I could play it at school
At 2/24/13 10:49 AM, IzaacBarratt wrote:The first option is the safest if you don't want to give them the option, though
This.
You should give the player full customisation of the controls in your game, gives you bonus points and is easy to implement.
At 2/24/13 08:39 AM, IzaacBarratt wrote: A,S,D for the alternate functions
You need to remember not all keyboard layouts have ASD together.
Use the:
TimerEvent.TIMER_COMPLETE
To trigger a function upon the timer completing nCount's of 1000.
At 2/22/13 05:04 PM, jimbo340 wrote: hi all
im working on a basic flasg game in as3 i have the controls set up in keyboard to move and shoot and mouse to press buttons.
but i wanted to make the touch work so i can put it on ios and android.
any help
here is the link to my code: https://www.dropbox.com/s/7vj51pknagnwrgv/source_files%20%28 2%29.zip
if someone could do it if would be really great
tham
It's easier for everyone if you just post relevant pieces of code rather than linking to your entire project. I haven't worked with Flash for mobile (Adobe Air?), but I'm fairly certain you can't just export and be done with it.
If someone with a bit more knowledge wants to swoop in, they'll be able to help you out a little more.
At 2/21/13 09:36 AM, ReNaeNae wrote: ...to both of you! ;D
Thanks :)
At 2/21/13 07:46 AM, 4urentertainment wrote: Hai guys.
Notice anything NEW?
Grats!
At 2/18/13 01:41 AM, MSGhero wrote: It's more along the lines of being "random enough."
Exactly. It's a question of whether a random generator is sufficiently "random" for the purpose.
At 2/18/13 12:34 PM, egg82 wrote: By the use of a special piece of hardware that measures fluctuations in air pressure.
That's pretty badass - I wonder if they have to make the environment as secure as possible to ensure that no one can set up tests to attempt to predict the air pressure.
At 2/10/13 03:32 PM, GimmeSumJava wrote: I want a program that gets a string that the user has entered. It then finds another random person and sends that data to them. And vice versa with receiving. Is the clearer?
Any kind of communication between two computers require sockets. They've already pointed you in the right direction.
At 2/10/13 03:34 PM, IgorTheMii wrote: BUT I DONT KNOW HOW TO DO A FLASH GAME!!!!!
It's fairly simple:
1) "I can't do something because of an obstacle"
2) Learn how to overcome obstacle
3) "I can now do something!"
You bumped your post within 3 minutes - this forum isn't active enough for people to respond in that time.
At 2/10/13 11:42 AM, 4urentertainment wrote:At 2/10/13 11:02 AM, Archawn wrote: Sometime in mid-March would be good. The weekend of the sixteenth is sufficiently far away, so as to allow people time to plan for it and sign up.But MIT's decisions come out in mid-march D:
What if somebody DIES??
If he dies...
At 2/5/13 05:07 PM, Glaiel-Gamer wrote: This is hard to do, there's a lot of overhead involved in making sure your code structure is set up properly to have multiple coders work on it, which is why you sorta need a "lead programmer" if you're doing this stuff, 2 programmers working on something might not be much more efficient than 1 (unless they have heavily different talents / specialties) since you'll spend so much time making sure you arent trampling over each others feet. If you have 1 person dedicated just to the organization stuff of it all, then you can start getting some returns there with multiple programmers on the project.
I half agree with this. It can be a difficult feat to get two programmers working fluently together but it's just like any other "work relationship". The more time put into it the better you'll find yourself working together. Sometimes I'll look over some code by the second programmer I often work with on projects and it's enjoyable to both see how they accomplished something but also to pick it apart and help improve and criticising their work is something I wouldn't have done when we first started working together (possibly out of fear they'd take offence to it, who knows). Works vice-versa so all in all you get a good experience out of any project.
As for the mentoring aspect, I don't think I ever had a mentor. I had a lot of people help me as I was learning to program but never one consistent person. Toast is notable, though. He always felt like the middle man of knowledge between Gust and myself because I never actually spoke to Gust, but Toast spoke highly of him. Not to mention him helping me on my maths <3
I remember trying to follow this OOP inventory system and being completely baffled. It's strange how far almost any programmer who stayed here longer than a couple of hundred posts has come. Mike and Archawn impressed me purely because they seemed to go from 0 to good programmers in the time it took me to go from the same level to "OK programmer".
I did, however, mentor a friend of mine for a brief period. This was way back when I started to learn AS2. I'd show him something and he ended up getting really interested and it came to the point that he was pointing out things in my code and understanding them. I brought him up to speed as far as my knowledge allowed and from there it was more of a peer learning relationship. It's mad because now he's a web developer and has earnt more money than I have off any programming. Makes me proud but also competitive at the same time.
At 2/5/13 05:01 PM, Innermike wrote:P.S. anyone know when that zrb forest game is coming out?
It looked so amazing.
At 2/4/13 01:33 PM, MSGhero wrote: Luis pokes his sombrero in occasionally. Glaiel shows up every other page; he's probably busy rolling in cash after the Closure greenlight.
And playing DotA, apparently.
At 2/2/13 03:40 PM, Spysociety wrote: You need at least to have a function that describes the formula of what you are looking for, the easiest are only circle-circle collision detections etc. If you want deep collision checking with irregular figures you should look into calculus or linear algebra. Also don't use hit tests, they suck, they are slow and they can't help you in situations like these.
Agreed.
You're working within the constraints of what hitTest can achieve. In fact, you could write your own "hitTest" method to achieve exactly what the inbuilt method does with added advantages. I find circle to circle detection to be sufficient for most shapes but obviously it depends on the degree of accuracy you require in your application.

