I’m currently putting a portfolio together in Flash 8 Pro and I’m learning my actionscript in the process. I tend to do things the hard way sometimes, but it’s perhaps because I just don’t know any better. So let me explain my whole situation and I’ll include code and links and everything.
I have a main “interface” .swf sitting on an html page. On this “interface” .swf, I have an empty movie clip that holds all the sections when they get clicked on. On one of those sections, “flash”, I also have an empty movie clip to play these flash presentations I made at an old job.
So the order starts like this, Main Interface w/empty movie clip, “portfolio.swf”, this portfolio.swf calls up all my different sections, including the “flash” section, ("flash.swf), and then that .swf has links to call up these short presentations that load into another empty movie clip, the particular one I’m testing on is, “2003_apo.swf”.
I have a preloader on each individual section, (“flash”,“print”,“illustration”,“web design”, etc.), and all these sections load up fine.
I have a secondary preloader for the presentation .swfs and the actionscript is pretty standard and the preload bar which I changed to a masked image works fine, it’s the %percentage number load I can’t get to display/function correctly. What I’m getting when I check the section is the bar working fine, but neither the number loaded or percentage sign appear, so I figure it’s the targeting of my code.
On the code I used, I included fields for _this, _parent, _root, just because I wasn’t sure after going through them, and then just wanted to test it out. Whenever I check the “2003_apo.swf” outside of that interface and independently in a browser window, I get the default “myTextField”, as well as the “_root” to function properly, but inside my whole interface thing, within the section and everything, it’s just not coming up right.
here’s my code.
stop();
myInterval =setInterval(preloader, 10);
function preloader() {
if (getBytesLoaded() >= getBytesTotal()) {
play();
clearInterval(myInterval)
}
progressBar._xscale = (getBytesLoaded()/getBytesTotal())*100;
myTextField.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+ “%”;
_root.myTextField2.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+ “%”;
_parent.myTextField3.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+ “%”;
_this.myTextField4.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+ “%”;
}
I did coincide every “myTextField” number with an appropriate dynamic text box in the .swf. You’ll see the labels I did in the independent “2003_apo.swf”, but not in the presentation interface. I’m not sure if the targeting that I’ve got wrong or if it’s something else.
Of course, the links for those who might want to take a peak at it:
the portfolio interface thing:
http://www.hermanisnotdead.com/test/portfolio.html
how to get there… ?
- click on the arrow menu on the top left and the navigation slides out.
- click on “flash”
- then when the section comes up, click “continue”
- then “presentations”
- then when you see all the boxes displayed, it’s the middle box in the top row, and when it’s displayed in the “main” window, you’ll see it’s title, “2003 Physician Organization Consultants Meeting”, and if you click “view presentation”, it should load up the movie.
the testing .swf alone in the browser:
http://www.hermanisnotdead.com/test/2003_apo.swf
For those looking at the rest of it, yes, I know there are probably better ways of doing a lot of what I’ve done, but this is my first go at doing a whole interactive project with actionscript so forgive my sloppiness.
Any help is grately appreciated. Thank you for your time…
herman.