Skip navigation
Currently Being Moderated

How can i pass a movieclip instance on mouse click to php

Jul 11, 2012 5:41 AM

Hello...! I have a problem here. I'm totally new to actionscript, what i want to do is "i have a map in flash with different cities movieclips & i want to pass the value of that city to php on mouse click to the city. Please help me in scripting....

 

Thanks in advance

 
Replies
  • Currently Being Moderated
    Jul 11, 2012 7:41 AM   in reply to Shoaib Ahmed 99

    Search Google for tutorials about using the LoadVars class.  Here is one result from searching "AS2 LoadVars tutorial" the has it working with sending data to a PHP file...

     

    http://snipplr.com/view/8878/

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 12, 2012 5:03 AM   in reply to Shoaib Ahmed 99

    Yes, I have already informed you to search for a tutorial, and even provided a link to one that shows you how to interact between an AS2 file and a php file to send data, such as an instance name or value. 

     

    If your problem is that you do not know how to code a movieclip to be clickable, then you would use something like the following in the timeline that contains the movieclip...

     

    movieclipName.onRelease = function(){

          // code to initiate passing the info to the php file here

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 12, 2012 9:14 AM   in reply to Shoaib Ahmed 99

    It is better to use the timeline style of coding that I showed instead of placing code on objects like yours.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 13, 2012 5:00 AM   in reply to Shoaib Ahmed 99

    Just change the code I offered to use your button's instance name

     

    buttonName.onRelease = function(){

                getURL("result.php?value1=1");

    }

     

    Note that you are going to replace the current page with the php page using that approach of passing the data to the php page.  That is not what you asked about originally.  So if that is not what you want to do, go to the tutorial I pointed you to or find another like it and follow it.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points