Bonjour à vous tous et merci d'avance pour votre aide.

http://www.rememberfactory.be/ElGloria/index.html
(patienter quelque seconde le temps que la carte soit chargé (swf 6MO)
J'ai pas encore préparé de preaload, merci.)


Le movieclip contenant l'image, dans sa taille initiale ne pose pas de probléme.
Le drag&drop respecte lzq limiteq de la scéne.

Le probléme ce situe lorsque je diminue la taille de mon movieclip (MC_map).
Une fois la taille réduite le drag&drop ne respete plus les limite de la scéne.
Comment rectifier le probléme, merci à vous.

Et voici le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
import gs.*; 
import gs.easing.*;
import gs.TweenLite;
import fl.events.SliderEvent;
 
//The x & y coordinates of the top-left corner of the rectangle.
var my_x:int=stage.stageWidth-this.MC_map.width;
var my_y:int=stage.stageHeight-this.MC_map.height;
 
//The height and width of the rectangle.
var myWidth:int=0-my_x;var myHeight:int=0-my_y;
 
//Create a new instance of the rectangle class with the coordinates above.
var boundArea:Rectangle=new Rectangle(my_x, my_y, myWidth ,myHeight);
 
//Adds the mouse down and up event listeners to the sheep movie clip.
 
this.MC_map.addEventListener(MouseEvent.MOUSE_DOWN, drag);
this.MC_map.addEventListener(MouseEvent.MOUSE_UP, drop);
 
//This function drags the sheep but limits to the stage boundaries.
 
function drag(event:MouseEvent):void {  this.MC_map.startDrag(false,boundArea); Mouse.cursor = flash.ui.MouseCursor.HAND;}
 
//This function releases the sheep object.
function drop(event:MouseEvent):void {  this.MC_map.stopDrag(); Mouse.cursor = flash.ui.MouseCursor.AUTO;}
 
 
Slider_scale.addEventListener(SliderEvent.CHANGE, ScaleLevel);
 
function ScaleLevel (event:SliderEvent):void{
TweenLite.to(this.MC_map, 1, {scaleX:event.target.value/10, scaleY:event.target.value/10});
};
Merci encore.