Jump to content


Drag Drop



7 replies to this topic

#1 lukym

    New Member

  • New Members
  • Pip
  • 3 posts

Posted 23 July 2012 - 08:55 PM

Salve dovrei realizzare qualcosa di simile a questo qualcuno potrebbe aiutarmi???

#2 Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 23926 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 24 July 2012 - 10:11 AM

...this is an English speaking forum - I'll move this to the appropriate Supporto Italiano Forum.

wolf
Posted Image
Web Wolf Wonder Web Works

SWiSHsites modified

#3 Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 23926 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 24 July 2012 - 10:15 AM

Attached File  drag_with_ease.swf   18.17K   13 downloads

Attached File  drag_with_ease.swi   102.13K   19 downloads

wolf
Posted Image
Web Wolf Wonder Web Works

SWiSHsites modified

#4 lukym

    New Member

  • New Members
  • Pip
  • 3 posts

Posted 24 July 2012 - 07:18 PM

ok thanks but not what I want to try harder as a function of in figure someone can help me?

#5 Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 23926 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 25 July 2012 - 06:04 PM

http://files.swish-t...act=file&id=966

wolf
Posted Image
Web Wolf Wonder Web Works

SWiSHsites modified

#6 Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 23926 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 26 July 2012 - 10:39 AM

Attached File  drag_and_drop_example.swi   56.74K   25 downloads

wolf
Posted Image
Web Wolf Wonder Web Works

SWiSHsites modified

#7 lukym

    New Member

  • New Members
  • Pip
  • 3 posts

Posted 26 July 2012 - 07:57 PM

ok thanks I did but I still have one last problem I have is that after you have dragged all five correct answers will pass to the next scene someone could help me? thank you very much....

#8 cycle1500

    Advanced Member

  • Members
  • PipPipPip
  • 906 posts
  • Gender:Male
  • Location:Bradley, IL
  • Interests:Motorcycles, hunting, camping.

Posted 26 July 2012 - 09:51 PM

Use Wolfs Drag and drop example and copy the script below and replace the script in the example.

function start_move()
{
    this.startDrag(true);
    this.onEnterFrame = check_office;
}
function end_move()
{
    stopDrag();
}
function check_office()
{
    var hit : Object = null;
    for (w in workers)
    {
	    var ofc : Object = variable(workers[w] + "_office");
	    if (this.hitTest(ofc))
		    hit = ofc;
    }
    if (hit)
    {
	    if (this._name eq hit._name.substring(0, hit._name.indexOf("_")))
	    {
		    banner.text = "Right";
		    count += 1
		    stopDrag();
		    this._x = hit._x;
		    this._y = hit._y;
		    this.onEnterFrame = null;
	    }
	    else
	    {
		    banner.text = "Wrong";
	    }
    }
    else
	    banner.text = "";
}
onSelfEvent (enterFrame) {
    count_txt.text = count;
    if(count >= 3) {	   
	 nextSceneAndPlay();
}  
}
onFrame (1)
{
	    count = 0;
    var workers : Array = new Array("bob", "dave", "rick");
    for (w in workers)
    {
	    var obj : Object = variable(workers[w]);
	    obj.onPress = start_move;
	    obj.onRelease = end_move;
    }
}
onFrame (2) {
    stop();
}

Add a dynamic text box and name it "count_txt" without the " ".
This is just to see and text count is working.
Now make a second Scene with a stop() in the first frame.
Now text.

Wayne
Wayne helps those who help them selves.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users