help with flash and php

Please support our PHP advertiser: 50% off 6 Months Dedicated Server Hosting from 1&1!
Thread Solved

Join Date: Mar 2008
Posts: 46
Reputation: severman is an unknown quantity at this point 
Solved Threads: 0
severman severman is offline Offline
Light Poster

help with flash and php

 
0
  #1
Sep 2nd, 2009
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:
  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 12:08 pm. Reason: Fixed code tags.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 16
Reputation: mazeroth is an unknown quantity at this point 
Solved Threads: 3
mazeroth mazeroth is offline Offline
Newbie Poster

Re: help with flash and php

 
0
  #2
Sep 4th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 46
Reputation: severman is an unknown quantity at this point 
Solved Threads: 0
severman severman is offline Offline
Light Poster

Re: help with flash and php

 
0
  #3
Sep 4th, 2009
yap that correct
if my php return the value "b21"
i then want to use it as
  1. b21.gotoAndStop(3);
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 16
Reputation: mazeroth is an unknown quantity at this point 
Solved Threads: 3
mazeroth mazeroth is offline Offline
Newbie Poster

Re: help with flash and php

 
0
  #4
Sep 5th, 2009
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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 342 | Replies: 3
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC