Solved

draggable datagrids with label attached, resizable datagrids using mouse?

Posted on 2004-10-06
24
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: 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!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

624 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