Language: ActionScript
Untitled ActionScript (20-Aug @ 09:40)
Syntax Highlighted Code
- var asa
- asd
- as
- [4 more lines...]
Plain Code
var asa
asd
as
das
d
asd
as
dasdasda da s
Untitled ActionScript (14-Aug @ 22:03)
Syntax Highlighted Code
- new Sprite();
Plain Code
new Sprite();
Untitled ActionScript (14-Aug @ 14:02)
Syntax Highlighted Code
- http://dnl.interoute.com/%7Ba5719c13-f5ff-4522-af41-a4991dabe120%7D/%7Bd1167558-42f1-40c4-9f33-9a48a049e5d9%7D/loveisnoise.flv
Plain Code
http://dnl.interoute.com/%7Ba5719c13-f5ff-4522-af41-a4991dabe120%7D/%7Bd1167558-42f1-40c4-9f33-9a48a049e5d9%7D/loveisnoise.flv
Untitled ActionScript (11-Aug @ 16:29)
Syntax Highlighted Code
- <script>alert('hello')</script>
Plain Code
<script>alert('hello')</script>
Untitled ActionScript (11-Aug @ 16:29)
Syntax Highlighted Code
- hgfh fghfgh fgh
Plain Code
hgfh fghfgh fgh
Untitled ActionScript (10-Aug @ 17:42)
Syntax Highlighted Code
- trace("hello")
Plain Code
trace("hello")
Untitled ActionScript (3-Aug @ 19:24)
Syntax Highlighted Code
- function aa() {
- trace("aa");
- }
Plain Code
function aa() {
trace("aa");
}
Untitled ActionScript (30-Jul @ 14:53)
Syntax Highlighted Code
- sdfsadfas
- dfasdf
- asdfas
- dfasdf
- [1 more lines...]
Plain Code
sdfsadfas
dfasdf
asdfas
dfasdf
asdf
Untitled ActionScript (28-Jul @ 03:42)
Syntax Highlighted Code
- mx.controls.Alert.show("123")
Plain Code
mx.controls.Alert.show("123")
Untitled ActionScript (26-Jul @ 02:49)
Syntax Highlighted Code
- package code
- {
- /*****************************************
- * Components1 :
- [55 more lines...]
Plain Code
package code
{
/*****************************************
* Components1 :
* Demonstrates using the FLVPlayback component and built-in
* skins to load and control a Flash video (FLV).
* -------------------
* See 1_video.fla
****************************************/
import flash.events.Event;
import flash.display.MovieClip;
import flash.text.*;
import fl.video.*;
public class Components1 extends MovieClip
{
//*************************
// Properties:
public var loading_txt:TextField;
public var loading_styles:StyleSheet;
//*************************
// Constructor:
public function Components1()
{
// Show a loading message
loading_styles = new StyleSheet();
loading_styles.setStyle("p",{fontFamily:"Arial",fontSize:10,color:"#cccccc"});
loading_txt = new TextField();
loading_txt.styleSheet = loading_styles;
loading_txt.htmlText = "<p>Loading...</p>";
loading_txt.x = (stage.stageWidth-loading_txt.width)/2;
loading_txt.y = (stage.stageHeight-20)/2;
addChild(loading_txt);
// Respond to video player events
flvDisplay.addEventListener(VideoEvent.READY,readyHandler);
flvDisplay.addEventListener(VideoEvent.COMPLETE,completeHandler);
}
//*************************
// Event Handling:
protected function readyHandler(event:VideoEvent):void
{
// Clear text...
loading_txt.visible = false;
}
protected function completeHandler(event:VideoEvent):void
{
// Loop
flvDisplay.play();
}
}
}
Untitled ActionScript (26-Jul @ 02:05)
Syntax Highlighted Code
- /home/sysadmin/tpi/parts/app/runzope -C /home/sysadmin/tpi/parts/zopectl/zope.conf
- Traceback (most recent call last):
- File "/home/sysadmin/tpi/parts/app/runzope", line 118, in ?
- zope.app.twisted.main.main()
- [64 more lines...]
Plain Code
/home/sysadmin/tpi/parts/app/runzope -C /home/sysadmin/tpi/parts/zopectl/zope.conf
Traceback (most recent call last):
File "/home/sysadmin/tpi/parts/app/runzope", line 118, in ?
zope.app.twisted.main.main()
File "/home/sysadmin/.buildout/eggs/zope.app.twisted-3.4.0-py2.4.egg/zope/app/twisted/main.py", line 74, in main
service = setup(load_options(args))
File "/home/sysadmin/.buildout/eggs/zope.app.twisted-3.4.0-py2.4.egg/zope/app/twisted/main.py", line 145, in setup
zope.app.appsetup.config(options.site_definition, features=features)
File "/home/sysadmin/.buildout/eggs/zope.app.appsetup-3.4.1-py2.4.egg/zope/app/appsetup/appsetup.py", line 111, in config
context = xmlconfig.file(file, context=context, execute=execute)
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 610, in file
include(context, name, package)
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 546, in include
processxmlfile(f, context)
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 378, in processxmlfile
parser.parse(src)
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 357, in endElementNS
self.context.end()
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line 542, in end
self.stack.pop().finish()
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line 690, in finish
actions = self.handler(context, **args)
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 546, in include
processxmlfile(f, context)
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 378, in processxmlfile
parser.parse(src)
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 357, in endElementNS
self.context.end()
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line 542, in end
self.stack.pop().finish()
File "/home/sysadmin/.buildout/eggs/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line 690, in finish
actions = self.handler(context, **args)
File "/home/sysadmin/.buildout/eggs/grokcore.component-1.4-py2.4.egg/grokcore/component/zcml.py", line 48, in grokDirective
do_grok(package.__name__, _context)
File "/home/sysadmin/.buildout/eggs/grokcore.component-1.4-py2.4.egg/grokcore/component/zcml.py", line 53, in do_grok
config=config
File "/home/sysadmin/.buildout/eggs/martian-0.10-py2.4.egg/martian/core.py", line 202, in grok_dotted_name
grok_package(module_info, grokker, **kw)
File "/home/sysadmin/.buildout/eggs/martian-0.10-py2.4.egg/martian/core.py", line 207, in grok_package
grok_package(sub_module_info, grokker, **kw)
File "/home/sysadmin/.buildout/eggs/martian-0.10-py2.4.egg/martian/core.py", line 205, in grok_package
grok_module(module_info, grokker, **kw)
File "/home/sysadmin/.buildout/eggs/martian-0.10-py2.4.egg/martian/core.py", line 210, in grok_module
grokker.grok(module_info.dotted_name, module_info.getModule(),
File "/home/sysadmin/.buildout/eggs/martian-0.10-py2.4.egg/martian/scan.py", line 118, in getModule
self._module = resolve(self.dotted_name)
File "/home/sysadmin/.buildout/eggs/martian-0.10-py2.4.egg/martian/scan.py", line 191, in resolve
__import__(used)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/sysadmin/tpi/parts/app/site.zcml", line 4.0-4.25
ZopeXMLConfigurationError: File "/home/sysadmin/tpi/src/tpi/configure.zcml", line 5.2-5.27
ValueError: Empty module name
Untitled ActionScript (25-Jul @ 01:55)
Syntax Highlighted Code
- whatever.
- stuff
Plain Code
whatever.
stuff
Untitled ActionScript (21-Jul @ 04:39)
Syntax Highlighted Code
- ujiui
- i
- u
- u
- [3 more lines...]
Plain Code
ujiui
i
u
u
u
u
u
Untitled ActionScript (19-Jul @ 20:41)
Syntax Highlighted Code
- var test:String;
- trace("hallo");
Plain Code
var test:String;
trace("hallo");
Untitled ActionScript (19-Jul @ 00:55)
Syntax Highlighted Code
- This is a test.
Plain Code
This is a test.
Untitled ActionScript (15-Jul @ 14:27)
Syntax Highlighted Code
- <html>
- <head>
- <title> Mon premier script PHP</title>
- </head>
- [28 more lines...]
Plain Code
<html>
<head>
<title> Mon premier script PHP</title>
</head>
<body>
<table border="1">
<?php
$axis = array('','1','2','3','4','5');
$cpt = 1;
foreach ($axis as $xidx => $xval) {
print('<tr>');
foreach ($axis as $yidx => $yval){
if ($xidx == 0) {
print ('<th>'.$yval.'</th>');
}else{
if ($yidx == 0) {
print ('<th>'.$xval.'</th>');
}else{
print('<td>'.$scpt++.'</td>');
}
}
}
print('</tr>');
}
?>
</table>
</body>
</html>
Untitled ActionScript (15-Jul @ 13:59)
Syntax Highlighted Code
- myArr:Array = ("hello how are you").split(',');
Plain Code
myArr:Array = ("hello how are you").split(',');
Untitled ActionScript (14-Jul @ 14:43)
Syntax Highlighted Code
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"><head profile="http://gmpg.org/xfn/11">
- <script type="text/javascript" src="full/jquery-1.js"></script>
- [27 more lines...]
Plain Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"><head profile="http://gmpg.org/xfn/11">
<script type="text/javascript" src="full/jquery-1.js"></script>
</head><body>
<p>Some text</p>
<p>some text</p>
<h3></h3>
</blockquote>
<a href="#" id="button">Show popup</a>
<div id="bubble" style="padding: 20px; background:#666666; height: 77px; width:77px; position: absolute; display: none;"> <a href="#" id="cls">also close from here </a>This is a test. When you click away, it will disappear.</div>
<p><script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#button").bind("click", function(e) {
jQuery("#bubble").css({
top:jQuery(this).offset().top-jQuery("#bubble").height()-35
}).show();
e.stopPropagation(); // Stops the following click function from being executed
jQuery(document).one("click", function(f) {
jQuery("#bubble").hide();
});
});
// STOP the menu from disappearing when it is clicked
jQuery("#bubble").bind("click", function(e) { e.stopPropagation(); });
});
</script></p>
</body></html>
Untitled ActionScript (7-Jul @ 10:04)
Syntax Highlighted Code
- heb een mega dikke enkel ... ellendige steekvlieg, hij heeft met flink te pakken gehad!
Plain Code
heb een mega dikke enkel ... ellendige steekvlieg, hij heeft met flink te pakken gehad!
Untitled ActionScript (4-Jul @ 11:50)
Syntax Highlighted Code
- $(function(){
- $("select#kunden_id").change(function(){
- $.getJSON("/knowledgebase/ajaxprojektliste/",{kunden_id: $(this).val()}, function(j){
- var options = '';
- [7 more lines...]
Plain Code
$(function(){
$("select#kunden_id").change(function(){
$.getJSON("/knowledgebase/ajaxprojektliste/",{kunden_id: $(this).val()}, function(j){
var options = '';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
}
$("#projekte_id").html(options);
$('#projekte_id option:first').attr('selected', 'selected');
})
})
})
Untitled ActionScript (2-Jul @ 22:13)
Syntax Highlighted Code
- function fucking(hell:String){
- for (var i:Number = 0; i < 100; i++){
- trace("fucking hell times " + i);
- }
- }
Plain Code
function fucking(hell:String){
for (var i:Number = 0; i < 100; i++){
trace("fucking hell times " + i);
}
}
Untitled ActionScript (2-Jul @ 15:13)
Syntax Highlighted Code
- var a = 3
- function foo() {
- return 3
- }
Plain Code
var a = 3
function foo() {
return 3
}
Untitled ActionScript (26-Jun @ 22:02)
Syntax Highlighted Code
- ------
- 2008-06-26T13:59:20 INFO root -- HTTP:localhost:8080 Server started.
- Hostname: localhost
- Port: 8080
- [83 more lines...]
Plain Code
------
2008-06-26T13:59:20 INFO root -- HTTP:localhost:8080 Server started.
Hostname: localhost
Port: 8080
------
2008-06-26T13:59:20 INFO root Startup time: 2.661 sec real, 2.510 sec CPU
------
2008-06-26T13:59:42 ERROR SiteError http://localhost:8080/test/@@index
Traceback (most recent call last):
File "/home/jbernier/buildout-eggs/tmp22Q3Pj/zope.publisher-3.4.2-py2.4.egg/zope/publisher/publish.py", line 133, in publish
File "/usr/lib/python2.4/site-packages/grok-0.13-py2.4.egg/grok/publication.py", line 45, in callObject
return super(ZopePublicationSansProxy, self).callObject(request, ob)
File "/home/jbernier/buildout-eggs/tmpEV0IoP/zope.app.publication-3.4.3-py2.4.egg/zope/app/publication/zopepublication.py", line 167, in callObject
File "/home/jbernier/buildout-eggs/tmp22Q3Pj/zope.publisher-3.4.2-py2.4.egg/zope/publisher/publish.py", line 108, in mapply
- __traceback_info__: <tpi.app.Index object at 0x98f018c>
File "/home/jbernier/buildout-eggs/tmp22Q3Pj/zope.publisher-3.4.2-py2.4.egg/zope/publisher/publish.py", line 114, in debug_call
File "/usr/lib/python2.4/site-packages/grok-0.13-py2.4.egg/grok/components.py", line 172, in __call__
return self._render_template()
File "/usr/lib/python2.4/site-packages/grok-0.13-py2.4.egg/grok/components.py", line 176, in _render_template
return self.template.render(self)
File "/usr/lib/python2.4/site-packages/grok-0.13-py2.4.egg/grok/components.py", line 381, in render
return template.pt_render(namespace)
File "/home/jbernier/buildout-eggs/tmpb4jUSz/zope.pagetemplate-3.4.0-py2.4.egg/zope/pagetemplate/pagetemplate.py", line 115, in pt_render
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 271, in __call__
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 521, in do_optTag
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 516, in no_tag
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 745, in do_insertStructure_tal
File "/home/jbernier/buildout-eggs/tmpYOQsz7/zope.tales-3.4.0-py2.4.egg/zope/tales/tales.py", line 696, in evaluate
- /home/jbernier/Tpi/src/tpi/app_templates/master.pt
- Line 17, Column 3
- Expression: <StringExpr u'navigation'>
- Names:
{'args': (),
'context': <tpi.app.Tpi object at 0x984556c>,
'default': <object object at 0xb7dd6560>,
'loop': {},
'nothing': None,
'options': {},
'repeat': {},
'request': <zc.resourcelibrary.publication.Request instance URL=http://localhost:8080/test/@@index>,
'static': <grok.components.DirectoryResource object at 0x98f01ac>,
'template': <grok.components.TrustedFilePageTemplate object at 0x96493cc>,
'view': <tpi.app.Index object at 0x98f018c>}
File "/home/jbernier/buildout-eggs/tmpw7NO4V/zope.contentprovider-3.4.0-py2.4.egg/zope/contentprovider/tales.py", line 80, in __call__
File "/usr/lib/python2.4/site-packages/grok-0.13-py2.4.egg/grok/components.py", line 726, in render
return u'\n'.join([viewlet.render() for viewlet in self.viewlets])
File "/usr/lib/python2.4/site-packages/grok-0.13-py2.4.egg/grok/components.py", line 763, in render
return self.template.render(self)
File "/usr/lib/python2.4/site-packages/grok-0.13-py2.4.egg/grok/components.py", line 381, in render
return template.pt_render(namespace)
File "/home/jbernier/buildout-eggs/tmpb4jUSz/zope.pagetemplate-3.4.0-py2.4.egg/zope/pagetemplate/pagetemplate.py", line 115, in pt_render
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 271, in __call__
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 408, in do_startTag
File "/home/jbernier/buildout-eggs/tmpM4HpNi/zope.tal-3.4.1-py2.4.egg/zope/tal/talinterpreter.py", line 485, in attrAction_tal
File "/home/jbernier/buildout-eggs/tmpYOQsz7/zope.tales-3.4.0-py2.4.egg/zope/tales/tales.py", line 704, in evaluateText
File "/home/jbernier/buildout-eggs/tmpYOQsz7/zope.tales-3.4.0-py2.4.egg/zope/tales/tales.py", line 696, in evaluate
- /home/jbernier/Tpi/src/tpi/app_templates/navbar.pt
- Line 3, Column 6
- Expression: <PathExpr standard:u'view/__parent__/application_url'>
- Names:
{'args': (),
'context': <tpi.app.Tpi object at 0x984556c>,
'default': <object object at 0xb7dd6560>,
'loop': {},
'nothing': None,
'options': {},
'repeat': {},
'request': <zc.resourcelibrary.publication.Request instance URL=http://localhost:8080/test/@@index>,
'static': <grok.components.DirectoryResource object at 0x98f052c>,
'template': <grok.components.TrustedFilePageTemplate object at 0x97cce0c>,
'view': <tpi.app.Index object at 0x98f018c>,
'viewlet': <tpi.app.Navbar object at 0x98f072c>,
'viewletmanager': <tpi.app.Navigation object at 0x98f048c>}
File "/home/jbernier/buildout-eggs/tmpYOQsz7/zope.tales-3.4.0-py2.4.egg/zope/tales/expressions.py", line 217, in __call__
File "/home/jbernier/buildout-eggs/tmpYOQsz7/zope.tales-3.4.0-py2.4.egg/zope/tales/expressions.py", line 194, in _eval
File "/home/jbernier/buildout-eggs/tmpYOQsz7/zope.tales-3.4.0-py2.4.egg/zope/tales/expressions.py", line 124, in _eval
File "/home/jbernier/buildout-eggs/zope.app.pagetemplate-3.4.0-py2.4.egg/zope/app/pagetemplate/engine.py", line 68, in __call__
request=request)
File "/home/jbernier/buildout-eggs/zope.traversing-3.4.0-py2.4.egg/zope/traversing/adapters.py", line 164, in traversePathElement
return traversable.traverse(nm, further_path)
- __traceback_info__: (<tpi.app.Tpi object at 0x984556c>, 'application_url')
File "/home/jbernier/buildout-eggs/tmpdmXgak/zope.app.container-3.5.3-py2.4-linux-i686.egg/zope/app/container/traversal.py", line 100, in traverse
TraversalError: (<tpi.app.Tpi object at 0x984556c>, 'application_url')
Untitled ActionScript (24-Jun @ 20:01)
Syntax Highlighted Code
- echo 'hello';
Plain Code
echo 'hello';
Untitled ActionScript (22-Jun @ 04:10)
Syntax Highlighted Code
- /*
- Copyright (c) 2005, Fabricio Zuardi
- All rights reserved.
- [511 more lines...]
Plain Code
/*
Copyright (c) 2005, Fabricio Zuardi
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//import Debug.write() utility
import com.interactiveAlchemy.utils.*;
stop();
//autoplay=true
//repeat_playlist = true;
//playlist_size = 3;
//player_title = "customizeable title test"
//song_url = "http://downloads.betterpropaganda.com/music/Imperial_Teen-Ivanka_128.mp3";
//playlist_url = "http://cchits.ning.com/recent/xspf/?xn_auth=no";
//playlist_url = "http://hideout.com.br/shows/radio-test.xspf";
//radio_mode = true;
//song_title = "Imperial Teen - Ivanka";
autoload=true;
//info_button_text = "Add to Cart"
//playlist_url = "http%3A%2F%2Fwebjay%2Eorg%2Fby%2Flucas%5Fgonze%2Flaconic%2Exspf"
//playlist_url= "http://hideout.com.br/tests/hideout2325.xspf"
//constants
DEFAULT_PLAYLIST_URL = "http://hideout.com.br/shows/allshows.xspf";
DEFAULT_WELCOME_MSG = "Hideout XSPF Music Player - by Fabricio Zuardi";
LOADING_PLAYLIST_MSG = "Loading Playlist...";
DEFAULT_LOADED_PLAYLIST_MSG = "- click to start"
DEFAULT_INFOBUTTON_TXT = "Info"
//playlists has priority over songs, if a playlist_url parameter is found the song_url is ignored
//default playlist if none is passed through query string
if(!playlist_url && !js_playlist){
if(!song_url){
playlist_url = DEFAULT_PLAYLIST_URL;
}else{
single_music_playlist = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><playlist version=\"1\" xmlns = \"http://xspf.org/ns/0/\"><trackList>";
single_music_playlist += "<track><location>"+song_url+"</location><annotation>"+song_title+"</annotation></track>"
single_music_playlist += "</trackList></playlist>"
}
}
info_mc._visible=false;
if(!info_button_text){
info_button_text = DEFAULT_INFOBUTTON_TXT;
}
info_mc.display_txt.text = info_button_text;
//variables initialization
playlist_array = [];
track_index = 0;
playlist_mc.track_count = 0;
pause_position = 0;
volume_level = 100;
playlist_xml = new XML();
playlist_xml.ignoreWhite = true;
playlist_xml.onLoad = playlistLoaded;
mysound = new Sound(this);
playlist_listener = new Object();
playlist_list.addEventListener("change", playlist_listener)
//play_btn.onPress = playTrack;
//functions
//xml parser
//var jsonPlaylist;
function jsoNplaylistLoaded(j){
var jList = j;
playlist_title = jList.title;
var tracks_array = [];
for(var i=0;i<jList.tracklist.length;i++){
addTrack(track_obj.label);
}
playlist_array = jList.tracklist;
if(!playlist_size) playlist_size = playlist_array.length;
playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2)
if(autoplay){
loadTrack()
}else{
start_btn_mc.start_btn.onPress = loadTrack;
track_display_mc.display_txt.text = playlist_title+" "+DEFAULT_LOADED_PLAYLIST_MSG;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
}
}
function processResponse(){
Debug.write('processResponse');
Debug.write(this);
/*var tSplit = this.split('<?xml version="1.0" encoding="iso-8859-1"?>')[1];
var profile = new XML(tSplit);
//var songs = profile.playlist.song;
//unsafeWindow.console.log(songs);
var i=0;
var tracks = '';
for each(var song in profile.playlist.song){
tracks += '<track>'+
'<title>'+song.@title+'</title>'+
'<creator>'+profile.name+'</creator>'+
'<location>'+song.@durl+'</location>'+
'<image>'+song.@imagename+'</image>'+
'<info></info>'+
'<identifier>'+i+'</identifier>'+
'</track>';
i++;
}
Debug.write(tracks);*/
}
function playlistLoaded (success){
if(success){
var root_node = this.firstChild;
Debug.write('root_node '+root_node);
for(var node = root_node.firstChild; node != null; node = node.nextSibling){
if(node.nodeName == "title"){
playlist_title = node.firstChild.nodeValue;
}
if(node.nodeName == "trackList"){
//tracks
var tracks_array = [];
for(var track_node = node.firstChild; track_node != null; track_node = track_node.nextSibling){
var track_obj = new Object()
//track attributes
for(var track_child = track_node.firstChild; track_child != null; track_child = track_child.nextSibling){
if(track_child.nodeName=="location"){
track_obj.location = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="image"){
track_obj.image = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="title"){
track_obj.title = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="creator"){
track_obj.creator = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="annotation"){
track_obj.annotation = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="info"){
track_obj.info = track_child.firstChild.nodeValue
}
}
track_obj.label = (tracks_array.length+1) +". ";
if(track_obj.title) {
if(track_obj.creator) {
track_obj.label += track_obj.creator+' - ';
}
track_obj.label += track_obj.title;
} else {
track_obj.label += track_obj.annotation;
}
tracks_array.push(track_obj)
addTrack(track_obj.label);
}
}
}
playlist_array = tracks_array;
if(!playlist_size) playlist_size = playlist_array.length;
playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2)
if(autoplay){
loadTrack()
}else{
start_btn_mc.start_btn.onPress = loadTrack;
track_display_mc.display_txt.text = playlist_title+" "+DEFAULT_LOADED_PLAYLIST_MSG;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
}
}else{
annotation_txt.text = "Error opening "+playlist_url;
}
}
playlist_listener.change = function(eventObject){
annotation_txt.text = playlist_list.selectedItem.annotation;
location_txt.text = playlist_list.selectedItem.location;
}
function loadTrack(){
//Radio Mode feature by nosferathoo, more info in: https://sourceforge.net/tracker/index.php?func=detail&aid=1341940&group_id=128363&atid=711474
if (radio_mode && track_index==playlist_size-1) {
playlist_url=playlist_array[track_index].location;
for (i=0;i<playlist_mc.track_count;++i) {
removeMovieClip(playlist_mc.tracks_mc["track_"+i+"_mc"]);
}
playlist_mc.track_count=0;
playlist_size=0;
track_index=0;
autoload=true;
autoplay=true;
loadPlaylist();
return(0);
}
start_btn_mc.start_btn._visible = false;
track_display_mc.display_txt.text = playlist_array[track_index].label;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
cover_mc.content_mc["photo"+last_track_index].removeMovieClip();
mysound.loadSound(playlist_array[track_index].location,true);
play_mc.gotoAndStop(2)
//image from playlist
if(playlist_array[track_index].image!=undefined){
cover_mc.content_mc.createEmptyMovieClip("photo"+track_index,track_index)
cover_mc.content_mc["photo"+track_index].loadMovie(playlist_array[track_index].image)
}else{
}
//info button
if(playlist_array[track_index].info!=undefined){
info_mc._visible = true;
info_mc.info_btn.onPress = function(){
getURL(playlist_array[track_index].info,"_blank")
}
}else{
info_mc._visible = false;
}
_root.onEnterFrame=function(){
//HACK doesnt need to set the volume at every enterframe
mysound.setVolume(this.volume_level)
var sound_load_percent = (mysound.getBytesLoaded()/mysound.getBytesTotal())*100
track_display_mc.loader_mc.load_bar_mc._xscale = sound_load_percent;
var image_load_percent = (cover_mc.content_mc["photo"+track_index].getBytesLoaded()/cover_mc.content_mc["photo"+track_index].getBytesTotal())*100
cover_mc.load_bar_mc._xscale = image_load_percent;
if((cover_mc.content_mc["photo"+track_index].getBytesLoaded()>4)&&(image_load_percent==100)){
//image loaded
//make image fit
cover_mc.content_mc["photo"+track_index]._width = cover_mc.load_bar_mc._width
cover_mc.content_mc["photo"+track_index]._height = cover_mc.load_bar_mc._height
}
}
}
stop_btn.onRelease = stopTrack;
play_mc.play_btn.onRelease = playTrack
next_btn.onRelease = nextTrack
prev_btn.onRelease = prevTrack
mysound.onSoundComplete = nextTrack;
volume_mc.volume_btn.onPress = volumeChange;
volume_mc.volume_btn.onRelease = volume_mc.volume_btn.onReleaseOutside = function(){
this._parent.onMouseMove = this._parent.onMouseDown = null;
}
function volumeChange(){
this._parent.onMouseMove = this._parent.onMouseDown = function(){
var percent = (this._xmouse/this._width)*100
if(percent>100)percent=100;
if(percent<0)percent=0;
this.volume_bar_mc._xscale = percent
this._parent.volume_level = percent;
mysound.setVolume(percent)
}
}
function stopTrack() {
mysound.stop();
play_mc.gotoAndStop(1)
mysound.stop();
mysound.start();
mysound.stop();
_root.pause_position = 0;
};
function playTrack() {
if(play_mc._currentframe==1){ //play
seekTrack(_root.pause_position)
play_mc.gotoAndStop(2)
}else if(play_mc._currentframe==2){
_root.pause_position = mysound.position;
mysound.stop();
play_mc.gotoAndStop(1)
}
};
function seekTrack(p_offset:Number){
mysound.stop()
mysound.start(int((p_offset)/1000),1)
}
function nextTrack(){
if(track_index<playlist_size-1){
last_track_index = track_index;
track_index ++;
loadTrack();
}else{
if(repeat_playlist){
last_track_index = track_index;
track_index = 0;
loadTrack()
}
}
playlist_mc.tracks_mc["track_"+last_track_index+"_mc"].bg_mc.gotoAndStop(1)
playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2)
}
function prevTrack(){
if(track_index>0){
last_track_index = track_index;
track_index --;
loadTrack();
}
playlist_mc.tracks_mc["track_"+last_track_index+"_mc"].bg_mc.gotoAndStop(1)
playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2)
}
function scrollTitle(){
track_display_mc.display_txt._x -= 5;
if (track_display_mc.display_txt._x+track_display_mc.display_txt._width<0){
track_display_mc.display_txt._x = track_display_mc.mask_mc._width;
}
}
function resizeUI(){
bg_mc._width = Stage.width;
track_display_mc.loader_mc._width = Stage.width - track_display_mc._x - 2;
track_display_mc.mask_mc._width = track_display_mc.loader_mc._width-3;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
volume_mc._x = Stage.width - 22;
start_btn_mc._xscale = Stage.width;
//playlist area tinnier that the album cover
if(Stage.width<2.5*cover_mc._width){
//
if (Stage.height>2.5*cover_mc._height){
//send album cover to bottom
cover_mc._y = Stage.height - cover_mc._height -2- info_mc._height -2;
info_mc._y = Stage.height - info_mc._height -2;
var covervisible =1;
}else{
var covervisible =0;
//hide album cover
cover_mc._y = Stage.height;
}
//send playlist to left
playlist_mc._x = cover_mc._x;
scrollbar_mc.bg_mc._height = Stage.height - (19+(cover_mc._height+info_mc._height+4)*covervisible);
playlist_mc.bg_mc._height = Stage.height - (19+(cover_mc._height+info_mc._height+4)*covervisible);
playlist_mc.mask_mc._height = Stage.height - (23+(cover_mc._height+info_mc._height+4)*covervisible);
}else{
cover_mc._y = 17;
info_mc._y = 153;
playlist_mc._x = 138;
scrollbar_mc.bg_mc._height = Stage.height -19;
playlist_mc.bg_mc._height = Stage.height - 19;
playlist_mc.mask_mc._height = Stage.height - 23;
}
scrollbar_mc._x = Stage.width - 12;
playlist_mc.mask_mc._width = Stage.width - (playlist_mc._x + 19);
playlist_mc.bg_mc._width = Stage.width - (playlist_mc._x + 14);
}
function addTrack(track_label){
if(playlist_mc.track_count>0) {
playlist_mc.tracks_mc.track_0_mc.duplicateMovieClip("track_"+playlist_mc.track_count+"_mc",playlist_mc.track_count);
}
playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"]._y += playlist_mc.track_count*14;
playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"].display_txt.autoSize = "left";
playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"].display_txt.text = track_label;
playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"].bg_mc.index = playlist_mc.track_count;
playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"].bg_mc.select_btn.onPress = function(){
last_track_index = track_index;
playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(1)
track_index = this._parent.index;
playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2)
loadTrack();
}
playlist_mc.track_count ++;
}
//scroll
scrollbar_mc.up_btn.onPress = function(){
this._parent.v = -1;
this._parent.onEnterFrame = scrollTracks;
}
scrollbar_mc.down_btn.onPress = function(){
this._parent.v = 1;
this._parent.onEnterFrame = scrollTracks;
}
scrollbar_mc.up_btn.onRelease = scrollbar_mc.down_btn.onRelease = function(){
this._parent.onEnterFrame = null;
}
scrollbar_mc.handler_mc.drag_btn.onPress = function(){
var scroll_top_limit = 19;
var scroll_bottom_limit = scrollbar_mc.bg_mc._height - scrollbar_mc.handler_mc._height - 2;
this._parent.startDrag(false,this._parent._x,scroll_top_limit,this._parent._x,scroll_bottom_limit)
this._parent.isdragging = true;
this._parent.onEnterFrame = scrollTracks;
}
scrollbar_mc.handler_mc.drag_btn.onRelease = scrollbar_mc.handler_mc.drag_btn.onReleaseOutside = function(){
stopDrag()
this._parent.isdragging = false;
this._parent.onEnterFrame = null;
}
function scrollTracks(){
var scroll_top_limit = 19;
var scroll_bottom_limit = scrollbar_mc.bg_mc._height - scrollbar_mc.handler_mc._height - 2;
var list_bottom_limit = 1;
var list_top_limit = (1-Math.round(playlist_mc.tracks_mc._height))+Math.floor(playlist_mc.mask_mc._height/14)*14
if(playlist_mc.tracks_mc._height>playlist_mc.mask_mc._height){
if(scrollbar_mc.handler_mc.isdragging){
var percent = (scrollbar_mc.handler_mc._y-scroll_top_limit)/(scroll_bottom_limit-scroll_top_limit)
playlist_mc.tracks_mc._y = (list_top_limit-list_bottom_limit)*percent+list_bottom_limit;
}else{
if(scrollbar_mc.v==-1){
if(playlist_mc.tracks_mc._y+14<list_bottom_limit){
playlist_mc.tracks_mc._y += 14;
}else{
playlist_mc.tracks_mc._y = list_bottom_limit;
}
var percent = (playlist_mc.tracks_mc._y-1)/(list_top_limit-1)
scrollbar_mc.handler_mc._y = percent*(scroll_bottom_limit - scroll_top_limit)+scroll_top_limit;
}else if(scrollbar_mc.v==1){
if(playlist_mc.tracks_mc._y-14>list_top_limit){
playlist_mc.tracks_mc._y -= 14;
}else{
playlist_mc.tracks_mc._y = list_top_limit;
}
var percent = (playlist_mc.tracks_mc._y-1)/(list_top_limit-1)
scrollbar_mc.handler_mc._y = percent*(scroll_bottom_limit - scroll_top_limit)+scroll_top_limit;
}
}
}
}
function loadPlaylist(){
track_display_mc.display_txt.text = LOADING_PLAYLIST_MSG;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
//playlist
if(playlist_url){
if(js_playlist){
Debug.write('here');
playlist_xml.parseXML(unescape(playlist_url))
playlist_xml.onLoad(true);
}
else{
playlist_xml.load(unescape(playlist_url))
}
}else{
//single track
playlist_xml.parseXML(single_music_playlist)
playlist_xml.onLoad(true);
}
}
//first click - load playlist
start_btn_mc.start_btn.onPress = function(){
autoplay = true;
loadPlaylist();
}
//main
Stage.scaleMode = "noScale"
Stage.align = "LT";
this.onResize = resizeUI;
Stage.addListener(this);
if(!player_title) player_title = DEFAULT_WELCOME_MSG;
track_display_mc.display_txt.autoSize = "left";
track_display_mc.display_txt.text = player_title;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
//start to play automatically if parameter autoplay is present
if(autoplay){
start_btn_mc.start_btn.onPress();
} else if (autoload){
loadPlaylist()
}
//customized menu
var my_cm:ContextMenu = new ContextMenu();
my_cm.customItems.push(new ContextMenuItem("Stop", stopTrack));
my_cm.customItems.push(new ContextMenuItem("Play!", playTrack));
my_cm.customItems.push(new ContextMenuItem("Next", nextTrack));
my_cm.customItems.push(new ContextMenuItem("Previous", prevTrack));
my_cm.customItems.push(new ContextMenuItem("Download this song", function(){getURL(playlist_array[track_index].location,"_blank")},true));
my_cm.customItems.push(new ContextMenuItem("Add song to Webjay playlist", function(){getURL("http://webjay.org/poster?media="+escape(playlist_array[track_index].location),"_blank")}));
my_cm.customItems.push(new ContextMenuItem("About Hideout", function(){getURL("http://www.hideout.com.br","_blank")},true));
//my_cm.customItems.push(new ContextMenuItem("Crossfade", function(){}));
//my_cm.customItems.push(new ContextMenuItem("Mando Diao - Paralyzed", function(){}));
my_cm.hideBuiltInItems();
this.menu = my_cm;
resizeUI();
Untitled ActionScript (22-Jun @ 01:10)
Syntax Highlighted Code
- /*
- Copyright (c) 2005, Fabricio Zuardi
- All rights reserved.
- [486 more lines...]
Plain Code
/*
Copyright (c) 2005, Fabricio Zuardi
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//import Debug.write() utility
import com.interactiveAlchemy.utils.*;
stop();
//autoplay=true
//repeat_playlist = true;
//playlist_size = 3;
//player_title = "customizeable title test"
//song_url = "http://downloads.betterpropaganda.com/music/Imperial_Teen-Ivanka_128.mp3";
//playlist_url = "http://cchits.ning.com/recent/xspf/?xn_auth=no";
//playlist_url = "http://hideout.com.br/shows/radio-test.xspf";
//radio_mode = true;
//song_title = "Imperial Teen - Ivanka";
autoload=true;
//info_button_text = "Add to Cart"
//playlist_url = "http%3A%2F%2Fwebjay%2Eorg%2Fby%2Flucas%5Fgonze%2Flaconic%2Exspf"
//playlist_url= "http://hideout.com.br/tests/hideout2325.xspf"
//constants
DEFAULT_PLAYLIST_URL = "http://hideout.com.br/shows/allshows.xspf";
DEFAULT_WELCOME_MSG = "Hideout XSPF Music Player - by Fabricio Zuardi";
LOADING_PLAYLIST_MSG = "Loading Playlist...";
DEFAULT_LOADED_PLAYLIST_MSG = "- click to start"
DEFAULT_INFOBUTTON_TXT = "Info"
//playlists has priority over songs, if a playlist_url parameter is found the song_url is ignored
//default playlist if none is passed through query string
if(!playlist_url && !js_playlist){
if(!song_url){
playlist_url = DEFAULT_PLAYLIST_URL;
}else{
single_music_playlist = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><playlist version=\"1\" xmlns = \"http://xspf.org/ns/0/\"><trackList>";
single_music_playlist += "<track><location>"+song_url+"</location><annotation>"+song_title+"</annotation></track>"
single_music_playlist += "</trackList></playlist>"
}
}
info_mc._visible=false;
if(!info_button_text){
info_button_text = DEFAULT_INFOBUTTON_TXT;
}
info_mc.display_txt.text = info_button_text;
//variables initialization
playlist_array = [];
track_index = 0;
playlist_mc.track_count = 0;
pause_position = 0;
volume_level = 100;
playlist_xml = new XML();
playlist_xml.ignoreWhite = true;
playlist_xml.onLoad = playlistLoaded;
mysound = new Sound(this);
playlist_listener = new Object();
playlist_list.addEventListener("change", playlist_listener)
//play_btn.onPress = playTrack;
//functions
//xml parser
//var jsonPlaylist;
function jsoNplaylistLoaded(j){
var jList = j;
playlist_title = jList.title;
var tracks_array = [];
for(var i=0;i<jList.tracklist.length;i++){
addTrack(track_obj.label);
}
playlist_array = jList.tracklist;
if(!playlist_size) playlist_size = playlist_array.length;
playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2)
if(autoplay){
loadTrack()
}else{
start_btn_mc.start_btn.onPress = loadTrack;
track_display_mc.display_txt.text = playlist_title+" "+DEFAULT_LOADED_PLAYLIST_MSG;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
}
}
function playlistLoaded (success){
if(success){
var root_node = this.firstChild;
for(var node = root_node.firstChild; node != null; node = node.nextSibling){
if(node.nodeName == "title"){
playlist_title = node.firstChild.nodeValue;
}
if(node.nodeName == "trackList"){
//tracks
var tracks_array = [];
for(var track_node = node.firstChild; track_node != null; track_node = track_node.nextSibling){
var track_obj = new Object()
//track attributes
for(var track_child = track_node.firstChild; track_child != null; track_child = track_child.nextSibling){
if(track_child.nodeName=="location"){
track_obj.location = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="image"){
track_obj.image = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="title"){
track_obj.title = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="creator"){
track_obj.creator = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="annotation"){
track_obj.annotation = track_child.firstChild.nodeValue
}
if(track_child.nodeName=="info"){
track_obj.info = track_child.firstChild.nodeValue
}
}
track_obj.label = (tracks_array.length+1) +". ";
if(track_obj.title) {
if(track_obj.creator) {
track_obj.label += track_obj.creator+' - ';
}
track_obj.label += track_obj.title;
} else {
track_obj.label += track_obj.annotation;
}
tracks_array.push(track_obj)
addTrack(track_obj.label);
}
}
}
playlist_array = tracks_array;
if(!playlist_size) playlist_size = playlist_array.length;
playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2)
if(autoplay){
loadTrack()
}else{
start_btn_mc.start_btn.onPress = loadTrack;
track_display_mc.display_txt.text = playlist_title+" "+DEFAULT_LOADED_PLAYLIST_MSG;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
}
}else{
annotation_txt.text = "Error opening "+playlist_url;
}
}
playlist_listener.change = function(eventObject){
annotation_txt.text = playlist_list.selectedItem.annotation;
location_txt.text = playlist_list.selectedItem.location;
}
function loadTrack(){
//Radio Mode feature by nosferathoo, more info in: https://sourceforge.net/tracker/index.php?func=detail&aid=1341940&group_id=128363&atid=711474
if (radio_mode && track_index==playlist_size-1) {
playlist_url=playlist_array[track_index].location;
for (i=0;i<playlist_mc.track_count;++i) {
removeMovieClip(playlist_mc.tracks_mc["track_"+i+"_mc"]);
}
playlist_mc.track_count=0;
playlist_size=0;
track_index=0;
autoload=true;
autoplay=true;
loadPlaylist();
return(0);
}
start_btn_mc.start_btn._visible = false;
track_display_mc.display_txt.text = playlist_array[track_index].label;
if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){
track_display_mc.onEnterFrame = scrollTitle;
}else{
track_display_mc.onEnterFrame = null;
track_display_mc.display_txt._x = 0;
}
cover_mc.content_mc["photo"+last_track_index].removeMovieClip();
mysound.loadSound(playlist_array[track_index].location,true);
play_mc.gotoAndStop(2)
//image from playlist
if(playlist_array[track_index].image!=undefined){
cover_mc.content_mc.createEmptyMovieClip("photo"+track_index,track_index)
cover_mc.content_mc["photo"+track_index].loadMovie(playlist_array[track_index].image)
}else{
}
//info button
if(playlist_array[track_index].info!=undefined){
info_mc._visible = true;
info_mc.info_btn.onPress = function(){
getURL(playlist_array[track_index].info,"_blank")
}
}else{
info_mc._visible = false;
}
_root.onEnterFrame=function(){
//HACK doesnt need to set the volume at every enterframe
mysound.setVolume(this.volume_level)
var sound_load_percent = (mysound.getBytesLoaded()/mysound.getBytesTotal())*100
track_display_mc.loader_mc.load_bar_mc._xscale = sound_load_percent;
var image_load_percent = (cover_mc.content_mc["photo"+track_index].getBytesLoaded()/cover_mc.content_mc["photo"+track_index].getBytesTotal())*100
cover_mc.load_bar_mc._xscale = image_load_percent;
if((cover_mc.content_mc["photo"+track_index].getBytesLoaded()>4)&&(image_load_percent==100)){
//image loaded
//make image fit
cover_mc.content_mc["photo"+track_index]._width = cover_mc.load_bar_mc._width
cover_mc.content_mc["photo"+track_index]._height = cover_mc.load_bar_mc._height
}
}
}
stop_btn.onRelease = stopTrack;
play_mc.play_btn.onRelease = playTrack
next_btn.onRelease = nextTrack
prev_btn.onRelease = prevTrack
mysound.onSoundComplete = nextTrack;
volume_mc.volume_btn.onPress = volumeChange;
volume_mc.volume_btn.onRelease = volume_mc.volume_btn.onReleaseOutside = function(){
this._parent.onMouseMove = this._parent.onMouseDown = null;
}
function volumeChange(){
this._parent.onMouseMove = this._parent.onMouseDown = function(){
var percent = (this._xmouse/this._width)*100
if(percent>100)percent=100;
if(percent<0)percent=0;
this.volume_bar_mc._xscale = percent
this._parent.volume_level = percent;
mysound.setVolume(percent)
}
}
function stopTrack() {
mysound.stop();
play_mc.gotoAndStop(1)
mysound.stop();
mysound.start();
mysound.stop();
_root.pause_position = 0;
};
function playTrack() {
if(play_mc._currentframe==1){ //play
seekTrack(_root.pause_position)
play_mc.gotoAndStop(2)
}else if(play_mc._currentframe==2){
_root.pause_position = mysound.position;
mysound.stop();
play_mc.gotoAndStop(1)
}
};
function seekTrack(p_offset:Number){
mysound.stop()
mysound.start(int((p_offset)/1000),1)
}
function nextTrack(){
if(track_index<playlist_size-1){
last_track_index = track_index;
track_index ++;
loadTrack();
}else{
if(repeat_playlist){
last_track_index = track_index;