Dear Forum I have an OOP question. I am trying to make a class that manages my videos. The main public function of it would be the getFlv() funtion wich goes into the Database and retries a path to a flv file. Pretty straighforward. Now since there is a little delay between the return and the call of the function how would I most elegantly solve the return issue? I am trying to avoid writing a loop to check whether some variable has changed... but even then I wouldn't know how to pass the variable back to the place where it's needed... I guess it's also a question of scope of variable. Here is the code>> ///////////////////////////////// class com.website.VideoManager { //various variables [...] public function VideoManager(){ } public function getFLV():String{ str = connectToDb(); return str; } private function connectToDb():String{ sendLV = new LoadVars(); dbDate = new Date() dbRand = String(dbDate.getYear()+""+dbDate.getMonth()+""+dbDate.getHours()+""+dbDate.getM inutes()+""+dbDate.getSeconds()+""+dbDate.getMilliseconds()) sendLV.id = dbId; sendLV.rand = dbRand; var con:String = "bin/flash_db_get.php"; recXML = new XML(); recXML.ignoreWhite=true; sendLV.sendAndLoad(con,recXML); recXML.onLoad = function():String{ return String(this) } } }
Don't see what you're looking for? Try a search.
|