[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.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.4

Why is not running the movie in my server?

Asked by eddyperu in ActionScript, Adobe Flash

Experts,
I found this code online and it is allowing me to load a movie in my flash file. As a result I have a swf that load the movie(flv) called "DemoMovie.flv".When I test it from my local machine works great but when I set it up in the server. It doesn't want to work..... Let me rephrase the last sentence; it works fine  if I am in the server and click the swf but when I try to open that page(the swf  from the server) in my local machine it doesn't want to work.
Any ideas why???
Thanks

ps: I am attaching my code, I am using Action Script 3
thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
var net_connection:NetConnection = new NetConnection( );
 
 
net_connection.connect( null );
 
 
var net_stream:NetStream = new NetStream(net_connection);
 
 
var url:String = null;
var Width:Number = 0;
var Height:Number = 0;
var buffertime:Number = 0;
 
 
var video:Video = null;
 
 
net_stream.client = this;
 
 
net_stream.bufferTime = 7;
 
 
net_stream.play("DemoMovie.flv");
 
 
var duration:Number;
var total_minutes:Number;
var total_seconds:Number
var current_minutes:Number;
var current_seconds:Number
var scrub_minutes:Number;
var scrub_seconds:Number
 
var video_is_playing:Boolean = true;
play_button.alpha = 0;
pause_button.alpha = 1;
play_toggle.buttonMode = enabled;
 
 
play_toggle.addEventListener(MouseEvent.CLICK, toggle_play);
 
function toggle_play(e:Event){
	if(video_is_playing){
		PauseFlv();
		video_is_playing = false;
		play_button.alpha = 1;
		pause_button.alpha = 0;
	}
	else {
		ResumeFlv();
		video_is_playing = true;
		play_button.alpha = 0;
		pause_button.alpha = 1;
 
	}
}
 
	function PauseFlv():void {
		net_stream.pause();
	}
 
 
	function ResumeFlv():void {
		net_stream.resume();
	}
 
this.onMetaData = function(info) {
	
	duration = info.duration;
	total_minutes = int(duration / 60);
	total_seconds = int(duration - (total_minutes * 60));
 
};
 
 
video = new Video( );
 
 
video.width =896;
video.height = 688;
 
 
video.attachNetStream(net_stream);
 
 
video_holder_clip.addChild(video);
 
video_holder_clip.addEventListener(Event.ENTER_FRAME, move_bars);
 
 
	function move_bars(e:Event) {
		
		var duration = Math.floor(duration);
		var net_streamt = Math.round(net_stream.time);
	
		var amount:int = Math.floor((net_streamt/duration)*100);
 
		MovieClip(root).progress_bar.width = amount*7;
		current_minutes = Math.floor(net_stream.time/60);
		current_seconds = int(net_stream.time - current_minutes*60);
							  
		if(current_seconds >= 0){
			if(current_seconds < 10){
				time_display.text =  current_minutes+":0"+current_seconds+" / "+total_minutes + ":"+ total_seconds;	
			}
			else {
				time_display.text =  current_minutes+":"+current_seconds+" / "+total_minutes + ":"+ total_seconds;	
			}
		}
		else {
			time_display.text = "0:00 / "+total_minutes + ":"+ total_seconds;
		}
		
	}
 
 
progress_bar_overlay.buttonMode = enabled;
 
 
progress_bar_overlay.addEventListener(MouseEvent.CLICK, move_bar_manually);
 
 
progress_bar_overlay.addEventListener(MouseEvent.MOUSE_OVER, show_scrub_bar);
 
 
progress_bar_overlay.addEventListener(MouseEvent.MOUSE_OUT, hide_scrub_bar);
 
 
progress_bar_overlay.addEventListener(Event.ENTER_FRAME, reset_scrub_bar);
 
var dist:Number;
var goto:Number;
var mouse_over:Boolean = false;
 
	function move_bar_manually(e:Event) {
 
		dist = ((mouseX-50) - (progress_bar_overlay.x-50)) / progress_bar_overlay.width;
		if(dist < 0){
			dist = 0;
		}
		goto = int(duration * dist);
 
		net_stream.seek(goto);
		
		current_minutes = int(goto / 60);
 		current_seconds = int(goto - (current_minutes * 60));
		
	}
 
 
function show_scrub_bar(e:Event){
	scrub_bar.alpha = 1;
	mouse_over = true;
	scrub_bar.x = mouseX;
 
	dist = ((mouseX-50) - (progress_bar_overlay.x-50)) / progress_bar_overlay.width;
	if(dist < 0){
		dist = 0;
	}
	goto = int(duration * dist);
 
	scrub_minutes = int(goto / 60);
	scrub_seconds = int(goto - (scrub_minutes * 60));
	if(scrub_seconds < 10){
		scrub_bar.scrub_text.text = scrub_minutes+":0"+scrub_seconds;
	}
	else {
		scrub_bar.scrub_text.text = scrub_minutes+":"+scrub_seconds;
	}
}
 
function hide_scrub_bar(e:Event){
	mouse_over = false;
	scrub_bar.x = -50; // since you can't alpha 0 a dynamic text field;
}
 
function reset_scrub_bar(e:Event){
	if(mouse_over){
		progress_bar_overlay.dispatchEvent(new Event(MouseEvent.MOUSE_OVER));
	}
}
[+][-]10/08/09 11:32 AM, ID: 25528545Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: ActionScript, Adobe Flash
Sign Up Now!
Solution Provided By: eddyperu
Participating Experts: 0
Solution Grade: A
 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625