Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

draggable datagrids with label attached, resizable datagrids using mouse?

I have been able to make a draggable datagrid, but i am unsure how to make it move WITH a text label I want displayed next to it. Is there a way to link items (like linkable layers in Photoshop)?

Also, I would like users to be able to resize a datagrid by using their mouse, like you do with windows. Is this possible?
0
KoldFuzun
Asked:
KoldFuzun
  • 12
  • 11
1 Solution
 
negatyveCommented:
>but i am unsure how to make it move WITH a text label I want displayed next to it

two solutions:

1. drop both the datagrid and the text label inside a movieclip, then drag this one..
2. when dragging the datagrid, use a mousemove or enterframe clip event to keep the text label at the same relative position

>I would like users to be able to resize a datagrid by using their mouse, like you do with windows. Is this possible?

yep, you can create a hot spot clip in the right bottom corner, activate it with mouse down, use drawing methods to simulate the ghost, then resize it on mouseup with the setSize method. what component version are you using?
0
 
ssdesignCommented:
Hi,
I experimented with this a bit.

Download the ZIP and see if thats what u r looking for:

http://www.ssdesigninteractive.com/scaleGrid.zip

Hope it helps.
0
 
KoldFuzunAuthor Commented:
ssdesign, ty for the example. Unfortunately when i run the test the datagrid doesnt drag and when i try to resize it I get a grey box like its going to resize and then nothing :)

negatyve, I will try your suggestions. I am using the combobox built into the MX 2004 components. How do I tell which version it is?

Also, maybe I am going about this the wrong way, after seeing ssdesign's example. I am thinking that because I need to make it apparent to the user that the elements are resizable I need to  add something to the interface. Also I think it would make it easier to drag.

I have attached a url showing an image of what I am talking about. It might be impossible because the datagrid and background would need to resize but not the text. Please excuse my rookie design skills, I am a programmer not an artist :(

http://www.sanative.net/datagrid_drag.gif
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
negatyveCommented:
ok, I'll try to make you an example..
0
 
KoldFuzunAuthor Commented:
negatyve, you said:

"drop both the datagrid and the text label inside a movieclip, then drag this one.."

I created the movieclip and placed the datagrid and text inside it (just dragged them on top of the movieclip), but when I try to move it, it only moves the movieclip and not the datagrid and text. What did I do wrong?
0
 
negatyveCommented:
>just dragged them on top of the movieclip

not on top, *inside* it (nested).
0
 
KoldFuzunAuthor Commented:
k, remember I am a newbie :) Sorry, but I dove into this headfirst without the "Flash for complete morons" book!
Can you explain to me how to nest it?
0
 
negatyveCommented:
ehehe, do not worry, we all started the same way
I mean, create an empty movieclip, drop it onto the stage, edit it (double click), then drop the grid and the combo inside it (grid and combo are said to be nested inside the movieclip)..
0
 
KoldFuzunAuthor Commented:
So i was able to nest the datagrid into the movieclip, but it wont display anything. When I add the properties and methods of the datgrid to the movieclip it will display the datagrid with no data. Is there a way to reference the objects within the movieclips? For example, change

top25cons_dg.getColumnAt(0).headerText = "Hits";


to

myclip_mc.top25cons_dg.getColumnAt(0).headerText = "Hits";


?
0
 
negatyveCommented:
ok, let's test it:

sample: http://www.negatyve.com/EE/TestResizableGrid/TestResizableGrid.html
source: http://www.negatyve.com/EE/TestResizableGrid/TestResizableGrid.zip

>Is there a way to reference the objects within the movieclips? For example, change

yes, it is, but the component nested inside the movieclip should be already instantiates (ready in all its part) before settings..
0
 
KoldFuzunAuthor Commented:
Wow, this is exactly what I wanted  :) Now let's see if I can figure out how tio implement it into my script. I really appreciate that you have taken the extra time to create an example for me!
0
 
KoldFuzunAuthor Commented:
Wish I could extra points to ya!
0
 
negatyveCommented:
> I really appreciate that you have taken the extra time to create an example for me!

that's passion, as it is for me and ssdesign ... ;)

0
 
KoldFuzunAuthor Commented:
negatyve

Sorry to keep bugging you! I am looking through this project and all looks good. Only thing is I cant see how you made the resizer work. is that within the compiled clip?
0
 
KoldFuzunAuthor Commented:
also, since the clip is compiled I am unable to add any text to the top bar? I'm so confused??? :)
0
 
negatyveCommented:
hey! (I was sleeping)
i'll add title managements, and bars skinning, then post again..
0
 
negatyveCommented:
sample: http://www.negatyve.com/EE/ResizableGrid/ResizableGrid.html
source: http://www.negatyve.com/EE/ResizableGrid/ResizableGrid.zip

Now you can:

- set and get the title
- set and get title styles with setTitleStyle and getTitleStyle
- set the use of hand cursor on drag
- customize top and bottom bar with appropriate movieclip in the library (if you delete them, you will see default ones)

Now you have:

- no bug on pressing the resizer
- the arrow icon..
0
 
KoldFuzunAuthor Commented:
excellent, thank you! Any way I can get the code to the compiled clips or is that an ancient Chinese secret? ;)
0
 
negatyveCommented:
You cannot get the code from the compiled clip (not directly): this is one of compiled clips feature, for the sake of copyright protection. But here it is: http://www.negatyve.com/EE/ResizableGrid/ResizableGrid.as
0
 
KoldFuzunAuthor Commented:
Thanks negatyve, it is really appreciated. More than anything I just want to see how it is done so that I can learn. Being a newbie has its disadvantages, lol
0
 
KoldFuzunAuthor Commented:
also, if you want credit for the resizable grids, please let me know. I will be sure to include you in the source code, along with your contact info.
0
 
negatyveCommented:
>More than anything I just want to see how it is done so that I can learn

good way to act.. :)

>also, if you want credit for the resizable grids, please let me know. I will be sure to include you in the source code, along with your contact info.

no worries, just don't distribute the *as file (that I'm deleting from server).. :)
0
 
KoldFuzunAuthor Commented:
no worries there, i will keep it under lock and key. :)

ALso, just wanted to point out that there is no DNS A record to negatyve.com, just a www A record. You may want to add one :) Unless you did it intentionally, then just nevermind me
0
 
negatyveCommented:
work in progress :), ehhehe

bye!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 12
  • 11
Tackle projects and never again get stuck behind a technical roadblock.
Join Now