A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [F8] Is this possible

  1. #1
    Senior Member
    Join Date
    Oct 2007
    Posts
    121

    [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?

  2. #2
    Senior Member Ray Beez's Avatar
    Join Date
    Jun 2000
    Posts
    2,793
    startdarg() won't work because you can't spell.

  3. #3
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    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

  4. #4
    Senior Member
    Join Date
    Oct 2007
    Posts
    121
    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

  5. #5
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    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.

  6. #6
    Senior Member
    Join Date
    Oct 2007
    Posts
    121
    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

  7. #7
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    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

  8. #8
    Senior Member Ray Beez's Avatar
    Join Date
    Jun 2000
    Posts
    2,793
    Another thing is he shouldn't be defining the press function over and over again inside an onEnterFrame

  9. #9
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center