Solved

draggable datagrids with label attached, resizable datagrids using mouse?

Posted on 2004-10-06
24
173 Views
Last Modified: 2010-04-03
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
Comment
Question by:KoldFuzun
  • 12
  • 11
24 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 12246789
>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
 
LVL 7

Expert Comment

by:ssdesign
ID: 12248777
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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12250596
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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
LVL 27

Expert Comment

by:negatyve
ID: 12250684
ok, I'll try to make you an example..
0
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12251766
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
 
LVL 27

Expert Comment

by:negatyve
ID: 12251802
>just dragged them on top of the movieclip

not on top, *inside* it (nested).
0
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12251830
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
 
LVL 27

Expert Comment

by:negatyve
ID: 12251920
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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12254470
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
 
LVL 27

Accepted Solution

by:
negatyve earned 500 total points
ID: 12254519
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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12254535
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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12254541
Wish I could extra points to ya!
0
 
LVL 27

Expert Comment

by:negatyve
ID: 12254576
> 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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12255336
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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12256129
also, since the clip is compiled I am unable to add any text to the top bar? I'm so confused??? :)
0
 
LVL 27

Expert Comment

by:negatyve
ID: 12256472
hey! (I was sleeping)
i'll add title managements, and bars skinning, then post again..
0
 
LVL 27

Expert Comment

by:negatyve
ID: 12257209
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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12259362
excellent, thank you! Any way I can get the code to the compiled clips or is that an ancient Chinese secret? ;)
0
 
LVL 27

Expert Comment

by:negatyve
ID: 12260229
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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12260256
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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12260274
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
 
LVL 27

Expert Comment

by:negatyve
ID: 12260347
>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
 
LVL 2

Author Comment

by:KoldFuzun
ID: 12260369
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
 
LVL 27

Expert Comment

by:negatyve
ID: 12260450
work in progress :), ehhehe

bye!
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question