Comments
Patrick Collands wrote: collands (AT) gmail com I'd be very grateful for an invitation. Thank you.
Cloud Expo on Google News

SYS-CON.TV

2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Click For 2008 West
Event Webcasts
How Flash Communication Server is Helping the Multiplayer Game Industry
A Model for Dealing with the Flash Communication Server in Director

In Director we create a global variable named "isMouseDown". Assign a behavior to the ball sprite and use this variable to determine if user clicks on the ball sprite (isMouseDown = true) or not (isMouseDown = False).

We use the "rect" property of the ball sprite to test its location and the stage boundaries. "rect" is an array that has 4 elements: the left, top, right and bottom coordinates of the sprite.

In Director:


on exitFrame
if sprite("Ball").rect[1] <= 0 then
sprite("Ball").LocH =
sprite("Ball").LocH + 50
end if
if sprite("Ball").rect[2] <= 0 then
sprite("Ball").LocV =
sprite("Ball").LocV + 50
end if
if sprite("Ball").rect[3] >=
640 then
sprite("Ball").LocH =
sprite("Ball").LocH - 50
end if
if sprite("Ball").rect[4] >=
480 then
sprite("Ball").LocV =
sprite("Ball").LocV - 50
end if
if isMouseDown then
ball_so.data.x = sprite("Ball").LocH
ball_so.data.y = sprite("Ball").LocV
end if
go to the frame
end

The complete listing of this sample is shown in Listings 3 to 5.

Now, you can publish the project and run two instance of it. Drag the ball sprite and see the effect in other running instance.

What's Next?
You've just experienced some of the basic concepts of using FlashCom in Director. But all of those samples are client-side only. When you learn how to use server-side scripting with Director to receive from and send messages to it, the power of your multi-user applications will increase greatly.

For example, with server-side scripting you can manage users and verify them to accept or reject their connection request, and so on. Using authentication, you could give different users different roles in the system, assigning some users more power in the system than others. For example, think of our chat system extended to include a teacher and several students. The teacher would have the ability to correct false information and push additional material that the students might not have. In a more game-like environment, a "Game Master" might have the ability to control the positions of objects that the individual players do not have the right to move. By exploring the capabilities of the Flash Communication Server, and its use in Director, several of these types of applications can be built using the shared object model.

About Nima Azimi
Nima Azimi is a software engineer, multimedia project manager,
consultant and programmer on variety projects. His projects include
educational "How does it works" titles for children education with
real-time 3D content. He has worked with Director for over four years,
and he currently teaches courses in Director programming and multimedia.
In his spare time he makes highly detailed photorealistic 3D scenes as a
3D artist and writes video game scripts and gameplay ideas that he
wishes to develop into full games at within the near future.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Just a note: with the new release this month it will not be FlashComm or Flash Communication Server. The beta has it anounced as Flash Media Server 2.

|| Using authentication, you could give different users different roles in the system, assigning some users more power in the system than others ||

I've tried this. It works real well.


Your Feedback
Rob Sandie wrote: Just a note: with the new release this month it will not be FlashComm or Flash Communication Server. The beta has it anounced as Flash Media Server 2.
gamer4all wrote: || Using authentication, you could give different users different roles in the system, assigning some users more power in the system than others || I've tried this. It works real well.
Latest Cloud Developer Stories
CloudBench Applications, Inc. announced its financial results for the three months and nine months ending September 30, 2009. All amounts are stated in Canadian dollars unless otherwise noted. Revenues from BasicGov, the Company's cloud computing solution for local government, gr...
The new contract is an industry first, with CSC being the first Microsoft partner to lead and win a cloud computing services agreement of this scale. Under terms of the contract, CSC will provide Royal Mail Group's 30,000 employees with access to new IT services using Microsoft's...
Operates in over 170 countries and is one of the world’s leading providers of communications solutions and services. Richard Tarboton talks for MeettheBoss.TV on his role as Head of Energy & Carbon for BT and what they are doing towards reducing carbon emissions.
CA is going to put its Agile Planner software on salesforce.com’s Force.com platform in the first half to accelerate development time and give users visibility over their development initiatives to reduce time-to-market. Customers are supposed to be able to accelerate the deploym...
Despite its uncertain fate Sun soldiers on. Monday it trotted out a cloud-based multiplatform desktop as a service for K-12 and community colleges that can run Windows, the Mac OS, Linux and Solaris applications to nearly any client device, including its own Sun Ray thin clients....
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE

Breaking Cloud Computing News
CloudBench Applications, Inc. announced its financial results for the three months and nine months e...