 |
Featured jobs
Featured template
View more templates
 |
 |


Next 5
Add to my sidebar for Netscape 6
 |
 |
//Netscape 6 supports an addPanel method:
//It is not a bookmark but a sidebar entry.
<script language="JavaScript">
<!--
function addToSidebar() {
if (window.sidebar && window.sidebar.addPanel)
{
window.sidebar.addPanel("yoursite.com","http://www.yoursite.com/ns6sidebar.html","");
} else {
alert("Your browser do not support this feature.")
}
}
//-->
</script>
//In Flash, you can use a getURL action to call the JavaScript function.
on (release) {
javascript:addToSidebar();
}
//In your ns6sidebar.html (the sidebar file is a regular html file) you have add target="_content" to your links:
//i.e.
<a href="index.html" target="_content">Index</a>
<br><a href="news.html" target="_content">News</a>
//So that they load in the main browser window.
Posted by: No name | website
http://
|
 |
 |
 |
Anchor
 |
 |
getURL ("myPage.htm?#bottom");
//Or on a button:
on (release) {
getURL ("myPage.htm?#bottom");
}
Posted by: Evgueni Strok | website
http://www.actionscript.org
|
 |
 |
 |
Close HTML page
 |
 |
on (release) {
getURL ("javascript:window.close()");
}
or
on (release) {
getURL ("javascript:self.close()");
}
Posted by: Evgueni Strok | website
http://
|
 |
 |
 |
Communication between swf Player
 |
 |
/* =================
* Class constructor
* =================
* Desc: Creates the localStorage object.
* Retrieves a local shared object (this.so) and initializes it .
* =================
* Created by ashim saha.
* contact : s_ashim@hotmail.com
*/
// open a new flash file
// Action for 1st frame
function localStorage () {
// Get a reference to the local shared object.
this.so = SharedObject.getLocal("sharedObject");
// If there's no myvalue container property yet, make one.
if (typeof this.so.data.myvalue == "undefined") {
this.so.data.myvalue = "null";
}
}
ls = new localStorage();
//Creating connection Object
sendingLC = new LocalConnection();
update_so.text = "Write text...";
btn.onPress = function(){
txt = update_so.text;
// Code in the sending movie
sendingLC.send("lc_name", "methodToExecute",txt)
ls.so.data.myvalue = txt;
update_so.text = "";
updateAfterEvent();
}
// Action for 2nd frame
//Retrieves any previous value if stored or updates if new value is registered.
output1.text = ls.so.data.myvalue;
// Action for 3rd frame
_root.gotoAndPlay(2);
//save file and open another new file
// Action for 1st frame
receivingLC = new LocalConnection();
// Action for 2nd frame
receivingLC.connect("lc_name");
receivingLC.methodToExecute = function(txt) {
output2.text = txt;
}
// Action for 3rd frame
_root.gotoAndPlay(2);
//download resource for better understanding ....hope it works all fine.
Posted by: Ashim Saha | website
http://www.irc.co.in
|
 |
 |
 |
Configuration
 |
 |
import mx.events.EventDispatcher;
class com.shift12.util.Configuration {
private var configData:XML;
private var status:String;
public var addEventListener:Function;
public var removeEventListener:Function;
public var dispatchEvent:Function;
public function Configuration(configFile:String) {
EventDispatcher.initialize(this);
loadConfigData(configFile);
}
private function loadConfigData(configFile:String):Void {
var ptr:Object = this;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function(success:Boolean) {
if(success) {
ptr.configData = new XML();
ptr.configData = this;
ptr.parseData();
} else {
throw new Error("Could not load configuration settings. File: " + configFile);
}
};
xml.load(configFile);
}
private function parseData():Void {
var type:String;
var data:String;
var name:String;
var numItems:Number = configData.childNodes[0].childNodes.length;
for(var i=0;i<numItems;i++) {
var cNode:XMLNode = configData.childNodes[0].childNodes[i];
type = cNode.childNodes[0].childNodes[0].nodeValue;
name = cNode.childNodes[1].childNodes[0].nodeValue;
if(type.toLowerCase() != "array") {
data = cNode.childNodes[2].childNodes[0].nodeValue;
addItem(type, data, name);
} else {
data = cNode.childNodes[2];
addItem(type, data, name);
}
}
this.dispatchEvent({type:"onLoad"});
cleanUp();
}
private function addItem(type:String, data:String, name:String):Void {
switch(type.toLowerCase()) {
case "string":
this[name] = makeString(data);
break;
case "boolean":
this[name] = makeBoolean(data);
break;
case "number":
this[name] = makeNumber(data);
break;
case "array":
this[name] = makeArray(data);
break;
default:
this[name] = makeString(data);
break;
}
}
private function makeString(data:String):String {
return String(data);
}
private function makeBoolean(data:String):Boolean {
return Boolean(data);
}
private function makeNumber(data:String):Number {
return Number(data);
}
private function makeArray(data:String):Array {
var xml:XML = new XML(data);
var type:String;
var value:String;
var node:XMLNode;
var buffer:Array = new Array();
for(var i=0;i<xml.childNodes[0].childNodes.length;i++) {
node = xml.childNodes[0].childNodes[i];
type = node.childNodes[0].childNodes[0].nodeValue;
value = node.childNodes[1].childNodes[0].nodeValue;
switch(type.toLowerCase()) {
case "string":
buffer.push(makeString(value));
break;
case "number":
buffer.push(makeNumber(value));
break;
case "boolean":
buffer.push(makeBoolean(value));
break;
default:
buffer.push(makeString(value));
break;
}
}
return buffer;
}
private function cleanUp():Void {
delete configData;
}
}
Posted by: Joshua Hansen | website
http://www.bitset.org
|
 |
 |
 |
Next
5
|  |
Search Entire Site
Advertisements
Latest New Articles
- Set up a simple IIS Server for Flash
by Peter McBride - Day 1 at FITC Toronto 2008
by Anthony Pace - Simple reflection effect with AS2
by Jean André Mas - ActionScript.org Meets Josh Tynjala (aka dr_zeus)
by ActionScript.org Staff - Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware
by Sabrina F
|
 |