Wednesday, December 16, 2009
My Flash to EXE fullscreen scalling settings
fscommand("fullscreen", true);
fscommand("allowscale", false);
fscommand("showmenu", false);
Stage.scaleMode = "showAll";
Thursday, December 3, 2009
CSS Selectors Browser Compatibility
Wednesday, December 2, 2009
Hiding Text on Form Submit Button
Tuesday, November 17, 2009
Mute Streaming Audio in Flash
Well, I searched and searched and finally found something. Thanks (http://www.actionscript.org/forums/showthread.php3?t=32982)! I made some simple modifications.
This is my code. I made a MC with 2 frames and buttons in it. In frame 1, a button that calls "mute();" here's the button code for the one that's in frame 1.
on (release) {And frame 2 has this:
nextFrame();
this._parent.mute();
}
on(release) {
prevFrame();
this._parent.unmute();
}
And here's the code in the root. I could easily make a volume slider that sets the "level" variable, and would then set. But for most stuff, we simply need the sound to be either there... or not.
level = 100;
globalSound = new Sound();
globalSound.setVolume(level);
function mute() {
trace("mute");
//previewaudio.stop();
globalSound.setVolume(0);
}
function unmute() {
trace("unmute");
globalSound.setVolume(100);
}
Enjoy!
Monday, October 19, 2009
Vertical Ticker Scroll with jQuery
Friday, October 9, 2009
Kern dynamic text is Flash Actionscript
function kernText(myTextField, kerning) {
myTextField.html = true;
var newFormat:TextFormat = new TextFormat();
newFormat.letterSpacing = kerning;
//newFormat.font = "Arial"; // Add now whatever format needs you have.
myTextField.setTextFormat(newFormat);
}
Wednesday, October 7, 2009
Flash right-click menu
function calledFunction1() {
trace("calledFunction1");
}
function calledFunction2(){
trace("calledFunction2");
}
MENU = new ContextMenu();
MENU.hideBuiltInItems();
insertAfter = new ContextMenuItem("Call function 1", calledFunction1);
insertBefore = new ContextMenuItem("Call function 2", calledFunction2);
MENU.customItems.push(calledFunction1);
MENU.customItems.push(calledFunction2);
_root.menu = MENU;
Thursday, July 2, 2009
Easy way to Parse RSS in PHP
Here is some simple code for parsing RSS 2 in PHP. It's so easy, I can't believe it.
<?php
$doc = new DOMDocument();
$doc->load('http://www.softarea51.com/rss/windows/Web_Development/XML_CSS_Utilities.xml');
$arrFeeds = array();
foreach ($doc->getElementsByTagName('item') as $node) {
$itemRSS = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue
);
array_push($arrFeeds, $itemRSS);
}
?>
Thanks to: How to parse RSS feeds with PHP
Monday, June 22, 2009
CSS Image Replacement for Buttons
Friday, June 19, 2009
Keep Footer at the Absolute Bottom of Page
Wednesday, June 3, 2009
Nice Drop Down Menues
Thursday, May 28, 2009
PHP Mail on Windows Server
Wednesday, May 20, 2009
Ajax with jQuery
Tuesday, May 12, 2009
Social Bookmarking Links
Tuesday, April 28, 2009
CMS Recommendation: ExpressionEngine
Ternary Operator (Short IF Statements) in PHP
// Example usage for: Ternary Operator
$action = ("john" != "frank") ? 'john isnt frank' : 'john is frank';
Wednesday, April 8, 2009
Web-safe Fonts
CSS Position Help
Wednesday, March 11, 2009
Editing .htaccess with PHP
Wednesday, March 4, 2009
Flash - Old School Actionscript Tweening
/* */
onClipEvent(load) {
mytime = _parent.timeSlower;
mybounce = _parent.bounceSlower;
}
onClipEvent (load) {
physics = [mybounce,mytime];
start_x = this._x;
start_y = this._y;
start_w = this._width;
start_h = this._height;
start_xscale = this._xscale;
start_yscale = this._yscale;
start_a = this._alpha;
xspeed = 0;
yspeed = 0;
aspeed = 0;
wspeed = 0;
hspeed = 0;
xscalespeed = 0;
//this._width = (this._width*1.2);
//this._height = (this._height*1.2);
//this._width = this._width/2;
}
onClipEvent (enterFrame) {
xscalespeed = ((start_xscalespeed-this._xscale)*physics[0])+(xscalespeed*physics[1]);
this._xscale += xscalespeed;
yscalespeed = ((start_yscalespeed-this._yscale)*physics[0])+(yscalespeed*physics[1]);
this._yscale += yscalespeed;
wspeed = ((start_w-this._width)*physics[0])+(wspeed*physics[1]);
this._width += wspeed;
hspeed = ((start_h-this._height)*physics[0])+(hspeed*physics[1]);
this._height += hspeed;
xspeed = ((start_x-this._x)*physics[0])+(xspeed*physics[1]);
this._x += xspeed;
yspeed = ((start_y-this._y)*physics[0])+(yspeed*physics[1]);
this._y += yspeed;
aspeed = ((start_a-this._alpha)*physics[0])+(aspeed*physics[1]);
this._alpha += aspeed;
}
/**/
Still need to establish the "time" and "bounce" variables for consistency across the board.
Monday, February 16, 2009
ASP's Fast Way To Pull Data from Database
MSSQL Searching for Datetime value
Fast String in ASP
Thursday, February 12, 2009
Automatic and Dynamic Title URLs from Titles using Javascript
<html>
<head>
<script type="text/javascript">
function urltitle(title)
{
// Create the url friendly title
var url = title
.toLowerCase() //change everything to lowercase
.replace(/^\s+|\s+$/g, "") //trim leading and trailing spaces
.replace(/[&]+/g, "and") //replace ampersand
.replace(/[#]+/g, "sharp") //replace pound
.replace(/[@]+/g, "at") //replace at
.replace(/[%]+/g, "percent") //replace percent
.replace(/[+]+/g, "plus") //replace plus
.replace(/[-|\s]+/g, "_") //replace spaces and hyphens to underscore
.replace(/[^a-z0-9_]+/g, "") //remove all non-alphanumeric characters except the underscore
.replace(/[_]+/g, "_") //remove duplicate underscores
.replace(/^_+|_+$/g, "") //trim leading and trailing underscores
;
document.getElementById('title_url').value = url;
}
</script>
</head>
<body>
<input type="text" onkeyup="javascript:urltitle(this.value);" />
<input type="text" id="title_url" />
</body>
</html>
Hide Link Dotted Borders in Firefox
Tuesday, February 10, 2009
Simple Javascript Back Link
Thursday, January 29, 2009
Dynamic buttons in Flash using ActionScript 2.0
1. Make your button an actual MovieClip on the stage however you want them all to look/work. Create a dynamic text field (center justified - or whatever) within the button with the instance property of "text_txt" for this example. (You can name it whatever you want, but you'll need to change some of the code below).
2. In the library find your MovieClip. Open the Symbol properties dialog.
3. Select the "export of actionscript" check box. Identifier "myButton"... again, for this example only. Click OK.
4. Now return to the stage and in frame one of a layer, I've named my top-most layer "actions". Copy and paste the following:
for(i=0; i
target = this.attachMovie("myButton", "myButton"+i, i, {_x:10, _y:30*i} );
target.text_txt.text = nav[i];
target.myLink = url[i];
trace(myLink);
target.nr = i;
target.onPress = function(){
//getURL(this.myLink);
trace("Hi, I'm "+this._name+" and my number is "+this.nr+". The link is: " + this.myLink);
}
}
With some extra work we can make this a horizontal menu, getting the width of each text box and moving the rest.... I'll post that another time.
5. I created an Array that I want to use for the labels of my buttons. Eventually I will pull these labels from a database table, but for now, paste this info above the previous code.
var nav:Array = Array();
nav[0] = "nav 1";
nav[1] = "nav 2;
nav[2] = "nav 3";
nav[3] = "nav 4";
nav[4] = "nav 5";
nav[5] = "nav 6";
nav[6] = "nav 7";
6. Now we need these links to do something, right? So let's create an Array for our URLs. Paste this array just below the previous but before the button code "for" stuff.
var url:Array = Array();
url[0] = "http://www.adobe.com";
url[1] = "my link 1";
url[2] = "my link 2";
url[3] = "my link 3";
url[4] = "my link 4";
url[5] = "my link 5";
url[6] = "my link 6";
6. Ta da! That's all that is to it.
7. Publish your file.
Tuesday, January 27, 2009
Simple Javascript email verification
Monday, January 26, 2009
Autocomplete textfields
Wednesday, January 21, 2009
Flash Random Number generator
A little actionscript to get a random number (n) is this case.
low = 0;
high = 360;
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}
for (var i = 0; i < 1; i++) {
var n:Number = randRange(low, high)
trace(n);
}
Wednesday, January 14, 2009
Why I hate Blogger!
IE6 Problem with Form Submit Image Buttons
A lot of times we use images as our submit buttons for forms. I'm sure you've seen it a lot. Well, say you wanted to test if the form was submitted and used the standard way, lets say in PHP, of seeing if the submit button was sent, for example like this:
if (isset($_REQUEST['mysubmitbutton']))
{ ...}
With IE6 this wouldn't work if your submit button was an image. So if you had this as your submit button:
<input name="mysubmitbutton" type="image" value="1" src="someimage.png" alt="" />
Then your script wouldn't work. The reason is that IE6 WILL NOT send over the variable mysubmitbutton.
The workaround is to know that IE6 will send over other information (along with all other browsers). It sends the x and y coordinates of where you clicked on the image. So you'll see mysubmitbutton_x and mysubmitbutton_y. So if you modify your code to look for either of these variables, you'll be good to go!
Credit is to be given to this discussion forum: Differences in form handling btw Mozilla and IE?
Thursday, January 8, 2009
Get referrer with PHP
<?php
session_start();
if(!isset($_SESSION[’referrer’])){
//get the referrer
if ($_SERVER[’HTTP_REFERER’]){
$referrer = $_SERVER[’HTTP_REFERER’];
}else{
$referrer = “unknown”;
}
//save it in a session
$_SESSION[’referrer’] = $referrer; // store session data
}
?>