Trying to get variables into flash from the browser!

Ever wondered how to get variables from an html page to a flash element? Well, it’s quite easy using the following actionscript 2 example: I use javascript to embed my flash elements: _ <embed src="somefilename.swf?varname=varvalue&vartwo=var2value" width="550" height="400"></embed>_ Now in Flash I can just call: 1 2 _root.varname and it will give us `varvalue` _root.vartwo will give us `var2value` Wasn’t that easy?

Flash Tweening

tween is an actionscript class and can be used after importing the core files. 1 2 3 import mx.transitions.Tween; import mx.transitions.easing.*; //Tween( obj:Object, prop:String, func:Function, begin:Number, finish:Number, duration:Number, useSeconds:Boolean); e.g. 1 var myRot:Tween = new Tween(myText, "_rotation", Elastic.easeOut, 0, 360, 3, true);

Cube Desktop on Ubuntu

Alright, so I run Ubuntu 7.10 and use the Desktop Effects via compviz, anyhow, I could get the 2d workspace but really wanted the 3d cube, even if I set up 4 desktops, it would still only show 2 sides of the cube(aka not a cube). The solution is: In Terminal do: gconftool-2 --type int --set /apps/compiz/general/screen0/options/hsize 4 😉

Animate with Actionscript [part1]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 // Created by Andrew Odendaal // // :: DESCRIPTION :: // Animate a ball moving to the top // of the screen/stage and back again // // :: HOW TO USE :: // create a circle shape, convert to a movieclip(mc) and // place the registration point at the bottom center.

To Install IIS 7.0 on Windows Vista – script

1 start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-BasicAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI

Kill Adobe Updater

So adobe updater keeps doing updates eventhough you’ve said ‘NEVER DO IT AGAIN!!!’. The fix is to physically remove the dir with the info in. On a windows system go to ‘c:\program files\common files\adobe&#8217;, there is a nasty little folder called UPDATER5 in there that you can DELETE! PROBLEM SOLVED 😉

Apache Cannot be Run. Another web server is using the web port or port is blocked by firewall.

Tried to start EasyPHP: “Apache Cannot be Run. Another web server is using the web port or port is blocked by firewall.” I was running Skype! And it was blocking the using the port. Check in options->advanced->connection for the setting on port 80. Another way to stop this from happening and solve the problem quicker is to go into the “Configuration->EasyPHP” [Ctrl+E] and make sure that the “Check server’s TCP port before starting” checkbox is not checked.

How to load xml into flash using actionscript 2

Create an xml object: 1 var myXmlObject = new XML(); Perform action when xml file has been loaded: 1 2 3 myXmlObject.onLoad = function(success) { if (success) trace("XML File has been read."); } Load the xml file into the object: 1 myXmlObject.load("myXmlFile.xml");

TypeError: node is null message=node is null

The following error message occurs in Firefox 3 when using Firebug. TypeError: node is null message=node is null The error can be tracked back to script tags being in the head of the document instead of where they’re needed, an example would be with the ShareThis control/component that is often added to blogs and etc.

How to Temporarily Edit the Text of Any Website

Have you ever wanted to temporarily edit a webpage displayed in Chrome or another browser? How it works Let’s take a look at the Google homepage quickly. The Google homepage! Now, after we apply our little “page hack”, let’s look at it again! The Google homepage changed! How to temporarily edit a webpage Go to a website of your choice that you would like to edit. Enter the following javascript into the address bar: javascript:document.

PHP __autoload function

When PHP encounters a class that hasn’t been defined yet, you can use __autoload to automatically add them instead of including masses of included at the top of your files. e.g. 1 2 3 function __autoload($class_name) { require_once $class_name . '.php'; }

IE6 on Vista?

I find myself constantly fighting the microsoft battle of making things work in their browsers (thanks guys). On one of my machines I have Vista installed and needed to test a newly created site that apparently had some issues under Internet Explorer 6. HOWEVER, to my horror IE6 was unable to run on Vista. Once again, thanks Microsoft for making life difficult for everyone out there! After much grief, pain and agony with a million attempts to get it to run I stumbled upon a really great tool called IETester made by DebugBar.

Guillotine-Bug? Bug

Yes, it’s called a Guillotine-Bug and it’s yet another bug IE users get to look forward too 😛 So how does it work? Basically, the hasLayout messes around and elements become invisible and visible according to random things. Rather silly, but a bit of a bitch to initially figure out. So how do you fix it? Try this: in your css file add: 1 2 3 4 5 6 7 8 * html .

Sending data from javascript to php

If you ever find yourself needing to do some ajax and in turn sending strings of characters via javascript then you should really try encodeURIComponent() to wrap your strings in. The function escape() can also be used, but I would not recommend it as encodeURIComponent() is better, it also escapes your usual ampersand ajax limiters which solved me quite a bit of pain.

What is Eb in firebug?

Gmail produces the following error/warning in firebug. Eb is not defined 1 function Bb(a){if(a[sb]&&a[sb](daa)){var�ents)};f.x2b=c;f.B2b=b;f.y2b=a;return f} I initially started seeing this while while on clients’ websites, but can now say it’s a gmail thing. So don’t stress.. 😉

Add TinyMCE code button

I had quite a few problems adding the htmlCode button to a fairly old copy of TinyMCE (I think around version 2.x). All is resolved now and this is what I had to change: Both changes are made in “editor_template.js” file, I also swopped the 2 files so that I could include and edit editor_template.js instead of the compressed “editor_template_src.js. Using the advanced theme I added the following line near the top of the file:

Need more than hover?

I had a hover effect on an html input element but also needed to have an active state. The css was like this for the inputs in mention: 1 2 3 .contactformdiv input:hover, .contactformdiv textarea:hover { background-color:#fff; } It was simple, I just added a focus… 1 2 3 .contactformdiv input:hover, .contactformdiv textarea:hover, .contactformdiv input:focus, .contactformdiv textarea:focus { background-color:#fff; }