Flash – Using the Progress Bar Component

Here is a sample of a Progress Bar component used with a List component as well as a Loader component.

Here is the code that hides the progress bar after it has completed loading, it uses event listeners:

//hides the pBar once it is fully loaded
loadListener = new Object();
loadListener.complete = function(eventObj) {
//this listener hides the progress bar on completion
pBar._visible = false;
};
placeHolder.addEventListener("complete", loadListener);

//loads the myList data on change and then hides the pBar
listListener = new Object();
listListener.change = function(eventObj) {
pBar._visible = true;
placeHolder.contentPath = myList.selectedItem.data+"?iu=jbbmmbbmmbmbmb22ggkl";
placeHolder.load();
placeHolder._x = 18.0;
placeHolder._y = 140.0;
pBar.source = loader;
trace("change");
};

myList.addEventListener(“change”, listListener)

Here is the sample fla – pBarLoader.fla
And, here is a working swf – pBarLoader.swf

(Ignore the Brokeback pic in that sample fla…that is merely for Blogdor)

;)
D-mode

Related Posts:

  • No Related Posts

Flash Preloader in a Shape of an Object

This is how you create a preloader for your Flash movie in a shape of an object. The sample fla I provided is for Greyhound Preservation League intro I did last year. The shape of the preloader is that of a grey hound and the object is basically just a masked greyhound shape of the filler tween.

Have a look at the sample fla here: preloaderShape.fla
And the working flash preloader here: preloaderShape.swf

Related Posts:

  • No Related Posts

Natalie & Eric Wedding Picture

As I was going back through some old photos I had taken with my Sony Digital Cyberhsot (5 Megapixles), I found this one. I have no idea what is going on here at this point of the wedding at Eric’s parents’ home but it does seem that they were in the process of cutting the cake.

Natalie and Eric Wedding Picture

Shortly after I took this picture, Natalie ( the bride and my sister in law) went up on the balcony that over looked the entry-way to attempt the first of the ceremonial bridal bouquet throw. I say the first attempt because the fact that Oprah herself could not have planned it better herself what happened next.

Natalie flung the bouquet from the above the swarming bachlorettes only to have it land in the chandelier far from the reach of any the would be receivers. The whole wedding company burst into laughter and many a kinsfolk were heard saying to one another, “Did you get that on video? Let’s send it in to that ‘Funniest Home Videos’ to win $10,000!”, as the bouquet was caught in the chandelier above.

After the forth person had said this, I had an idea. I told one of my other brother in laws to keep his camera running as I would attempt to retrieve the bouquet from its snagged state. I walked up to the crowd of ladies, all still swarming beneath the bouquet and instructed them to stand back. The ladies all took a few steps backwards. I felt like Moses parting the Red Sea as the ladies stepped aside. All awaited my next move. I walked back a few paces then turned back towards the chandelier and took two quick steps and went to leap at the bouquet but purposely tripped over my own feet and fell flat on my face. The crowd burst into laughter. I turned back at my brother-in-law who was holding his video camera and asked if he got that on tape. He replied, “Oh..no…the batteries have been dead for the last hour.”

Related Posts:

  • No Related Posts

Is this the same guy?

Iran’s nuclear negotiator Ali Larijani:
Nuke Guy

Norm Abrams of the “New Yankee Workshop” and “This Old House”:
Norm

Related Posts:

  • No Related Posts

Benvenuto Denied Change of Plea

ksl.com – Utah’s Online Source for Local News & Information Benvenuto Denied Change of Plea

This rat <beep> murdered a good friend of mine 10 years ago whom I was with the night before he was killed. This whole thing makes me very angry. Let him rot.

The story is from the Associated Press:

SALT LAKE CITY (AP) — Jorge Benvenuto, who killed one teenager, left another for dead and told police he had wanted to see how it felt to kill someone, has been denied a change of his guilty plea.

At the hearing Thursday, the slain youth’s mother asked Benvenuto, “What was it like to watch someone die? Was it worth it? Would you do it again?”

Benvenuto, 28, glanced once at Sy Snarr, lowered his eyes and shook his head.

Soon after that, 3rd District Judge Deno Himonas denied Benvenuto’s request to set aside guilty pleas he entered in 1997 to avoid the death penalty.

Defense attorney Grant Morrison argued the pleas were invalid because Benvenuto, a Uruguayan citizen, was never informed of his right under the Vienna Convention to contact a Uruguayan consulate.

Himonas said there was no violation of the convention because Benvenuto had told his attorneys and the judge who accepted his pleas that he was a U.S. citizen.

Benvenuto was born in Uruguay and came to the United States with his mother when he was 8. He was a permanent U.S. resident but never received citizenship.

Morrison said after the hearing that he would appeal the judge’s decision to the Utah Supreme Court.

On the night of Aug. 28, 1996, Zachary Snarr and Yvette Rodier, both 18, were photographing the full moon over Little Dell Reservoir when they were approached by Benvenuto who asked for directions and then shot them with his new .44-caliber Magnum revolver.

Benvenuto, then 19, fired until the gun was empty, striking Snarr three times.

Rodier, hit in the leg and torso, was still screaming, so he reloaded and shot her again in the head. She survived.

Benvenuto pleaded guilty in October 1997 to aggravated murder and attempted murder.

When he was sentenced to life in prison without parole, the victims’ families believed their ordeal was over.

On Thursday, Rodier called Benvenuto’s legal motions “a shameful attempt” to use “a hypertechnicality” to renege on the plea deal.

Rodier said she has married, started a family and “found ways to live again.”

She said returning to court with Benvenuto was “like being shot again.”

Sy Snarr agreed. “Being here today is a terrible nightmare for me and my family.”

Benvenuto’s mother, Nelida Valdez, said after the hearing that her son is not an evil person. She said he has mental problems that prison officials refuse to recognize or treat.

Benvenuto tried to withdraw his pleas soon after he entered them, claiming he was too depressed, distressed and confused to know what he was doing at the time.

Mental health evaluators found Benvenuto was depressed, but not to the point where it interfered with his ability to understand what he was doing when he pleaded guilty.

(Copyright 2006 by The Associated Press. All Rights Reserved.)

Related Posts:

  • No Related Posts

Ostertag suspended – Sloan is Jerk Face

Ostertag and Sloan From Espn:
Utah center a no-show at practice

Greg Ostertag is a goof-ball. He was suspended indefinetly, wow…..good thing he’s gone now….maybe they’ll win…wait no, they’ll never make the play-offs with Jerry Sloan as head coach.

Sloan has rode this thing into the ground on top of John Stockton and Karl Malone. Sloan thinks that by not playing guys or talking bad about them it will make them play harder then, he goes and complains that they are shooting too much. Wow, great coaching Sloan.

You may know a lot about the game of basketball but you know nothing about working with players. By talking bad about them to the media and then ignoring them face to face you are only doing your team harm. They are scared to shoot and they are scared to talk to you.

Is it a suprise to anyone else that Boozer has not returned? Not to me. If I were Boozer, I’d do the same thing. Who wants to play for a donkey like Sloan? Over the years free-agents have “avoided” coming to Utah because of the state’s reputation. Horse-hockey. It’s Sloan. No one wants to play for his jerk face. It’s time for him to retire to his John Deer hat wearing farm in Iowa. ‘Jerk-Face of the Year’ not ‘Coach of Year’.

So, yeah, this post was suppose to be about Ostertag….hmmm….what a goof-ball.

Related Posts:

  • No Related Posts

Flash Parse XML and populate Text Field

Many people have been asking this question of how to do this without having to use the connector component in Flash. The code is short and goes like this:

The structure is important in that the actionsrcipt will parse the xml file according to its structure.
The actionscript is as follows, place this on frame 1:
var loadText = "Loading XML...";
var myXml = new XML();
myXml.ignoreWhite = true;
myXml.onLoad = function() {
var baseName = this.firstChild.childNodes;
for (var j = 0; j myListXml.addItem({label:baseName[j].firstChild.firstChild, data:baseName[j].firstChild.firstChild});
myText.htmlText += "State: "+baseName[j].firstChild.firstChild+"
";
for (var p = 0; p
if (baseName[j].nodeName != null) {
myText.htmlText += "County: "+baseName[j].firstChild.nextSibling.childNodes[p].childNodes+"
";
myText.htmlText += "Contact Info:"+baseName[j].lastChild.attributes.contact;
myText.htmlText += " Phone:"+baseName[j].lastChild.attributes.phone;
myText.htmlText += " Email:"+baseName[j].lastChild.attributes.email;
myText.htmlText += " Hours:"+baseName[j].lastChild.attributes.hours+"

";
}
}
}
};
myXml.load("http://www.smithmediafusion.com/Helps/XmlContacts.xml");

Here is what the actionscript does:
1. Creates a function that will parse the XML file and then Load the XML file .
2. Add the parsed information to the text field.
3. Also add information to a List component.

Here is the sample fla – parseXML.fla
Here is the XML file – XmlContacts.xml
Here is a working sample – parseXML.swf

Have fun and enjoy your youth.
Dan

Related Posts:

  • No Related Posts

Bad to the Bone Midi

I know you are looking for this one. Bad to the Bone in midi format….Yeah!

Related Posts:

  • No Related Posts

Flash Limit Looping to a Certain Amount of Times

Another Flash quicky. How do you limit the number of times my Flash loops? Quite simple.
Create 3 Layers in a new Flash movie. Name the first layer “vars”, the second “gotoAction” and the last is where your movieClip or animation is.

On the first frame of the vars layer in a keyframe of frame 1, put the following actionscript:
myCount = 0;
On the second frame of the vars layer, create a blank keyframe (F7) and put the following actionscript code:
if(myCount ==3){
stop();
}

Next, on the gotoAction Layer on the frame of your animation put a keyframe with the following actionscript:
myCount++;
gotoAndPlay(2);
trace("myCount:"+myCount)

Test the movie, you are done.
What this does is set a var first at one on the first frame of the vars layer ‘myCount’. When then create an if statement on frame #2 of the same layer that tells the movie to stop if the condition that our var is equal to the amount of times we want it to loop. In this case, we set it at three times. Last of all, we set out myCount variable to increase each time it gets to the end of the animation (myCount++).

Here is a sample fla – limitLooping.fla
And a working swf – limitLooping.swf

Enjoy.

Related Posts:

  • No Related Posts

Preloading a FLV file

Here is another help on preloading a flv (flash video) file. This comes straight from within the Flash help.

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("http://helpexamples.com/flash/video/sheep.flv)"; //your flv URL HERE
url here

this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10, 160,
22);
this.createEmptyMovieClip("progressBar_mc", this.getNextHighestDepth());
progressBar_mc.createEmptyMovieClip("bar_mc",
progressBar_mc.getNextHighestDepth());
with (progressBar_mc.bar_mc) {
beginFill(0xFF0000);
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 10);
lineTo(0, 10);
lineTo(0, 0);
endFill();
_xscale = 0;
}
progressBar_mc.createEmptyMovieClip("stroke_mc",
progressBar_mc.getNextHighestDepth());
with (progressBar_mc.stroke_mc) {
lineStyle(0, 0x000000);
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 10);
lineTo(0, 10);
lineTo(0, 0);
}

var loaded_interval:Number = setInterval(checkBytesLoaded, 500, stream_ns);
function checkBytesLoaded(my_ns:NetStream) {
var pctLoaded:Number = Math.round(my_ns.bytesLoaded/my_ns.bytesTotal*100);
loaded_txt.text = Math.round(my_ns.bytesLoaded/1000)+" of
"+Math.round(my_ns.bytesTotal/1000)+" KB loaded ("+pctLoaded+"%)";
progressBar_mc.bar_mc._xscale = pctLoaded;
if (pctLoaded>=100) {
clearInterval(loaded_interval);
//your code here, like a gotoAndPlay or something
}
}

Dan

Related Posts:

  • No Related Posts

Flash – Making Gradient Fill Text

Here’s a quick one folks. Many people have asked how to make text with a gradient fill. It is really quite simple and takes but a few moments.

1. Create your fill by drawing on the stage on Layer 1 a rectangle with the gradient colors of your choice.
Sample:
grad1.jpg

2. Add another Layer and type your text on top of your rectangle with the fill. (this could also be dynamic text)
Sample:
grad2.jpg

3. Right click on the layer that has the next and set is as a mask.

grad3.jpg

gradientText.jpg

That’s it! You are done. Test the Flash movie and see it in its full glory.

Here is a sample fla – gradText.fla

Have fun and enjoy your youth.

-Dan

Related Posts:

  • No Related Posts

I’m no Kobe fan but, 81??!!!”ESPN.com – NBA – Kobe makes records wilt”

Kobe Scores 81 ESPN.com – NBA – Kobe makes records wilt

So if you have not heard, Kobe Bryant of the LA Lakers scored 81 points in a single game last night against the Toronto Raptors. That’s right 81 freak’n points. Only one other player in NBA hostory has scored more, Wilt Chamberlin with 100 in a game. Here’s the list of all time points in a game list.

100 — Wilt Chamberlain, Philadelphia vs. New York at Hershey, Pa., March 2, 1962.
81 — Kobe Bryant, L.A. Lakers vs. Toronto, Jan. 22, 2006.
78 — Wilt Chamberlain, Philadelphia vs. L.A. Lakers, Dec. 8, 1961 (3 OT).
73 — David Thompson, Denver at Detroit, April 9, 1978.
73 — Wilt Chamberlain, San Francisco at New York, Nov. 16, 1962.
73 — Wilt Chamberlain, Philadelphia vs. Chicago, Jan. 13, 1962.
72 — Wilt Chamberlain, San Francisco at L.A. Lakers, Nov. 3, 1962.
71 — David Robinson, San Antonio at L.A. Clippers, April 24, 1994.
71 — Elgin Baylor, L.A. Lakers at New York, Nov. 15, 1960.
70 — Wilt Chamberlain, San Francisco vs. Syracuse, March 10, 1963.
69 — Michael Jordan, Chicago at Cleveland, March 28, 1990.
68 — Pete Maravich, New Orleans vs. New York, Feb. 25, 1977.
68 — Wilt Chamberlain, Philadelphia vs. Chicago, Dec. 16, 1967.
Note: Wilt Chamberlain scored 67 points four times, 66 once and 65 points three times.

I’m not a Kobe fan but I had to make comment of this since it was so amazing. But, I must admit for a brief moment I liked him again. In my mind he was once more that rookie that everybody liked and could do no wrong….ahhh, we love you Kobe……<slap myself in the face> OK, I’m back to my normal state of mind now, I hate you Kobe. ;)

Related Posts:

  • No Related Posts

Great-Web-Sites, Home of Murray

Site Development, Dreamweaver Training, Newsletters, HTML Emails – Certified

Props and kudos to Murr, master of the Dreamweaver Newsgroup and Forum. Killer looking site as well.

Related Posts:

  • No Related Posts

The Last DP (Dr. Pepper) – The End of an Era

After 12 years of drinking at least one 12 oz. container of Dr. Pepper every single day….the era has come to an end. I drank my last DP over a month ago. As one of my New Years resolutions I decided to drop it cold turkey. That’s right….no more D-mode the DP maniac. No more late night withdrawls and cravings for the juice and nectaur of the gods. It’s over folks. The DP good times I mean.

A couple weeks ago, I was speaking with my 6 year old son, Jasper. “Jasper…”, I said to the boy, “…did you know that professional basketball players don’t drink soda pop?”

You see the boy is really into basketball lately and very much enjoys playing on his little league team. So, a couple days later…mey thinking that he had forgotten all about the conversation we had had about drinking pop….we are at some lame party at my sister’s home and someone offers him some root beer. He drank a few gulps then came running over to me with a horrible look on his face.

“Dad! Dad! I drank some soda pop?!”, he exclaimed. “Will I still be good at basketball?!”

I smiled and reassured Jasper that he would be fine and just to make sure he practiced a bit harder than he would normally do. This has been a great lesson to me in teaching and also a great way for me to connect with my son in a united effort to stop drinking soda.

Jasper has continued to excel in his basketball games ever since and I’m happy to say that he has not drank any soda since that lame party at my sister’s home. As for me…..I’m happy to announce I’m still DP free….well not happy but just announcing.

Related Posts:

  • No Related Posts

Windows XP Service Pack 3? – from Brian Krebs on Computer and Internet Security – (washingtonpost.com)

Look at this article: Security Fix – Brian Krebs on Computer and Internet Security – (washingtonpost.com)

Microsoft Corp. is pushing back its timetable for releasing the next bundle of security fixes and tweaks or “service pack” for Windows XP users until sometime in the latter half of 2007 in order to concentrate on development work for Windows Vista, the long-promised next new version of its flagship operating system.

A week ago Microsoft released its 54th Windows XP patch since Service Pack 2 was issued in August 2004. 54 people! I think the world is running out of band-aids!!!

The article says that at the rate Microsoft releases updates — about three per month — if it waits another 18 months to issue patches (which would be the most optimistic reading of the “second half of 2007″) XP users starting from a base of SP2 would have to install roughly 108 different patches to bring their machines up to date.

Yeah! That rocks!

Cheers, Dan.

Related Posts:

  • No Related Posts

« Previous Entries