|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by letharion in Adobe Flash, ActionScript, Multimedia Programming
I have made a trivial password protection for a movie.
The movie is stopped and "removeChild"ed when the flash loads, and upon entering the correct password, the movie is re-added and begins playing. This works well in the editor, and locally, but as soon as I upload this to a remote server, two problems show up:
1) The movie runs from the beginning.
2) The playback controls go missing despite the files being uploaded in the same hierachy as when tested.
Below is the very trivial code that I use.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
|
package {
import flash.text.*;
import flash.events.*;
import flash.display.MovieClip;
public class PP extends MovieClip {
public function PP() {
theMovie.stop();
removeChild(theMovie);
passwordBox.text = "";
passwordBox.displayAsPassword = true;
passwordBox.addEventListener(Event.CHANGE, inputHandler);
}
private function inputHandler(event:Event) {
if(passwordBox.text == 'somepass') {
addChild(theMovie);
theMovie.play();
}
}
}
}
|
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625