flash actionscript:
For your first question, try:
trace(this.HOTSPOT_AMOUNT);
And make certain that you're passing a Number for _hotspotamount.
For your second question, startNavigation should work when called from within
the Mapnavigator class but because it's private, you can't call it from outside
the class without a get or set function. If you want to use it outside of the
class you're going to have to declare it public.
On Fri, 14 Oct 2005 22:37:47 +0000 (UTC), "stephan.k"
[quoted text, click to view] <webforumsuser@macromedia.com> wrote:
>Hi Everyone.
>
> I am trying to wrap my head around the classes and the OOP concepts.
>
> Please take a look at the code below. I tried to clean it up to the bare
>essentials and I marked out the two main questions I ran into. They are marked
>as comments next to the critical lines...
>
> Any help or insight appreciated.
>
> Thanks in advance.
>
> sk.
>
>
> -------------------
>
>
> class com.maptraction.Mapnavigator {
>
> private var HOTSPOT_AMOUNT:Number;
> private var MAPPATH:MovieClip;
>
> public function Mapnavigator(_mapName:MovieClip,_hotspotamount:Number){
> MAPPATH = _mapName;
> HOTSPOT_AMOUNT = _hotspotamount;
> starter();
> }
>
>
>
>
> private function starter(){
> MAPPATH.onEnterFrame = function(){
> trace(HOTSPOT_AMOUNT) // >> undefined >> how do I get to the scope of
>this variable?
> startNavigation(rootpath,SCALE_FACT,ZOOMSPEED); //>> flash doesn't see
>this function... why not? What do I need to do to access the function?
> }
> }
>
> private function startNavigation(){
> //navcode...
> };
> }
>
>
> -----------------------------
>
>
Hi Everyone.
I am trying to wrap my head around the classes and the OOP concepts.
Please take a look at the code below. I tried to clean it up to the bare
essentials and I marked out the two main questions I ran into. They are marked
as comments next to the critical lines...
Any help or insight appreciated.
Thanks in advance.
sk.
-------------------
class com.maptraction.Mapnavigator {
private var HOTSPOT_AMOUNT:Number;
private var MAPPATH:MovieClip;
public function Mapnavigator(_mapName:MovieClip,_hotspotamount:Number){
MAPPATH = _mapName;
HOTSPOT_AMOUNT = _hotspotamount;
starter();
}
private function starter(){
MAPPATH.onEnterFrame = function(){
trace(HOTSPOT_AMOUNT) // >> undefined >> how do I get to the scope of
this variable?
startNavigation(rootpath,SCALE_FACT,ZOOMSPEED); //>> flash doesn't see
this function... why not? What do I need to do to access the function?
}
}
private function startNavigation(){
//navcode...
};
}
-----------------------------