Friday Time Wasting Videos
Friday, April 29th, 2005Two funny videos to share for a Friday afternoon.
Two funny videos to share for a Friday afternoon.
I saw a post over at FlashApe on submitting dynamically generated forms so I thought I’d just post a “how-to” here that works for me. Maybe this will help some others too. Below is the HTML I wrote that gets the job done (tested IE6 and Firefox):
<!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”><head><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /><title>Dyn Form</title><script type=”text/javascript”>function renderForm(){document.getElementById(“formDiv”).innerHTML = “<form id=\”myForm\” name=\”myForm\” action=\”http://www.msn.com\” method=\”post\”>”+”Type Something<input type=\”text\”><br />”+”<input type=\”submit\”> or <a href=\”javascript:document.getElementById(‘myForm’).submit();\”>Submit Like this</a>”+”</form>”;}</script></head><body><a href=”javascript:void(0);” onclick=”renderForm();”>Render Form</a><div id=”formDiv”></div></body></html>
Recently I had an idea. I have been working on an application in Flash for awhile and it has a version number hard-coded into the resulting swf. Sometimes I forget to change the build number when I publish it out. This results is me having to reopen flash, reopen the FLA, reopen the .AS file and recompile. I thought it’d be neat if I could just “inject” a new value for that variable into the swf. This took me down several roads but I came up with a neat little app that could have potentially large amounts of power.
![]()
I am providing for download RC1 of INJECTOR. This zip contains the MTAC compiler and it’s associated files, the INJECTOR.as file and the INJECTOR.exe file.
In short this app will take an already existing swf file and allow you to “inject” your own code into it. The cool thing is is that the swf doesn’t need to be one you created. You also do not need a copy of Flash. Below you will find a mini tutorial on how INJECTOR works:
STEP 1:
Download the zip here.
Step 2:
Extract the zip to a folder on your PC (sorry no Mac support as of now).
Step 3:
Run the injector.exe file.
Step 4:
Press the Select SWF button and for demonstration purposes choose the text.swf file that was extracted into the folder along with the injector.exe file.
Step 5:
In the code box type:
_root.myVar = “This is a test to see if this works”;
Step 6:
Press the Inject button.
Now if everything worked properly (we have had one bug report – seemed system specific) you should be able to run the text.swf file and see your text inside. You jut modified a precompiled swf by changing the value of myVar in the _root of that swf. Now, if you think about it, you have a large amount of power in your hands. Check out the two examples below. You should either make a copy of the text.swf or pick another swf you don’t mind modifying. Try each of these samples below on an swf, run them and see what happens.
for(var i=0;i<3;i++){geturl(“http://www.msn.com”,”_blank”);}
and
_level0.loadMovie(“http://www.macromedia.com/swf/globalnav/
globalnav_en_us.swf”);
I guess if you know your actionscript well enough there is a lot of things you could use this for. Note that you need to use proper AS2 code as this code gets injected into as AS2 Class prior to injection – the first example worked because we referred to _root and not the class.
If you still have to ask what this is or what its used for then dude… You’re never gonna know. Hehehe – j/k – feel free to email me with questions/comments.
For awhile now I have seen on fellow web developer’s machines yellow form fields. I assumed initially it was a style on the particular website until I did some further exploring. Today I created a form for a site I am developing and I was walking one of the project managers throw the site. I noticed the fields on my form were yellow! I know I hadn’t done anything to the form to “make” this happen. That’s when I decided to “google” it and see what I could find. I ran upon this article, “Outsmarting the Google Toolbar“. Seems that the Google Toolbar is the culprit that is modding forms on the fly! More precisely the autofill functionality. I had been wondering about this for awhile so I thought now that I have the answered I’d share. There are some “fixes” and workarounds in that article as well. Great stuff.