Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-04-2008, 12:45 PM
Junior Member
 
Join Date: Jan 2007
Posts: 6
Default MP3 Player - File Association

Hello,

I made a MP3 Player with SWFkit... ( Link: http://www.syeef.com )

My questions are:
1. How do I associte it with MP3 files.
2. Everytime I click the exe file for the player a new copy of the player opens, how do I prevent it. I want only one copy of the player to run at a time.

Thank You.....
Reply With Quote
  #2 (permalink)  
Old 01-06-2008, 07:38 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: MP3 Player - File Association

Please add the following code into the "initialize" script, before the "return true;" clause. And please modify "Single Instance Sample" to your window name.

Code:
// ensure only one instance

// look for windows whose names are "Single Instance Sample", 
// which is the name of this application
// the returned value is an array contains window objects
var wnds = Window.getWindowsByName("Single Instance Sample");
trace(wnds.length);
if (wnds.length > 0)
{
	// more than one window found, which means there is at least one another
	// window with the same name exists. That is to say, 
	// at least another instance exists. In this case, 
	// we should bring that window to top, and exist the current process
	
	// c_wnd is the current window
	var c_wnd = getMainWnd();
	for (var i = 0; i < wnds.length; i++)
	{
		if (wnds[i].handle != c_wnd.handle)
		{
			wnds[i].bringToTop();
			return false;
		}
	}
	
	return false;
}

Application.associate(".mp3", "mp3file");
Reply With Quote
  #3 (permalink)  
Old 01-07-2008, 06:47 AM
Junior Member
 
Join Date: Jan 2007
Posts: 6
Default Re: MP3 Player - File Association

I couldn't figure it out... May I see an example...

and after using Application.associate(".mp3", "mp3file"); my JetAudio player still has control over the .mp3 files.


thank you...
Reply With Quote
  #4 (permalink)  
Old 01-29-2008, 01:55 PM
Junior Member
 
Join Date: Jan 2007
Posts: 6
Default Re: MP3 Player - File Association

Hello... is there anyone?
Reply With Quote
  #5 (permalink)  
Old 02-01-2008, 03:01 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: MP3 Player - File Association

It seems to be a hard problem. MP3 files are special. The code can only associate normal files.
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 04:47 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.