I am new in flash. I am willing to make a customize avatar for a registered user where the accessories will be save in a database. The item will be pulled from database to flas and after the user finished creating his avatar this will be save in the database. I mean my avatar application will be as like as farmville avatar customizetion using flash,php and mysql. I am fadeing up to find this solution. Please help me!
The solution depends on how big your editor will be. There is a nice example of an avatar editor made by Senocular that you can find on Google Code:
http://code.google.com/p/myavatareditor/
This should get you started with the flash part. I recommend that you parse the selections made in the editor and save it as a string or maybe JSON. This will make it easy to add extra features later. When the user login the next time you just load and parse the saved editor data from the database and build the correct avatar.
EDIT:
Find out how to use AS3 with PHP and MySQL:
http://www.gotoandlearn.com/play.php?id=20
I wrote on my blog not too long ago a post about how to store Jpg images on server from Flash ActionScript3. It's all in Spanish (except for the actual coding, of course), but maybe with Google Translate (or some other translation service) you'd be able to follow it.
The steps are:
1) Use BitmapData.draw() on the MovieClip (in your case, the customized avatar)
2) Using JPGEncoder, store its binary data in a ByteArray
3) Send the binary data to PHP with URLRequest, URLLoader
4) In PHP script, receive the binary data and do whatever (fwrite it to a file to store it as a image file, or store in a database as a blob)
5) Profit!
Hope this helps!
Related
I am currently working on a website which will be used for displaying scores in several benchmarks. In order to accomplish this, i am using PHP(duh :D) for the database queries and the JPGraph library, which creates the graph and then displays and it as an image with the GD library.
The user of the site can select which chart he wants to see with a <form> that contains the following criteria:
The Client that ran the test
The Operating System the Client used at the time
The Benchmark that was used
And what type of chart he wants to see (Bar graph, line graph....)
All of this works fine, the graph is displayed without a problem in the <iframe> that it is supposed to be in.
However, I also want the user to be able to save the Graph, with, say a second button. I can get the GD handle of the image, but how can I use this to save the image to a file on the client?
Any help would be very welcome.
Regards, Andy
I am an novice in Javascript and PHP. I am working on to create a visitor management system where a web form is used to insert the data and when clicked on Submit button data are stored in the database and a pass is printed. But my problem is that I am trying to use a web cam to take the snap of the visitor and want to save it in the database as BLOB. I don't have any idea but tried http://www.xarg.org/project/jquery-webcam-plugin/ etc and couldn't find any clue. Kindly help.
I have created a basic website that uses MySQL and PHP to store the pages in a database following some online tutorial. The pages are used to dynamically create the menu , which I like. The main point of the site is to be an online gallery of paintings.
I can easily create this site statically in HTML, but I kind of want to try doing it dynamically. I can store the jpegs in a folder on the server and have HTML links within the page content. But is there any other way of doing it? Would it be sensible to store all the picture data and file names in a database, so that it gets retrieved when a user clicks an option from the menu?
Any thoughts would be appreciated
Research a bit more, you have one of the most answered problem in existence.
Why do you want to do it dynamically if static HTML is sufficient for your use. To make it cool is not the right reason.
About storing the jpegs in database read this article.
To BLOB or Not To BLOB - Microsoft Research
research.microsoft.com/apps/pubs/default.aspx?id=64525
I am building a webpage using PHP to search within my database. I am able to do a query and get the data to show on my page.
I also have a picture that is related to each record. Let's say something like a picture ID for each employee. I am wondering what is the best way to store and retrieve pictures in order to get it show using PHP.
Is there a way to store all the pictures in the subfolder like " image" and retrieve the pictures using PHP? I tried to search around on the internet, but I get confused.
Also, when I type something in the search box and click the button, is there a way to keep the input in the search box without erasing it?
Thank you very much.
The typical way is exactly what you said - store all the pictures in a folder and store their path in the database (or be able to build their path from their id or something). You just need to create a script to insert the record into your database when you add the picture to the file system.
You can store the pictures in database itself. You can have a field in the user table called 'pic' with data type 'blob'. This can store the image for every user. This link will get you started:
http://mrarrowhead.com/index.php?page=store_images_mysql_php.php
As, correctly pointed out by #shaheer in the comment below, this is not a recommended practice.
'Attaching' images to your class objects by storing the web-url in the database as a attribute of that class is a better way. There is a excellent Ruby gem that I use for this frequently its called Carrierwave. Its workflow should be good for you to get Idea on how to do this in php.
I am not sure if there are any good alternatives for php (I am not a php dev) but a quick search returned this: Attachy. This is specifically to manage 'uploads', but you can use the same technique on existing images that you want to attach to your class.
My app is posting to users' Facebook walls, and linking to a page they have created. The page is in html. I'd like to be able to put a thumbnail of the page as the image on the wall post. I'm not sure whether this is possible or not. Anyone have any ideas?
If it helps, the page itself is stored as a series of 'elements'... for each one, I know the size and position of the element, and the content (which may be text or an image). So I can pull all that in from the database.
I guess it would be sufficient to create a thumbnail using php at the point when the user clicks 'Publish This to my wall', if that's easier than doing it on the fly - I can save the image and then link to it.
Any ideas?
I create thumbnails for my site using CutyCapt, which works very well indeed on both Windows and Linux. You can use exec to invoke this from php.
There are also web services that allow you a quota of free thumbnail snapshots, that are easy to integrate into your website. e.g.
http://www.websnapr.com/
or
http://webthumb.bluga.net/home
I figured out how to do this. I used the PHP gd library, which allows you to create a base image and then add images and text. Works pretty well.