-
[F8] Is this possible
Ok I have a movie clip inside the scrollpane and I want the movie clip to be dragable and I've tried the startdarg(); and other tricks but not to seems work. Is this possible?
-
Senior Member
startdarg() won't work because you can't spell.
-
and if he can (just in case, should be startDrag(); ) - perhaps wrong target?
to get to know the path (make sure it has a instance name) put this actionscript inside the movieClip:
PHP Code:
trace(this._target);
components can be scary because its basicly a concept of hiding mechanics
-
ya very funny.
Ok back to the subject I have a scrollpane I name it frame and it's parameters contenth path name is box and inside it is MC's item1,item2,item3,item4
I put my code inside the frame(the scroll pane) it goes like this
onClipEvent(enterFrame)
{
_root.item1.onPress = function()
{
trace("clicked");
};
}
but when I click the item1 it didn't display the trace "clicked"
and even I use this
onClipEvent(enterFrame)
{
_root.frame.inventory.item1.onPress = function()
{
trace("clicked");
};
}
still does not show the trace
and
onClipEvent(enterFrame)
{
_root.frame.onPress = function()
{
trace("clicked");
};
}
this show the trace but I cannot scroll the pane?
Please help I'm having hard time on solving this one
-
some thoughts:
a.)
I suppose the Flash 5 (btw. very outdated way of scripting and even wrong used) onClipEvents gets lost because they are not inside the movieClip but rather attached- and when merging with the component it handles the mc different.
Just that you know- a onClipEvent(enterFrame){ followed with button assignments is garbage. Actions for buttons have to be initialized only once!- so a onClipEvent(load) (if you still insist on that outdated model) would be better.
But imo. the best practice is to just place 1 line in the timeline (create a xtra layer just for the actionscript) is enough, like
(frame script)
PHP Code:
item1.onPress = function() {
trace("clicked");
}
b.)
the path you used still is wrong
PHP Code:
_root.item1.onPress ....
maybe that path simply doesn´t exist!- maybe because of the way the component works or you missed instance names or did not assigned instance names propper.
To test out though better (or in general) avoid root asignments but instead work with relative or local namespaces in other words try it perhaps with:
PHP Code:
this.item1.onPress = function(){
..
}
c.)
another way of you trying to find out the actual path´s is to use the debugger in flash,- just hit ctrl+shift+enter
then click on the play icon and check the left panel for any targets of movieCLips that exist.
in the end I suppose I am not the best person that can help you here as I personally always ignored components because of their protective nature. Maybe post a fla so I can have a look at it.
Its somehow a irony - components were added for the less scripting strong flash user base - but in the end it produces the most frustration for that group as they learn it often that compenents can´t do all that they imagined to start with.
-
PHP Code:
http://www.MegaShare.com/485799
Down load for free for the .FLA file, just to inform every one my purpose now if this file is to be able to click each item and can display the trace "clicked" thanks
-
ok so I found out that the path of your inventory linkage´d movieClip basicly becomes
PHP Code:
frame.spContentHolder.item1
I found that out using
PHP Code:
trace("trgt:"+this._target);
within that inventory MovieClip.
but the way I see things the component puts a drag layer over the content meaning that it overrides your mouse interactions from another layer inside the component that is used to let the user drag inside the component to scroll.
so my final conclusion is:
get rid of the component and build your own scroller
-
Senior Member
Another thing is he shouldn't be defining the press function over and over again inside an onEnterFrame
-
I mentioned that as well earlier - wrong practice besides the outdated syntax
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|