Custom MovieClip ScrollBar
Posted: October 28th, 2008 | Author: Ivan Valadares | Filed under: Actionscript3, Components | 20 Comments »It’s a really easy to modify this vertical scrollbar. Use and Abuse!
It’s a really easy to modify this vertical scrollbar. Use and Abuse!
If you remember in as2 we had _root which let us access to methods and variables in the root of the project and refer to absolute paths, I thought that as3 didn’t have _root propriety, but I was wrong. root property can be useful if you want to share some value to all the classes in the project, add events to main class that call methods declared inside the class where we are working on or call generic methods declare in root class.
To use root propriety the class that you are working on most extend a DisplayObject (Sprite,MovieCLip,etc…) because you have to add the class to the parent class. And note, you can’t use the root propriety in the constructor method, because the addChild haven’t been process yet! Well let’s stop writing and see some code:
Main.as
In the Main class I’m declaring a variable named myValue which I did the proper sets and get. I am declaring two classes, in one of them I will set the value at the Main class and in the other I will get that value back. I’m also creating a movieClip just for test purposes.
ExampleClass.as
In ExampleClass I’m setting myValue that is propriety of the Main class with some text and I’m tracing the movieClip that I create in the Main Class.
AnotherClass.as
In AnotherClass I’m tracing the myValue propriety. So the result should be:
[object MovieClip]
This value is inside the Main Class
So it works ok, you only have to be carefull not refer root inside the constructor method, have the certain that you already addChild the class when you are referring to root and that the class extends a display object. If you do that, you can too have access to stage propriety, let’s check the next example:
ExampleClass.as
The result should be or stage width.
Another way to access to main proprieties, methods, etc… is with static members. In the next example I’m declaring a static property in the main class and setting and trace the value of it in the example class.
Main.as
ExampleClass.as
The result should be “Hello Word!â€, if you didn’t know this, read some books about object oriented programming and static members.
Another way to do the same thing is to pass the instance of main class as an argument to the other classes.
Main.as
Example.as
There are still another ways to access to the Main class code. I don’t know which techniques are more correct, I usually use them all depending in what I need. I hope I help someone.
Following our tradition of getting the makers of the most used 3D engines out there we landed an interview with Alex Karpovich, from Alternativa3D.

Flash on the beach is over! It's always a mix of joy and sadness. This year's been terrific, with great talks, great parties and amazing people!
So here's my final day's reviews:
Rob on Away3D: It started with a little background on the platform and some early demos that described the problems that Away3D had to solve, and why they started it in the first place, with stuff like Triangle Caching allowing some of the demos to have over 100 000 polygons on screen and still maintain quite acceptable frame rates! The he showed us a few amazing demos of current usage of Away3D including a RPG called Dragon Wars that was mind-blowing, overall very cool presentation.
Nicolas Lierman on AIR Analytics: This presentation focused on showing all that data that we collect from our sites and applications in meaningful ways and gave us a little technical and personal background on the AIR Analytics application.
André Michelle Make some noise: As always with André the presentation was energetic and ended with a rave, but this year he gave us a big technical insight on how the achieves his results.
Koen de Weggheleire - This was one of the coolest sessions in FOTB, Koen talked about Matrices and how they work, and i finally got it!
Mario Klingemann: What can I really say about Mario's session, it was impressive to say the least, this time he focused heavily on the concept part of manipulating pixels, and by not going into code he managed to provide us with the how he does it.
Jonathan Harris: I had seen Jonathan before at a TED talk, online that is, and was blown away when I found that he'd be at FOTB '08. He went through his life experience explaining each endeavor and showing us amazing examples, that you just can't help but to fall in love with.
To close his session he delivered a speech to the community about how he feels us, an eye opener!
And to finalize I won a FOTB 08 Jacket and that's just cool!
It was amazing as always, living up to the Hype and there's a lot of it! And I hope to you guys here next year!

FOTB 08 Day #2
Ok so here we are at day #2 of FOTB '08 and today was inspiring to say the least, I chose to go a bit more on the inspiring side and less on the technical part and it paid off brilliantly. This is clearly one of the areas I feel myself lacking and I feel like I've learned quite alot!
Mike Downey on AIR - Mike's session about how to pitch and sell AIR applications was an eye opener and consolidated a lot of concepts I already had.
He told us about the Lighthouse project that is meant to give out a hand to developers, and companies, in pitching AIR applications and they might even help you prototype it! Also he spoke about the AIR marketplace and how it can boost your app, good stuff!
Adobe Townhall Meeting - So every year the Adobe teams comes together and answers our questions. There were plenty of questions this year but I'll leave you with the most exciting answers: Flash is coming to the iPhone!!! And AIR is coming to mobile!
Jam Session - This was one of the coolest sessions in the conference, with André Michelle, Carlos Ulloa, Ralph Hauwert, Mario Klingemann, Joa Ebert where they showed off amazing stuff they've been working on, I'll try and refer you to a better post as soon as find one!
GSkinner - This year Grant went more on the how to handle your workflow and solve programming problems, and eye opener.
Hoss - Hoss was amazing, with an energetic presentation of his work and telling us to focus on the user eXperience instead of everything else, because in the end that's all that matter, plus nudity!
So that was it for day two, I attended a few more sessions but i didn't see them as relevant as they were more for inspiration.