Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-11-2008, 01:58 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Give up with browser but this problem then....

Code:
var ax = createControl("WMPlayer.OCX", 0, 0, 200, 200);
ax.activex.url = "http://mysite.com/broadband.asx";
ax.activex.controls.play();
How do i use this code in AS2 ????


Im asking because im writing all code in FlashDevelop (more organized)

Reply With Quote
  #2 (permalink)  
Old 04-14-2008, 05:48 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Give up with browser but this problem then....

First, you must use the Wrapper Creator to create the wrapper classes by choosing wmp.dll in system directory.

Second, use the following code in actionscript 2

Code:
import SWFKit.*;
import WMPLib.*;

var ax = Global.createControl("WMPlayer.OCX", 0, 0, 200, 200);
var wmp = new WMPPlayer(ax.activex);
var wmpControls = new WMPControls(wmp.controls);
wmp.URL = "http://mysite.com/broadband.asx";
wmpControls.play();
Reply With Quote
  #3 (permalink)  
Old 04-14-2008, 09:02 AM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: Give up with browser but this problem then....

Amazing

But is there any way to control such as volume and other like actions when i set my wmp to 0 and 0 in height and width ?
I found the as file containing volume and as i see there is volume(value) for to set a vol. value
but when i set

wmpControls.volume(0);

i still hear music


I also discovered that wmpControls.play(); isnt needed.
I associated this code with a button and i didnt even press it, music started to play
Reply With Quote
  #4 (permalink)  
Old 04-15-2008, 10:54 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Give up with browser but this problem then....

Code:
var wmpSettings = new WMPSettings(wmp.settings);
wmpSettings.autoStart = false;
wmpSettings.volume = 0;
Reply With Quote
  #5 (permalink)  
Old 04-16-2008, 10:37 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: Give up with browser but this problem then....

It worked out just fine!!
again. amazing!!!!

Now i know how to use other wmp controls.

Thank you!
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:09 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.