# Ill feed you pizza if you help me

**URL:** <https://forum.kirupa.com/t/ill-feed-you-pizza-if-you-help-me/119529>\
**Category:** Uncategorized\
**Created:** [August 16, 2004, 3:47am UTC](https://forum.kirupa.com/t/ill-feed-you-pizza-if-you-help-me/119529 "2004-08-16T03:47:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![freedejm](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@freedejm](https://forum.kirupa.com/u/freedejm)\
**Post date:** [August 16, 2004, 3:47am UTC](https://forum.kirupa.com/t/ill-feed-you-pizza-if-you-help-me/119529/1 "2004-08-16T03:47:41Z")

</div>

here is the site

[http://jfreeden.com/test/main2.html](http://jfreeden.com/test/main2.html)

here is the actionscript

setProperty(“obj1”, \_alpha, “0”);  
setProperty(“obj2”, \_alpha, “0”);  
setProperty(“obj3”, \_alpha, “0”);  
setProperty(“obj4”, \_alpha, “0”);  
setProperty(“obj5”, \_alpha, “0”);

obj1.loadMovie(“background1.swf”);  
obj2.loadMovie(“background2.swf”);  
obj3.loadMovie(“background3.swf”);  
obj4.loadMovie(“background4.swf”);  
obj5.loadMovie(“background5.swf”);

// targetAlpha contains the value of \_alpha you want the clip to fade towards

function doFade() {  
this.\_alpha += (this.targetAlpha-this.\_alpha)/4;  
if (Math.round(this.\_alpha) == this.targetAlpha) {  
delete this.onEnterFrame;  
}  
}  
// get a clip named myClip to fade out  
obj2.targetAlpha = 0;  
obj2.onEnterFrame = doFade;  
obj3.targetAlpha = 0;  
obj3.onEnterFrame = doFade;  
obj4.targetAlpha = 0;  
obj4.onEnterFrame = doFade;  
obj5.targetAlpha = 0;  
obj5.onEnterFrame = doFade;  
// and get another clip named myOtherClip to fade in  
obj1.targetAlpha = 80;  
obj1.onEnterFrame = doFade;

what will make the transition smoother, i already cranked down the quality to a low 20… the background files are 20kb. I figured if i lowered the target alpha, it would go quicker/smoother but it didnt help, i also messed with the division factor within (this.targetAlpha-this.\_alpha)/4; the lower the # the choppier the transition, the higher the # the longer it takes… frame rate is at 30. Thanks all!

---

<div class="post-metadata">

**Author:** ![freedejm](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@freedejm](https://forum.kirupa.com/u/freedejm)\
**Post date:** [August 16, 2004, 4:11am UTC](https://forum.kirupa.com/t/ill-feed-you-pizza-if-you-help-me/119529/2 "2004-08-16T04:11:46Z")

</div>

hmm, just checked it out on another computer and it was pretty smooth, wonder why it sucks butt on my comp, and how well are you seeing the transitions (between menu selections) forgot to mention that…

---

<div class="post-metadata">

**Author:** ![freedejm](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@freedejm](https://forum.kirupa.com/u/freedejm)\
**Post date:** [August 16, 2004, 5:12am UTC](https://forum.kirupa.com/t/ill-feed-you-pizza-if-you-help-me/119529/3 "2004-08-16T05:12:56Z")

</div>

too late for the pizza i got a new script that works even on my crapcomp

MovieClip.prototype.fadeTo = function(value, speed) {  
this.onEnterFrame = function() {  
this.aV = Math.floor(value-this.\_alpha);  
this.aV ? this.\_alpha += this.aV/speed : (this.\_alpha=value, delete this.onEnterFrame);  
};  
};  
//example useage  
obj2.fadeTo(0, 8);
