I got this:
(XScroller Class):
[Bindable]
[Inspectable(defaultValue="")]
function set _targetInstanceName(targetName:String):Void
{
this._TargetName = targetName;
this._Target = this._parent[this._TargetName];
if ( this._Target != "" )
{
this.addEventListener("onScroll", this._Target);
}
}
function get _targetInstanceName():String
{
return this._TargetName;
}
public function SetPosition(val:Number):Void
{
this._MyValue = val;
if ( this._MyValue > 1 )
{
this._MyValue = 1;
}
if ( this._MyValue < 0 )
{
this._MyValue = 0;
}
this.Update();
dispatchEvent({type: "onScroll", target: this, horizontal:
this._Horizontal, value: this._MyValue});
}
(VScroller extends XScroller)
and then in the main movie, frame 1 (tb is a normal text field, and
scroller is an instance of VScroller):
tb.onScroll = function (evt:Object)
{
tb.text = "BLAH";
trace("BLAH");
}
onScroll = function ()
{
tb.text = "ASDF";
trace("ASDF");
}
scroller.addEventListener("onScroll", this);
I do NOT get any traces and the tb.text doesn't get changed. Please help??
Hans Wichman wrote:
Hi,
if you got your target through something like:
this.target = this._parent[this._targetInstanceName]
that should work. You might have to do something like:
[Inspectable(_targetInstanceName="")]
function set _targetInstanceName(targetName:String) {
this.targetInstanceName = targetName;
//do whatever
}
and then this.target = this._parent[this.targetInstanceName];
not to sure about that one ;), might be that _targetInstanceName's
value is accessible directly or not.
greetz
Hans
At 07:37 PM 12/23/2005, Mark Ribau wrote:
Ok, I got that part working, but how does the thing I dropped it on
get the events from the component I dropped onto it ?
I tried:
this.addEventListener("onScroll", this.target);
but that didn't seem to work.
Hans Wichman wrote:
Hi,
if you create a component and hook up a class to it, and provide a
method such as:
[Inspectable(_targetInstanceName="")]
function set _targetInstanceName(targetName:String) {
//do whatever
}
you can drag and drop your component on another clip and your
instance's _targetInstanceName will be set to the name of the clip
you dropped it on.
greetz
Hans
At 04:56 PM 12/23/2005, eric dolecki wrote:
You mean
mc._name ?
On 12/23/05, Mark Ribau <[EMAIL PROTECTED]> wrote:
>
> Hey folks,
>
> I'm in Flash 8 Pro, building for Flash 7 player. I'm trying to get
> _targetInstanceName working, but I can't seem to get it to work.
Does
> anyone have a good example of how to get it working?
>
> --
> Mark Ribau
> Lead Windows Developer | My Tech Blog
> <http://www.redbugtech.com/blogs/mark.php>
> Redbug Technologies, Inc. <http://www.redbugtech.com> -
www.redbugtech.com
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
Mark Ribau
Lead Windows Developer | My Tech Blog
<http://www.redbugtech.com/blogs/mark.php>
Redbug Technologies, Inc. <http://www.redbugtech.com> -
www.redbugtech.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
Mark Ribau
Lead Windows Developer | My Tech Blog
<http://www.redbugtech.com/blogs/mark.php>
Redbug Technologies, Inc. <http://www.redbugtech.com> - www.redbugtech.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders