Hello everybody.
I hope one of you can help me. My problem is as
follows:
I have a program that, when working properly, is
supposed to create a draggable layer with a bgImage when clicking on
another layer. Inside the draggable layer is two small childLayers. When
clicking on them the parentLayer is supposed to either grow or shrink by 10px
for each click.
The problem is, that the event only seems to be
working on the last created layer. That means that for instance after having
created two draggable layers, the grow/shrink event only works on the last
created. When firing the "grow"-event on layer1 then layer2 grows
etc.
I'm using DynApi ver. 2.54.
Here is a litte bit of my code:
dic=new DynLayer(null,40,40) /*in my program this
layer is being created dynamically in an array, and doesn't have the hardcoded
values for x and y*/
image = DynImage.getImage(cSrc);
dicImg = new DynImage(image); dicImg.setAutoResize(true) dic.addChild(dicImg); /*Creating the childLayer, that
when clicked
is supposed to enlarge the parentLayer
*/
plusLayer=new DynLayer(null,0,0,8,8,"green") dic.addChild(plusLayer) plusEvent = new EventListener(plusLayer) plusEvent.> plusLayer.addEventListener(plusEvent) /*this function is supposed to make the
parentLayer grow by 10px*/
function
plusSize(e){
dicparent=e.getTarget() dicImg.setSize(dicImg.getWidth()+10,dicImg.getHeight()+10) dicparent.setWidth=dicImg.getWidth() dicparent.setHeight=dicImg.getHeight() } Cooking the question down to 2 things:
1) how do retrieve the ID of the parentLayer of the
clicked childLayer?
2) Is it possible for NS4.x to resize the layer
that contains the image dynamically?
Yours
Kasper |