Groups | Blog | Home
all groups > flash actionscript > october 2004 >

flash actionscript : Interactive Living Room


David Stiller
10/14/2004 4:08:39 PM
The arranging -- picking up, arranging, putting down -- can all be done
entirely in Flash. The part that alerts the webmaster will have to involved
some kind of middleware (ASP, PHP, etc.). I envision, for example, a button
that collects all the x and y coordinates of the furniture, plus a custom id
for each piece of furniture, then POSTs these variables to a dynamic page on
the server (just like when you fill in an HTML form and hit Submit); that
server page will format these variables into something readable, perhaps
sending an email alert to the webmaster.

As for what ActionScript would be needed ... well, this isn't an easy
thing to do, for sure! I think the truest answer is, this would require a
lot of custom programming. To get you started, however, look into the
MovieClip class in your ActionScript dictionary. You'll see a number of
useful methods, including drag mechanisms.


David
stiller ( at ) quip ( dot ) net

simplyrose
10/14/2004 8:03:59 PM
Want to design a living-room in Flash that enables viewers to pick up pieces
of furniture from a menu-bar and arrange them in a room. The viewer clicks a
post-it button that enables the webmaster to view the results of the
arrangement.

My question: Can it be done entirely in Flash, if so, what action-script
commands would be needed?

Thanks for your input.


David Stiller
10/15/2004 9:59:41 AM
That's not what I said. :)

Flash will not output the arrangement as a JPG. At best, you can have
Flash cycle through the movie clips (the furniture pieces), gather relevant
properties, then POST those as variables to a server application that parses
that data, reformats it, and emails you something useful. That server
application *could* be designed to generate images, but it all depends on
what server model you're using, plus your knowledge of that model. I've
seen C# developers create and output a variety of image formats on the
server; I've seen PHP examples that generated GIFs on the fly -- but Flash
does not do this.

The MovieClip class entry in the Help files will show you all the things
possible with movie clips, including startDrag() and stopDrag(), which
you'll need for the dragging. Look up loadVariables and the newer LoadVars
class to determine how to send/receive variables.

I should stress here again, this will require lots of custom
programming. It's important you realize that your goal will not be obtained
by briefly being told which commands to use. Sounds harsh, maybe, but I
hope you don't take it that way. :) Honestly, I'm trying to give you a
realistic sense of what you're hoping to achieve. Flash is an incredible
toolkit. Imagine yourself a new artist, with plenty of canvas now, and a
remarkable palette of oil paints ... the tools in front of you are not very
useful until you learn technique.


David
stiller ( at ) quip ( dot ) net

David Stiller
10/15/2004 11:07:04 AM
simplyrose,

[quoted text, click to view]

You're right, a developer can export FLA contents to images, even to
QuickTime movies ... but this is not possible from a SWF, even with the new
ActionScript features.

[quoted text, click to view]

Show me! :) Did you see this online? I would be very interested in
the URL. You might have read something about Generator, which is a
discontinued Flash application. Even that may not have worked. In my
experience, it is not possible. Please, share what you found! :)


David
stiller ( at ) quip ( dot ) net

simplyrose
10/15/2004 12:20:26 PM
Thanks Dave.

What would be ideal. If Flash could output the arrangement as a jpg by
pressing the post-it button and then sends it as an e-mail to me.

If that is possible, which commands would be needed?
David Stiller
10/15/2004 12:46:15 PM
simplyrose,

Here is the exact reply from your Jedi compadre:

[quoted text, click to view]

The statement "yes it can be done" doesn't prove anything yet, you'll
have to agree. :) Flash can certainly invoke a user's default email client
and send email. This works exactly the same way as in HTML (<a
href="mailto:user@domain.com">mail</a>). BUT, the user must have an email
client installed and configured on that machine.

Let's say, for sake of argument, that all your visitors have no problem
with an email client (and honestly, that's a fair argument; truly, most
people do). Now, you could parse your variables into a string and add that
as a query string to your mailto (using getURL();), and that would send a
bunch of code to your webmaster, or anyone you please. (Even better would
be to use some middleware page to format these variables, but hey ... that's
fine.)

So your webmaster receives a huge URLencoded string. He or she will not
receive a JPG. In fact, he or she will not receive an attachment of any
kind -- without middleware.

When Jedi writes back -- and I truly hope he or she does -- please keep
us updated.


David
stiller ( at ) quip ( dot ) net

simplyrose
10/15/2004 3:06:01 PM
Thanks again, Dave!

i got you the first time though with x and y co-ordinates and sending it to
another app..

Flash does have a feature to output the movie as a picture.
So i dont see why not that can be commanded by Action Script with all its new
feaures.
Meanwhile i asked somewhere else and read that it can be done entirely in
Flash.

i am quite sure Dave, the solution you propose works too - but there
are a million ways to tame the devil :)

sroberts1
10/15/2004 3:29:34 PM
Originally posted by: simplyrose
Meanwhile i asked somewhere else and read that it can be done entirely in
Flash.

Dave is correct, there is no Action Script command that can do this. But if
you have found another way to output the movie as a picture at run time and
doing this entirely with Flash please share it with us.
simplyrose
10/15/2004 4:33:02 PM
thanks guys for the speedy replies.

i got the positive answer from a Flash-Kit Jedi complete with a laser sword to
boot :)


http://www.flashkit.com/board/showthread.php?s=5ef4b03178cbd690844487d6175b0abe&
threadid=589373
simplyrose
10/16/2004 4:56:03 PM
Jedi seems to have gone to another galaxy ......

David Stiller
10/18/2004 8:13:23 AM
simplyrose,

[quoted text, click to view]

The answer to that one is up to you -- which is nice, because it gives
you a lot of choice. Almost certainly, you'll have to come up with (or hire
someone to come up with) a custom solution, since what you're after is not a
common endeavor, like, for example, an online shopping cart.

Choose a middleware language that suits your server. If you're using a
Microsoft server, go with ASP or ASP.NET; if you're on Unix, go with Perl or
PHP. What you're aiming for is some scripting that receives any number of
variables from your SWF and reformats the information in a way that's useful
to your needs. You might start with a simple mailer that simply dumps the
variables straight into an email without any formatting. That may just
work, but is likely to be hard to read, since all your variables will come
in a comma separated list (or something like it).

There are a million ways to tame the devil.


David
stiller ( at ) quip ( dot ) net

Howco
2/2/2005 9:55:46 PM
Everyone here is right, a swf file just can't do this. I had a possible
project a few years back with allmost the same problem. The client wanted
people to be able to make buisness cards on the fly. I can't tell you exactly
what I did because I do not rember all that much about it. I used 3 things
Flash, Cold Fusion, and a PDF. Now what I did was have flash send the data to
cold fusion wich in turn generated a dynamic PDF depending upon the data sent
to it. Like I said it was a long time ago and I do rember getting it working
just fine. It would put all the data where it needed to go and generate the PDF
file and then mail it to the client. Do a simple search in google for create
dynamic pdf, you will find plenty of information about it. I built mine with
some help of some free code out there that I modified but if you do not know
cold fusion, and you have trouble with flash there are ready built applications
that you can buy. And I am sure by now there are systems to do this in php asp
ect. I know for sure you can save data for flash and replay it back at
another date. I saw this thing on art.com where you could paint a picture and
send a link to a friend and when he clicked on the link and went to the site
poof there was the picture.
simplyrose
2/5/2005 10:44:56 AM
AddThis Social Bookmark Button