Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 5th, 2011, 02:59 AM
benno32's Avatar
benno32 benno32 is offline
/*
Dev Shed Novice (500 - 999 posts) Click here for more information
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 729 benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 23 h 19 m 26 sec
Reputation Power: 619
ActionScript 3 - Running flash on a web server

Hi folks,

I work on a lot of digital media projects; which often require dynamic graphics. I find flash to be a great tool for this purpose. It's very easily to dynamically change text inside a swf, compensate for text overflow and apply lots of nice filters and effects. Not to mention font embedding.

This technique works great for web pages, however quite often we want to use flash generated artwork in a html email. How can we do this? Well, we can use as3corelib to generate a jpg from a swf, and then use the generated image in an email.

This is fine, so long as we can pre-generate all of the images, before sending out the emails. But say we need to generate the dynamic jpeg on the fly from a webpage? If the user on the webpage has flash installed we could configure a swf to generate the image for us.

But what if the user has flash disabled? Maybe they are using an ios device or simply don't like flash.

What I would like to do is set up a server side fallback that could run a swf, replace text in the swf based on supplied variables, generate a jpg using as3corelib and save the jpeg somewhere. The trick here is running flash player on the server. It would also need to run in a multithreaded way in case the server needed to process multiple requests.

Anyone have any ideas? I appreciate any comments.
__________________
*/

Reply With Quote
  #2  
Old March 5th, 2011, 04:38 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 6,663 Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 3 Days 20 h 11 m 52 sec
Reputation Power: 3163
Facebook MySpace
Howdy, you can try using Flash and PHPs GD image library. Just google all of those for some relevant tutorials. The gist of the idea is that you use Flash to make a screenshot of itself which it then sends to PHP that then uses the GD library to save a still image file i.e. jpg.

The downside is that someone has to run the SWF for the image to be saved. Also, you don't want it to save a new image each time anyone views the SWF. What might work nicely is if you made your normal Flash version as you have now. Then make a new SWF that has the screenshot code and PHP talking code in it. That would do three things. (1) Load in your current SWF content file (2) Take a screenshot of it (3) Send that data PHP so it can be saved.

So then when you want people to see the Flash version you just point their browsers towards the normal content clip but when you want to update the static image version then you yourself can manually run the screenshot taking SWF.

You could look into using a Cron job on Linux or a Task (Task Scheduler) on Windows. That would let you automate running the screenshot taking SWF.

I've never done this process before, I just made it up but it sounds like it could work. At least it gives you something to tinker with. You might want to have a look at the PHP Ming library. It sounds kinda basic on its own but you could integrate it with other SWFs that you made in the IDE with more advanced features and functionality that you could not implement with Ming.
__________________
Quis custodiet ipsos custodes?

Reply With Quote
  #3  
Old March 5th, 2011, 05:25 PM
benno32's Avatar
benno32 benno32 is offline
/*
Dev Shed Novice (500 - 999 posts) Click here for more information
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 729 benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 23 h 19 m 26 sec
Reputation Power: 619
Hi Tan,

Thanks for your thoughts and comments. I like the idea of using a cron job or scheduled task. I've had a look into AIR 2 and have found that it can act as a socket server.

I'm thinking of a process similar to this:

If a website user does not have flash I can not load a swf in their session to generate the screenshot.

In this case I could capture the relevant data in a web form and store it in a db.

A cron job on the server could poll the database regularly.

If new data is found the cron job could send the information to a running air app via a socket connection.

The AIR app could then generate the jpg and save it in an appropriate location.

It would be interesting to test this. Too be honest I'm leaning towards either using a static generic image for use cases where the user hasn't got flash installed or presenting them with a message to say that flash needs to be installed in order to use the service.

Reply With Quote
  #4  
Old March 6th, 2011, 03:29 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 6,663 Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 3 Days 20 h 11 m 52 sec
Reputation Power: 3163
Facebook MySpace
Going with a single default static image would make the whole thing a lot simpler. I use swfobject2 for embedding my SWFs into the HTML pages. That lets you serve up alternative content if they do not have Flash installed. I normally use a static still image, a pure HTML alternative or sometimes just a "Get Flash" link. Depends on what the content it/how lazy I am/how long I have to spend on it.

Haven't touched Air 2 yet, last time I used it was v1 or v1.1 something like that. I'd be very interested to hear about your progress if you do decide to implement an Air socket server. If it's simple then I would totally make one for some pet projects I have written down. Couldn't be arsed with Red5 or the developer edition of Flash Media Server.

Reply With Quote
  #5  
Old March 12th, 2011, 07:33 AM
benno32's Avatar
benno32 benno32 is offline
/*
Dev Shed Novice (500 - 999 posts) Click here for more information
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 729 benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 23 h 19 m 26 sec
Reputation Power: 619
I will post back if / when I experiment with an AIR socket server.

Reply With Quote
  #6  
Old November 26th, 2012, 08:45 AM
doogma doogma is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 doogma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 15 sec
Reputation Power: 0
any luck

Hi Benno,

Did you get this working?

Thanks

Reply With Quote
  #7  
Old November 27th, 2012, 02:16 AM
benno32's Avatar
benno32 benno32 is offline
/*
Dev Shed Novice (500 - 999 posts) Click here for more information
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 729 benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level)benno32 User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 23 h 19 m 26 sec
Reputation Power: 619
Quote:
Originally Posted by doogma
Hi Benno,

Did you get this working?

Thanks

Hi Doogma,

Sad to say that I did not persue this project any further. I'd still like to try this but have been moving away from flash ever since Adobe stopped supporting it for mobile devices and abandoned Flex.

regards
Ben

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > ActionScript 3 - Running flash on a web server

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap