943,884 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 446
  • PHP RSS
Sep 2nd, 2009
0

help with flash and php

Expand Post »
hi all
im writing a flash game, which the "brains" is in php and the client is on flash.
i've written the board in flash and now i have a 9 same movie clip in flash.
this movie clip has 4 frames in it and they all sits on the main frame.
my problem is that:
lets say that in my php file, i randomized a movie clip(lets say that the name is b21)
now i want to use this name in my flash so i could do this:
PHP Syntax (Toggle Plain Text)
  1. b21.gotoAndStop(3);
and what ever i do, it doesnt seems to work.
i can use this name on a dynamc text and show it. but i cant use it as a movie clip name.
if someone could help
thanks!
Last edited by Ezzaral; Sep 2nd, 2009 at 1:08 pm. Reason: Fixed code tags.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
severman is offline Offline
70 posts
since Mar 2008
Sep 4th, 2009
0

Re: help with flash and php

Can you post your AS code to see what you are trying to do that isn't working? You call php, get a variable which is a name, then you try to load that movieclip correct?
Reputation Points: 10
Solved Threads: 5
Light Poster
mazeroth is offline Offline
27 posts
since Jan 2009
Sep 4th, 2009
0

Re: help with flash and php

yap that correct
if my php return the value "b21"
i then want to use it as
PHP Syntax (Toggle Plain Text)
  1. b21.gotoAndStop(3);
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
severman is offline Offline
70 posts
since Mar 2008
Sep 5th, 2009
0

Re: help with flash and php

What you are trying to do is use dynamic referencing. For example, try this:

var name = 'b21'; // this value come from php
this[name].gotoAndStop(3);

This code will use the value of this[name], in this case, b21 and tell b21 to gotoAndStop. Here's more info:

http://www.nunomira.com/tutorials/dy....php#functions
Reputation Points: 10
Solved Threads: 5
Light Poster
mazeroth is offline Offline
27 posts
since Jan 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: how to store image in a folder and mysql
Next Thread in PHP Forum Timeline: youtube Video in php





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC