So, I’ve had to do this on a few occasions now, and I have found the most efficient ( well in terms of lines of code ) to do this in Actionscript 3.

Before you can use this, you must have the x,y positions of the the 2 objects you want to calculate the distance between ( of course ).

The line of code I ended up using looks like this

var distance:Number = Point.distance(new Point(objectA.x, objectA.y),
                                     new Point(objectB.x, objectB.y));

There may be ways to extract the point object right out of an objects, if so , let me know. But this definately works.. now I can move on  to finishing my app : )

Everytime we launch a new application in a social network, after a few weeks it’s important to know if we have upward growth.

The only thing I can think that demonstrates this is more installs per day. In our databases we capture full timestamps of the new installed user.

To turn this into something I can look at and understand, I have to run this query.

SELECT date_format( date_added, ‘%Y-%m-%d’ ) , count( * )
FROM fb_user
GROUP BY date_format( date_added, ‘%Y-%m-%d’ )
ORDER BY date_format( date_added, ‘%Y-%m-%d’ ) ASC

I am going to try to make a graph to view this in flex… first time Flex graphing 🙂 I’ll post an update when it works..

January 28, 2009

This is the raw message we receive from an onJoinRoom event sent from SmartFox Server with our custom room variables, the libs will parse this up for us, which is pretty decent and helpful.

<msg t='sys'>
  <body action='joinOK' r='3'>
    <pid id='-1'/>
    <vars>
      <var n='suit0' t='s'>
        <![CDATA[h]]>
      </var>
      <var n='currentRank' t='n'>
        <![CDATA[3]]>
      </var>
      <var n='user_cards_count' t='n'>
        <![CDATA[1]]>
      </var>
      <var n='usersExchanged' t='n'>
        <![CDATA[2]]>
      </var>
      <var n='playerRanked' t='n'>
        <![CDATA[0]]>
      </var>
      <var n='numRounds' t='n'>
        <![CDATA[2]]>
      </var>
      <var n='userTurn' t='n'>
        <![CDATA[2]]>
      </var>
      <var n='last_player_played' t='n'>
        <![CDATA[3]]>
      </var>
      <var n='dealer_id' t='n'>
        <![CDATA[2]]>
      </var>
      <var n='user_face_value' t='n'>
        <![CDATA[13]]>
      </var>
      <var n='inGame' t='b'>
        <![CDATA[1]]>
      </var>
      <var n='exchange' t='b'>
        <![CDATA[0]]>
      </var>
    </vars>
    <uLs r='3'>
      <u i='1626' m='0' s='0' p='4'>
        <n>
          <![CDATA[666580371]]>
        </n>
        <vars>
          <var n='rank' t='s'>
            <![CDATA[President]]>
          </var>
          <var n='fb_uid' t='n'>
            <![CDATA[666580371]]>
          </var>
          <var n='card_count' t='n'>
            <![CDATA[0]]>
          </var>
          <var n='screen_name' t='s'>
            <![CDATA[Taylor *]]>
          </var>
          <var n='ready' t='b'>
            <![CDATA[1]]>
          </var>
          <var n='pic_url' t='s'>
            <![CDATA[http://profile.ak.facebook.com/v222/795/44/q666580371_719.jpg]]>
          </var>
          <var n='chipTotal' t='n'>
            <![CDATA[10229]]>
          </var>
          <var n='chipsEarned' t='n'>
            <![CDATA[349]]>
          </var>
        </vars>
      </u>
      <u i='1621' m='0' s='0' p='2'>
        <n>
          <![CDATA[1607303638]]>
        </n>
        <vars>
          <var n='rank' t='s'>
            <![CDATA[unranked]]>
          </var>
          <var n='fb_uid' t='n'>
            <![CDATA[1607303638]]>
          </var>
          <var n='card_count' t='n'>
            <![CDATA[4]]>
          </var>
          <var n='screen_name' t='s'>
            <![CDATA[Mike]]>
          </var>
          <var n='ready' t='b'>
            <![CDATA[0]]>
          </var>
          <var n='pic_url' t='s'>
            <![CDATA[http://profile.ak.facebook.com/v229/1007/83/q1607303638_6612.jpg]]>
          </var>
          <var n='chipTotal' t='n'>
            <![CDATA[4590]]>
          </var>
          <var n='chipsEarned' t='n'>
            <![CDATA[0]]>
          </var>
        </vars>
      </u>
      <u i='1622' m='0' s='0' p='3'>
        <n>
          <![CDATA[616006432]]>
        </n>
        <vars>
          <var n='rank' t='s'>
            <![CDATA[unranked]]>
          </var>
          <var n='fb_uid' t='n'>
            <![CDATA[616006432]]>
          </var>
          <var n='card_count' t='n'>
            <![CDATA[1]]>
          </var>
          <var n='screen_name' t='s'>
            <![CDATA[Lynn1204]]>
          </var>
          <var n='ready' t='b'>
            <![CDATA[0]]>
          </var>
          <var n='chipTotal' t='n'>
            <![CDATA[4854]]>
          </var>
          <var n='pic_url' t='s'>
            <![CDATA[http://profile.ak.facebook.com/v223/1303/36/q616006432_2358.jpg]]>
          </var>
          <var n='chipsEarned' t='n'>
            <![CDATA[0]]>
          </var>
        </vars>
      </u>
      <u i='1613' m='0' s='0' p='1'>
        <n>
          <![CDATA[1112396589]]>
        </n>
        <vars>
          <var n='rank' t='s'>
            <![CDATA[Vice President]]>
          </var>
          <var n='fb_uid' t='n'>
            <![CDATA[1112396589]]>
          </var>
          <var n='card_count' t='n'>
            <![CDATA[0]]>
          </var>
          <var n='screen_name' t='s'>
            <![CDATA[Sheldon 917]]>
          </var>
          <var n='ready' t='b'>
            <![CDATA[1]]>
          </var>
          <var n='pic_url' t='s'>
            <![CDATA[http://profile.ak.facebook.com/v230/1144/60/q1112396589_520.jpg]]>
          </var>
          <var n='chipTotal' t='n'>
            <![CDATA[1737]]>
          </var>
          <var n='chipsEarned' t='n'>
            <![CDATA[149]]>
          </var>
        </vars>
      </u>
      <u i='1631' m='0' s='1' p='-1'>
        <n>
          <![CDATA[Spectator886]]>
        </n>
        <vars>
          <var n='rank' t='s'>
            <![CDATA[unranked]]>
          </var>
          <var n='fb_uid' t='n'>
            <![CDATA[0]]>
          </var>
          <var n='card_count' t='n'>
            <![CDATA[0]]>
          </var>
          <var n='screen_name' t='s'>
            <![CDATA[Spectator886]]>
          </var>
          <var n='ready' t='b'>
            <![CDATA[0]]>
          </var>
          <var n='chipTotal' t='n'>
            <![CDATA[0]]>
          </var>
          <var n='pic_url' t='s'>
            <![CDATA[http://london-ontario.com/play_president/assets/table/default/spectator.png]]>
          </var>
        </vars>
      </u>
    </uLs>
  </body>
</msg>

multi-user flash games

January 6, 2009

I just come across a network that will power a flash game with:

  • real-time multi-user capability
  • data storage api
  • payment api
  • acheivements
  • high score

the service is called Nonoba

Flex Facebook app in beta

December 22, 2008

We have finally released our first social gaming Flex application on Facebook.  The application is called Presidents & Assholes, it based on the popular card game Asshole. The application is real-time, and requires 4 live players to activate a game table. We have added a betting component, so users have a sense of reward.

Presidents and Assholes The application has a Spectator mode that will allow users to “preview” the game without forcing them to install. This same preview is available to the global internet without logging into Facebook. You can preview the game by clicking http://apps.facebook.com/play_president/.

The game has an easy to use chat window that will broadcast your message to the room. Users can enter and leave any number of game table rooms, and optionally sit down if they have installed the Facebook app.

Yahoo Social platform

December 17, 2008

Today I received some info about the new Yahoo Social platform

Don’t know much about it yet, but more to come.

The URL to the Yahoo Social Directory is http://developer.yahoo.com/social/socialdir/

hmm and even better there are some Flex 3 libs for the Yahoo Social Directory API