Ok, I have a question rather than a problem here - what I want to do is create a draggable pop-up window showing information such as a graph or diagrams.
What I have done is make the draggable window by creating a MC called 'dialogbox' and inside that there is a 'windowbar' MC (which has the dragging code on it) and another MC called 'content' (which is where the content will load.
Now this all works fine, I can make the dialogbox popup and it is draggable: so that's great!
What I want to do is to be able to choose what to load in the 'content' MC dynamically. So for instance, if I choose 'print' it will load the 'print' MC where 'content' MC should be. I would then resize the 'windowbar' and 'dialogbox' so everything looks right.
The thing is I'm not sure how to pass the relevant info to the MC 'dialogbox'. If there were a function I could do something like:
Code:
showBox(print, dialogbox, x=300, y=300);
But I don't know if that's possible or whether a better function already exists? So in other words I just want to load my own 'content' MC into the 'dialogbox' MC dynamically, and resize it to fit correctly.
This will attach a movieclip called 'print' from the library into 'content'. Once you have done that, dialogbox will automatically resize to fit the content inside. The last problem then is to make the windowbar the correct length:
There's a lot of extra code and also xml files and png files so I'd have to zip it all and it's too big to attach here. Thanks for the offer - I really appreciate it as you're helping me in your own time but I'd rather just fix it without showing the file to anyone until its complete.
Maybe you could do a simple example and I could check to see if I've done the same stuff???
You haven't called the movieClip dragbar. You need to edit the movieClip 'window', select the dragbar clip, and give it the instance name 'dragbar'. Giving it a linkage name just means that you can identify it in the library. The linkage name will not allow you to access an instance of the movieClip inside a loaded clip.
Hope this helps.
"If I have seen further, it is by standing on the shoulders of giants." - Sir Isaac Newton
That's great - can't believe I missed that. Oh well
I have another question related to this, do you know how I can move the 'close' button dynamically so it will be on the right side of the bar.
I'm using the following code:
Code:
ok._x = dragbar.width - 30;
But if I do the trace function for dragbar.width it says 'undefined'. I tried dialogbox.dragbar.width but that is undefined as well... how should I fix it?