Solved

draggable datagrids with label attached, resizable datagrids using mouse?

Posted on 2004-10-06
24
171 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
Comment Utility
>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
Comment Utility
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
Comment Utility
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
 
LVL 27

Expert Comment

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

Author Comment

by:KoldFuzun
Comment Utility
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
Comment Utility
>just dragged them on top of the movieclip

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

Author Comment

by:KoldFuzun
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Wish I could extra points to ya!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 27

Expert Comment

by:negatyve
Comment Utility
> 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
Comment Utility
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
Comment Utility
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
Comment Utility
hey! (I was sleeping)
i'll add title managements, and bars skinning, then post again..
0
 
LVL 27

Expert Comment

by:negatyve
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>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
Comment Utility
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
Comment Utility
work in progress :), ehhehe

bye!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now