A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How can this be Done?

Threaded View

  1. #2
    Senior Member
    Join Date
    Jan 2010
    Location
    England
    Posts
    268
    cant help you with the email bit and selecting a shape is easy enough im sure you can do that no problem.


    from the sound of it youll want to have different objects and dragable movieclips that will attach a movieclip onto that object.

    make some movieclips and put them at the bottom.
    then on your jewlry shape actions type:
    Code:
    onClipEvent (enterFrame) {
    	if (_root.mc.hitTest(_root.jewlry)) {
    		this.attachMovie("pattern","pattern1",this.getNextHighestDepth(),{_x:jewlry, _y:jewlry});
    		_root.mc._visible = false;
    	}
    }
    line1: will perform this everyframe
    line2:if your dragable mc with the instance name of "mc" hits your object with the name of jewlry it will
    line3:attach the movieclip "pattern" (make sure you set that up in linkage) from your library and give it an instance name of pattern1
    line4:getnexthighestdepth will place it on the next highest "layer" or in otherwords ontop of your object
    & will only attach onto the object and nowhere else
    line6:your dragable mc will become invisible

    have a pattern to attach to your jewlry ready. then in the library right click it and choose linkage and select "export for actionscript" make note of the identifier as thats what youl be using to refer to it.

    thats all well an good but u want to drag the mc into the jewlry object.
    your hitTest is setup so now you can use this on your main timeline:
    Code:
    pattern.onPress = function () {
    	this.startDrag(true)
    }
    pattern.onRelease = function () {
    	this.stopDrag(true)
    }
    this is saying that when you press the mouse button on the pattern you want you can start dragging it, when you release the mouse button you will stop dragging it.

    to smoothen the dragging of the pattern mc use this:
    Code:
    onMouseMove  = function(){
    updateAfterEvent();

    there you have it. you should now be able to drag a movieclip pattern onto your shape and have the pattern be layed ontop of the shape. to help you further iv attached a demo .fla of this working. now just use your imagination and make those patterns and jewelery i guess you'l have to change bits around of course.

    and a note:robb@exo here on flashkit helped me out with a getnexthighestdepth problem i had a while back and its because of him i understand how it works now
    Attached Files Attached Files
    Last edited by stevehungry; 03-14-2010 at 11:39 AM.

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