A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8] How do I do this... hockey team edit lines application...

  1. #1
    Member
    Join Date
    Apr 2004
    Posts
    54

    Angry [F8] How do I do this... hockey team edit lines application...

    Remember seeing those interactive flash chalkboards on myspace pages... where I could write something, save it, and it would show up with that message on everyone else's computer?

    HOW DO I DO THAT???

    I play mens league hockey... and I'm creating an "edit lines" application for our team blog. It is a simple drag and drop application that you would see in video games... but I want the final output saved once the lines are "set". I didn't think this through all the way and now realize that the way I'm building it will never "lock" the lines in place so all the members of the team can see the lines for the upcoming game.

    I only want a few people to be able to "change" and "save" the lines... but I want the output of the finalized lines to save, just like those drawings on the chalkboards would save.

    But Google and I are having issues with what I'm trying to ask...

    Any help would be greatly appreciated!

  2. #2
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    Here's a few things to get you started.

    Draw lines with the mouse:
    PHP Code:
    var thick:Number 2;//thickness of the line
    var color:Number 0x333333;//the color of the line
    var line:MovieClip;//line var storing line MC instance name


    var MouseList:Object = new Object();
    Mouse.addListener(MouseList);
    MouseList.onMouseDown = function() {
        
    line _root.createEmptyMovieClip("line",getNextHighestDepth());
        
    line.blendMode "darken";
        
    line.moveTo(_xmouse_ymouse);
        
    line.lineStyle(thickcolor100);
        
    _root.onMouseMove = function() {
            
    line.lineTo(_xmouse_ymouse);
            
    updateAfterEvent();
        };    
    };

    MouseList.onMouseUp = function() {
        
    _root.onMouseMove null;
    }; 
    export an image from flash as a jpg using php:

    http://www.sephiroth.it/tutorials/fl...en/page002.php

    What you'll have to do for many users to be able to see the drawing is to save a screenshot of the flash stage as a jpg using php, or another server side language. You'll also need some code, and possibly a database, so that you can get that image back into flash upon request so that others can view it.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  3. #3
    Member
    Join Date
    Apr 2004
    Posts
    54

    confused a bit...

    So what you're saying is that I need to investigate the whole print screen/php deal.

    Here's the link to the prototype edit lines application. http://71.18.155.4/punchkick/pk_lines.html

    After all the lines are full... I want there to be a "SAVE" button that basically locks all these in place. From what you've told me, I need to take a screenshot using the bitmap class... save it using PHP... and then call it back using PHP when other people visit the blog on which this will be placed.

    If I follow the link to the tutorial you found, will this work for me?

    Thanks for the reply by the way... and for any additional help.

  4. #4
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    That tutorial I gave you is the easiest way that I know of to export an image (screenshot) from flash. Flash is incapable of doing what you need on its own, which is why you would have to do something like the save image script with php. You won't really need to call the image back using php depending on how you set it up. You could have php make the image, then store it in a folder specifically for what your doing, then use php to read the directory and feed a list back to flash. You could also have php amend the new image to an xml file and use that to read in the paths to flash. No matter how you do it though you'll need something other than flash like php to get the line image back for others to see. Flash has no capability to save anything itself other than variables in a shared object, and that is local to each user only.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  5. #5
    Member
    Join Date
    Apr 2004
    Posts
    54

    i'll see what I can figure out...

    Should be fun to try...

    I'll be back with more questions once I find some time to focus on it again. I'm sure I'll need a few more posts of clarity from you.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center