RE: Flash Q&A thread 3 (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


SirSchmoopy -> RE: Flash Q&A thread 3 (5/18/2007 20:05:09)


quote:

ORIGINAL: flsg

petermaxo:20 total

SirSchmoopy: O.M.G.sorry to say this, but you shouldn' start with a multiplayer game or even a chatroom, because you don't even understand the basic of a multiuser socket.
I looked at your thing, but I don't even need to see it to tell you that it won't work. imageshack?! Do you think you can just upload a single flash file on a webpage in order to run a chatroom? You need a dedicated server(most of them cost money), and you need to configure very complicated things (do you think I'm still jalous eragon?) I seggest you to learn the basic of actionscript before attempting such a big project.

BTW, did you see any big game running with a single file hosted on a webpage like imageshark?

no, but where can i find a dedicated server for free (i dont care how good it is)?




petermaxo -> RE: Flash Q&A thread 3 (5/18/2007 21:27:41)

by the way, I checked the code in Flash and you missed a } (bold and inserted.). Also, you switch programming languages rather abruptly in the bold area.
quote:

ORIGINAL: SirSchmoopy

whts wrong with this code????
import it.gotoandplay.smartfoxserver.*
stop()
ip = "127.0.0.1"
port = 9339
smartfox = new SmartFoxClient()
smartfox.onConnection = handleConnection
smartfox.connect(ip, port)
//----------------------------------------------------------
// Handle connection response from server
//----------------------------------------------------------
function handleConnection(success)
{
if (success)
{
status_txt.text = "Connection succesfull!"
}
else
{
status_txt.text = "Can't connect!"
}
}
smartfox.onRoomListUpdate = function(roomList)
{
roomList_lb.removeAll()
for (var i in roomList)
{
var room = roomList
roomList_lb.addItem(room.getName() + " (" + room.getUserCount() + ")", room.getId())
}
roomList_lb.sortItemsBy("label", "ASC")

// Join the default room
this.autoJoin()
}
smartfox.onUserCountChange = function(roomObj)
{
updateRoomStatus(roomObj.getId())
}
function updateRoomStatus(roomId)
{
var room = smartfox.roomList[roomId]
var newLabel = room.name + " (" + room.getUserCount() + ")"
for (i=0; i < roomList_lb.getLength(); i++)
{
var item = roomList_lb.getItemAt(i)
if (roomId == item.data)
{
roomList_lb.replaceItemAt(i, newLabel, item.data)
break;
}
}
}
//----------------------------------------------------------
// Setup components callback functions
//----------------------------------------------------------
roomList_lb.setChangeHandler("changeRoom")
userList_lb.setChangeHandler("userSelected")
function changeRoom()
{
var item = roomList_lb.getSelectedItem()

// new Room id
var newRoom = item.data
if (newRoom != smartfox.activeRoomId)
{
// Check if new room is password protected
var priv = smartfox.getRoom(newRoom).isPrivate()
if (priv)
{
// Save newroom as _global for later use
_global.newRoom = newRoom
showWindow("passwordWindow")
}
else
{
// Pass the room id
smartfox.joinRoom(item.data)
}
}
var priv = smartfox.getRoom(newRoom).isPrivate()
smartfox.joinRoom(item.data)
function loginProtectedRoom(pwd)
{
hideWindow("passwordWindow")
smartfox.joinRoom(_global.newRoom, pwd)
}
joinRoom = function(newRoom, pword, dontLeave, oldRoom)
smartfox.onJoinRoomError = function(errorMsg)
{
var win = showWindow("errorWindow")
win.errorMsg.text = errorMsg

// Put the selected room in the combo box back to its old value
resetRoomSelected(smartfox.activeRoomId)
}
<Zone name="simpleChat">
<Rooms>
<Room name="The Cottage" maxUsers="70" isPrivate="false" isTemp="false" isGame="false"
autoJoin="true" />
<Room name="The Tree" maxUsers="70" isPrivate="false" isTemp="false" isGame="false"/>
<Room name="The Pool" maxUsers="70" isPrivate="false" isTemp="false" isGame="false" />
<Room name="The Bathroom(lol)" maxUsers="70" isPrivate="false" isTemp="false" isGame="false" />
<Room name="The Tradin' Place Foo!" maxUsers="70" isPrivate="false" isTemp="false" isGame="false" />
<Room name="The Big Fieldy Place Room" maxUsers="50" isPrivate="true" isTemp="false" pwd="piddu"
isGame="false" />
</Rooms>
</Zone>

createRoom(roomObj)
function makeNewRoom()
{
showWindow("newRoomWindow")
}
}
function createRoom(name, pwd, max)
{
hideWindow("newRoomWindow")

var roomObj = new Object()

roomObj.name = name
roomObj.password = pwd
roomObj.maxUsers = max

smartfox.createRoom(roomObj)
}
smartfox.onCreateRoomError = function(errorMsg)
{
var win = showWindow("errorWindow")
win.errorMsg.text = errorMsg
}
function userSelected()
{
uid = userList_lb.getSelectedItem().data

// If it's not me...
if (uid != smartfox.myUserId)
{
// store the recipient for later use
_global.pmUid = uid

var win = showWindow("pmWindow")

var uList = smartfox.getActiveRoom().getUserList()
var targetUsr = uList[uid]

win.title_txt.text = "Send a private message to " + targetUsr.getName()
}
}
function sendMessage()
{
var m = message.text
if (m.length > 0)
{
_parent.sendPrivateMessage(m, _global.pmUid)
message.text = ""
}
}
smartfox.onConnectionLost = function()
{
gotoAndStop("connect")
}
Edit: stoopid syntax error!!!


This code has no syntax errors, but it may not do what you want it to.

import it.gotoandplay.smartfoxserver.*
stop()
ip = "127.0.0.1"
port = 9339
smartfox = new SmartFoxClient()
smartfox.onConnection = handleConnection
smartfox.connect(ip, port)
//----------------------------------------------------------
// Handle connection response from server
//----------------------------------------------------------
function handleConnection(success) {
if (success) {
status_txt.text = "Connection succesfull!"
}else{
status_txt.text = "Can't connect!"
}
}
smartfox.onRoomListUpdate = function(roomList) {
roomList_lb.removeAll()
for (var i in roomList) {
var room = roomList
roomList_lb.addItem(room.getName() + " (" + room.getUserCount() + ")", room.getId())
}roomList_lb.sortItemsBy("label", "ASC")
// Join the default room
this.autoJoin()
}
smartfox.onUserCountChange = function(roomObj) {
updateRoomStatus(roomObj.getId())
}
function updateRoomStatus(roomId) {
var room = smartfox.roomList[roomId]
var newLabel = room.name + " (" + room.getUserCount() + ")"
for (i=0; i < roomList_lb.getLength(); i++){
var item = roomList_lb.getItemAt(i)
if (roomId == item.data){
roomList_lb.replaceItemAt(i, newLabel, item.data)
break;
}
}
}
//----------------------------------------------------------
// Setup components callback functions
//----------------------------------------------------------
roomList_lb.setChangeHandler("changeRoom")
userList_lb.setChangeHandler("userSelected")
function changeRoom() {
var item = roomList_lb.getSelectedItem()
// new Room id
var newRoom = item.data
if (newRoom != smartfox.activeRoomId) {
// Check if new room is password protected
var priv = smartfox.getRoom(newRoom).isPrivate()
if (priv) {
// Save newroom as _global for later use
_global.newRoom = newRoom
showWindow("passwordWindow")
}else{
// Pass the room id
smartfox.joinRoom(item.data)
}
}var priv = smartfox.getRoom(newRoom).isPrivate()
smartfox.joinRoom(item.data)
}
function loginProtectedRoom(pwd) {
hideWindow("passwordWindow")
smartfox.joinRoom(_global.newRoom, pwd)
}
joinRoom = function(newRoom, pword, dontLeave, oldRoom){
smartfox.onJoinRoomError = function(errorMsg){
var win = showWindow("errorWindow")
win.errorMsg.text = errorMsg
// Put the selected room in the combo box back to its old value
resetRoomSelected(smartfox.activeRoomId)
}
}
createRoom(roomObj)
function makeNewRoom() {
showWindow("newRoomWindow")
}function createRoom(name, pwd, max) {
hideWindow("newRoomWindow")
var roomObj = new Object()
roomObj.name = name
roomObj.password = pwd
roomObj.maxUsers = max
smartfox.createRoom(roomObj)
} smartfox.onCreateRoomError = function(errorMsg){
var win = showWindow("errorWindow")
win.errorMsg.text = errorMsg
}
function userSelected(){
uid = userList_lb.getSelectedItem().data
// If it's not me...
if (uid != smartfox.myUserId) {
// store the recipient for later use
_global.pmUid = uid
var win = showWindow("pmWindow")
var uList = smartfox.getActiveRoom().getUserList()
var targetUsr = uList[uid]
win.title_txt.text = "Send a private message to " + targetUsr.getName()
}
}
function sendMessage() {
var m = message.text
if (m.length > 0) {
_parent.sendPrivateMessage(m, _global.pmUid)
message.text = ""
}
} smartfox.onConnectionLost = function() {
gotoAndStop("connect")
}




flsg -> RE: Flash Q&A thread 3 (5/18/2007 21:38:15)

SirSchmoopy: there is no free dedicated server. The cheapest I know is 80$/month
I suggest you to learn more the basic of actionscript before using it in a more advanced way




SirSchmoopy -> RE: Flash Q&A thread 3 (5/18/2007 22:13:06)


quote:

ORIGINAL: flsg

SirSchmoopy: there is no free dedicated server. The cheapest I know is 80$/month
I suggest you to learn more the basic of actionscript before using it in a more advanced way

kk thanks....only problem is more than half of my ideas are impossible for a begginer




Myhos -> RE: Flash Q&A thread 3 (5/19/2007 16:29:45)

well then work on the other half, honestly if you don't know the basics of bike racing you can't go and compete in the tour de' france
Baby steps my friend, baby steps




EragonZZZZ -> RE: Flash Q&A thread 3 (5/19/2007 23:51:08)


quote:

ORIGINAL: SirSchmoopy
kk thanks....only problem is more than half of my ideas are impossible for a begginer


Ummm....I really really hate to say this, but....then you really can't do them now.

For my walkaround, I'd been scripting, like 3 months, but even then I'd been programming for 5 years. And the code in that walk around absolutely stunk. Flat out garbage code.
Although it sure did what I wanted it too :{P

_______________________________________
on a different topic, flsg now owes us about 30 bucks.

and yo, I gots a scripting challenge to flsg only! everybody who feels like it. Using the LEAST possible amount of code that takes the LEAST amount of memory, collide two circles on a plane.
Specs:
1. Circles must collide and respond accurately. A simple ceasing of motion is good enough for me.
2. One or both circles must be controllable in some way
3. Circles are symbols (movieclips) but code can be anywhere as long as it is organized.
4. The only objects on the plane are the two circles.

If you finish this flsg whoever enters, post your .swf and .fla files here. I want to see how my method measures up to what flsg you all come up with




SirSchmoopy -> RE: Flash Q&A thread 3 (5/20/2007 20:00:58)

how do i uninstall flash 8?!?!?! plz tell me plz!!! i wanna make a crappy starcraft game so bad!!!




flsg -> RE: Flash Q&A thread 3 (5/21/2007 12:36:42)

SirSchmoopy: ..........just click uninstall in the start menu[>:]
but I don't think LBB's trick can work
you want to make a starcraft with flash? sorry but it's impossible for you now(I didn't say I can, and I'm NOT jalous lol)
eragon: what do you mean by collide and respond accurately?




Myhos -> RE: Flash Q&A thread 3 (5/21/2007 16:07:21)

yea flsg is right, First of all you need a massive amount of code for a crappy AI, and even more for a good one. Then the....ah hell....look at the moment you honestly are just starting codeing with flash..which you don't even own your own legal copy...which can be a problem...and whats-his-name method will NOT WORK. that is unless you have a cracked or illegal version which would mean by the time you publish your ground breaking game you get your self sued to kingdom come. Also Star craft in flash is just impossible, or at the least the swf file would be huge and the movie would take an hour to load.




EragonZZZZ -> RE: Flash Q&A thread 3 (5/22/2007 15:50:58)

Oops, forgot that spec.

like, if its touching a circle, it will not penetrate the outer border of the circle.

which means that code for circling the perimeter might be neccessary, something i didn't think of :P




somebody621 -> RE: Flash Q&A thread 3 (5/22/2007 18:52:52)

Eragon: Hehe... I have the code, I just don't feel like implementing it. XD You did see my demo. It was capable of handling ball versus ball collisions, but I needed different code on the main frame. Also, I have to change my integration method to verlet or RK4 (which I have also coded already, just only with basic particles, not circles, but its the same thing). And with collision formulas, I am THIS CLOSE to getting SAT working (I started it earlier (didn't finish it), but then gave up, but then I have to relearn what my code was about now).

Myhos: meh... with AS3, the speed is amazing, and since starcraft is 2D, it just MIGHT be possible, but DEFINATELY NOT FOR A BEGINNER.

SirSchmoopy: don't get so impatient. You need to learn the basics first. And unless you have flash 9, it'll be impossible.




EragonZZZZ -> RE: Flash Q&A thread 3 (5/22/2007 19:06:28)

Yay! I remember you!

You actually gave me that idea. XD

Although what I do is I simply see if the distance between the center of the circles is less than the sum of the radii :P



Gosh DARN it, I just don't have the time to LEARN AS 3.0, gonna be way too hard (I'm already unlearning AS 2.0 AND Visual Basic XP)

and yeah, you can't get flash 9 until you own flash 8

and @ myhos, no you don't, i can make a crappy AI with 10 lines of code. Including lines that just contain


}

on them.




somebody621 -> RE: Flash Q&A thread 3 (5/22/2007 19:18:14)

Actually, flash CS3 (flash 9) is out. I just use flex. For my collision detection demo, I actually didn't use projection, but rather sweep tests. I found these faster AND more accurate, strangely enough. However, yes, for mutliple circles colliding, projection is probably the way to go (if you use sweep tests, you may be able to use impulses, which is what I'm aiming toward with my SAT code).




Myhos -> RE: Flash Q&A thread 3 (5/22/2007 23:00:07)

quote:

ORIGINAL: EragonZZZZ

and @ myhos, no you don't, i can make a crappy AI with 10 lines of code. Including lines that just contain


}

on them.

Ah but i mean as in a easy handicaped AI but it still implies a Good AI code

as for loading times, really? despite having a a large amount of the adobe cs3 stuff i haven't had the time to mess around too much with flash action script

and once more yea flash 9 aka cs3 has been out now for some time, and i have it: here




Lightles -> RE: Flash Q&A thread 3 (5/23/2007 14:27:26)

This might be asked before, but I couldn't find it anywhere, so I'll ask it.

I have Flash8 for a few weeks now, and I'm trying some things to hope it will look a bit better.
So I recently discovered the magic window called "Color Mixer" and not knowing that I was making alot of those arrow-thingies to make radient more colorful, I have like 10-20 of those thingies right now and I'm just wondering how can I reset it to just 2 arrow-thingies?

And for those who want to know how *couch* great *couch* I am... The actionscripting is like a zillion room dungeon with only one outway at the end to me, and the only thing I can currently draw well are stickfigures and swords in DF style without shades.

Thank you.




EragonZZZZ -> RE: Flash Q&A thread 3 (5/23/2007 14:35:51)


quote:

ORIGINAL: Myhos

Ah but i mean as in a easy handicaped AI but it still implies a Good AI code

as for loading times, really? despite having a a large amount of the adobe cs3 stuff i haven't had the time to mess around too much with flash action script

and once more yea flash 9 aka cs3 has been out now for some time, and i have it: here


ah, true, you would be right.

somebody621, how do you integrate flash and flex with each other?
Can you use flash 8 with flex?

and myhos, how dare you show me a picture like that. You is evil ;________________;




dominic_r_monroe -> RE: Flash Q&A thread 3 (5/23/2007 16:18:48)

i haven't any knowledge of coding and wish to have someone to teach me




flsg -> RE: Flash Q&A thread 3 (5/23/2007 18:11:02)

lightnes: I think you should click the arrows with right mouse
eragon: what?! Wow, I thought it would be more difficult than that, like predict the moves after the collision, etc
if it only need to be accurate, then:

var radius1=_root.circle1._height/2, radius2=_root.circle2._height/2
_root.onEnterFrame=function(){
if(radius1+radius2+this.circle1.moveDistance+this.circle2.moveDistance<distanceBetween2Circles){
.........................code to move the circles normally
}
}else{
this.circle1.newMoveDist=distanceBetween2Circles*(this.circle1.moveDistance+this.circle2.moveDistance)/this.circle1.moveDistance
this.circle2.........................//same thing, just get the distance that each circle should move when their next move will collide (by getting the proportion of the distance that each circle should use)
}....................

}

I'm not very clear in my code, and I didn't write the calculations for the distances and how the circles should move, but I think you guys understand what I want to do.
this SHOULD produce a perfect collision




Myhos -> RE: Flash Q&A thread 3 (5/23/2007 21:04:20)


quote:

ORIGINAL: EragonZZZZ
and myhos, how dare you show me a picture like that. You is evil ;________________;


Muhahahha Hell i don't know what half of the cs3 programs do...lol i only know Photoshop, Flash and Dream weaver, the rest (bridge, Illustrator, and InDesign) i have no idea who to use XD also all of this is on a mac.

now for lightness, you drag the points/arrows up or down and they should go away




Lightles -> RE: Flash Q&A thread 3 (5/24/2007 11:58:13)

quote:

ORIGINAL: flsg

lightnes: I think you should click the arrows with right mouse



That's odd, it doesn't work... They still won't go away.




flsg -> RE: Flash Q&A thread 3 (5/24/2007 20:42:30)

lightnes: oops sorry...it's ctrl+left mouse




Lightles -> RE: Flash Q&A thread 3 (5/25/2007 11:44:52)

Yay it works! Thank you.[:)]




EragonZZZZ -> RE: Flash Q&A thread 3 (5/27/2007 18:01:27)

FLSG, is that AS 3.0 or 2.0?




flsg -> RE: Flash Q&A thread 3 (5/28/2007 16:50:45)

2.0, why? I didn't make any classes




EragonZZZZ -> RE: Flash Q&A thread 3 (5/28/2007 17:36:29)

No, because I always know you to use whatever scripting language is the newest/hardest :D

Plus, in leu (sp?) of an AS 3.0 tutorial book, I've been looking at examples and teaching myself. Good thing I didn't try to learn from that XD

and no classes? *gasp*

SHAME on you :D




Page: <<   < prev  6 7 [8] 9 10   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.15625