Need an WordPress Theme for mobiles? Visit SMOOCI.COM
Smooci is a WordPress theme for mobile phones and devices. Use this WordPress plugin to display the theme when your WordPress site is visited on mobiles
Need an WordPress Theme for mobiles? Visit SMOOCI.COM
Smooci is a WordPress theme for mobile phones and devices. Use this WordPress plugin to display the theme when your WordPress site is visited on mobiles
Need an WordPress Theme for mobiles? Visit SMOOCI.COM
Smooci (WordPress on Mobiles) plugin can be used to display a diferent theme when your WordPress site is visited on mobile phones or devices.
The plugin detects the mobile device and displays the theme of your choice. If you encounter a mobile phone or device that doesn’t display the selected theme, please leave a comment to this post.

Here is a way you can call a server side script with AJAX, using POST method.
JavaScript code:
// declare a global variable var xmlHttpVariable // http request object function GetXmlHttpObject() { var xmlHttp = null; try {xmlHttp = new XMLHttpRequest();} catch (e) { try {xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");} } return xmlHttp; } function callServer() { // call http request object xmlHttpVariable = new GetXmlHttpObject(); // set the url to the server-side script var url = "url"; // set the variables var variables = "var1=val1&var2=val2"; // call a function on state change xmlHttpVariable.onreadystatechange = stateChangedVariable; // open the url xmlHttpVariable.open("POST",url,true); // send the proper header information along with the request xmlHttpVariable.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttpVariable.setRequestHeader("Content-length", variables.length); xmlHttpVariable.setRequestHeader("Connection", "close"); // send the variables xmlHttpVariable.send(variables); } function stateChangedVariable() { // values for readyState see below for explanations if (xmlHttpVariable.readyState == 4) { if (xmlHttpVariable.responseText.replace(/^\s+|\s+$/g, '') == 'return value') { //action here } } }
readyState values:
0 – Represents an “uninitialized” state in which an XMLHttt pRequesobject has been created, but not initialized.
1 – Represents a “sent” state in which code has called the XMLHttpRequest open() method and the XMLHttpRequest is ready to send a request to the server.
2 – Represents a “sent” state in which a request has been sent to the server with the send() method, but a response has not yet been received.
3 – Represents a “receiving” state in which the HTTP response headers have been received, but message body has not yet been completely received.
4 – Represents a “loaded” state in which the response has been completely received.
After several tests and favorable comments, I can officialy launch DOP Player Wordpress Plugin 1.0.
Dop Player is intended for users that want an easy to use player to integrate in their blog.
Dop Player can be easily customized from an admin panel to match your template’s colors.
Warning
You have to copy the content from dop-player folder from the zip file. If you don’t you will see only a space where the player should be.
You have in the zip file:
- ZIP/dop-player/dop-player.php
- ZIP/dop-player/dop-player/dop-player-admin.php
- ZIP/dop-player/dop-player/dop-player.swf
In your plugin forlder you should have:
- WWW/wp-content/plugins/dop-player.php
- WWW/wp-content/plugins/dop-player/dop-player-admin.php
- WWW/wp-content/plugins/dop-player/dop-player.swf
You can download it from:
http://dop-p.com/wordpress/
http://wordpress.org/extend/plugins/dop-player/
An example
Here is an example that illustrate how you can upload an image or a swf in your Flash ActionScript 3.0 project .
ActionScript 3.0 code:
// create the MovieClip that will hold the object loaded var _mc:MovieClip = new MovieClip(); addChild(_mc); // create the URLRequest with the path to the object you want to load var request:URLRequest = new URLRequest("image.jpg"); var loader = new Loader(); // create the Loader object loader.load(request); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); // call this function when the object is loading function onLoadProgress(event:ProgressEvent):void { // display the percentage loaded trace(int(event.bytesLoaded/event.bytesTotal*100)+"%"); // display the bytes loaded and the total number of bytes trace(event.bytesLoaded+":"+event.bytesTotal); } // call this function when the object is loaded function onLoadComplete(event:Event):void { // duplicate and resize a loaded image (doesn't work for swf) // -----> var objectDuplicate:Bitmap = new Bitmap(loader.content.bitmapData.clone()); objectDuplicate.width = 100; objectDuplicate.height = 100; objectDuplicate.smoothing = true; _mc.addChild(objectDuplicate); // -----> _mc.addChild(loader); // attach object to MovieClip } // call this function if the path to the object that you want to load is not valid function onLoadError(event:Event):void { trace("Error! The URL was not found."); }
This is very useful when you try to create a “liquid” flash application.
ActionScript 3.0 code:
//The next 2 lines are not mandatory. //Use them if you whant to keep the original sizes. stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; // Other values: //TOP, BOTTOM, LEFT, RIGHT, TOP_RIGHT // BOTTOM_LEFT, BOTTOM_RIGHT stage.addEventListener(Event.RESIZE, resizeHandler); function resizeHandler(event:Event):void { trace(stage.stageWidth); trace(stage.stageHeight); trace("An event has been triggered."); }
Here is an example on how to get data from XML file using ActionScript 3.0.
XML file example:
<?xml version="1.0" encoding="utf-8"?> <Data> <Title font="Arial"> XML Example </Title> <HTML_Example> <![CDATA[You can add html text here.]]> </HTML_Example> <List> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> <URL>http://www.mariuscristiandonea.com</URL> </List> </Data>
ActionScript 3.0 code:
var XMLLoader:URLLoader; var XMLPath:URLRequest; var XMLDoc:XMLDocument = new XMLDocument(); XMLDoc.ignoreWhite = true; XMLPath = new URLRequest("test.xml"); XMLLoader = new URLLoader(XMLPath); // Call extractXMLFileData function if the XML file does load. XMLLoader.addEventListener("complete", extractXMLFileData); // Call errorXMLFileData function if the XML file didn't load. XMLLoader.addEventListener("ioError", errorXMLFileData); // This function parse the data from the XML file, if it is loaded. function extractXMLFileData(event:Event):void { var XMLData:XML = XML(XMLLoader.data); XMLDoc.parseXML(XMLData.toXMLString()); // Define the first node. var DataNode:XMLNode = XMLDoc.firstChild; // Read a node attribute. trace(DataNode.firstChild.attributes.font); // Read a node value. trace(DataNode.firstChild.firstChild.nodeValue); // Here we read the node value that contains the HTML text. trace(DataNode.childNodes[1].firstChild.nodeValue); // In the next "for" we read all the URL nodes. for (var currentNode = DataNode.childNodes[2].firstChild; currentNode != null; currentNode=currentNode.nextSibling) { // If the name of the node is "URL" then we read the value from it. if (currentNode.nodeName == "URL") { trace(currentNode.firstChild.nodeValue); } } } // This function takes action if the XML file didn't load. function errorXMLFileData(event:Event):void { trace("Error! The XML file didn't load!"); }
This is a function that changes the color of a video given as a parameter in a new color given as parameter as well.
ActionScript 3.0 code:
import flash.geom.ColorTransform; // import ColorTransform class function setColor(_mc:MovieClip, color):void { var newColor:ColorTransform = _mc.transform.colorTransform; newColor.color = color; _mc.transform.colorTransform = newColor; } setColor(bigBtn.icon.bg, 0xff0000); //call the function