Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic content in a scroll pane?

Status
Not open for further replies.

gameon

Programmer
Feb 23, 2001
325
GB
Hi, I have a fixed size scroll pane. I would like to use control the size of the clip within that pane and have the scrollbars adjust accordingly.

Is the a function I need to call to get them to apear - and dynamically resize when necessary?

Foe example. To make it simple - I would like to have a movie clip in a scrol pane that is growing 10 px every second for ten secoonds. - I would like thescroll bars to extend slowly, so that when the 10 secs are up, you can scroll around to see the whole thing...

M@)
 
Hi, I can't see 'scrollpane' under misc...
M@)
 
Images->Scrollpanes->Zoom

Regards,

cubalibre2.gif
 
excellent. It was the setContentScale(); that I was looking for...

Cheers loads!

M@)
 
Actually, there is one question. I am adding shapes dynamically to the content of the main pane. Is there a function or method to call that will update the contents of the zoom window?

M@?
 
what is supposed to happen ?

i can click around and it joins up my clicks but i dont see anything being loaded.

what am i missing.
 
Just realised, the objects in the zoom and the pane are different entities, and if I want them to be a mirror I will have to edit the component or apply the same additions to both...
 
Hi Again Bill, I've just got hold of flash mx 2004. I've nearly finished playing with the zpane thing...

When using flash mx 2004 you have to change line 16 in the action of the first pane to:

mydata = new LoadVars(); instead of
mydata = new loadvars();

But, now when I try to export as flash player 7 I get the following errors:


**Error** Symbol= MouseCursors, layer=script, frame=1:Line 3: There is no property with the name 'setCursor'.
Mouse.setCursor = function (state) {

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 73: There is no method with the name 'setCursor'.
Mouse.setCursor("dragHand")

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 79: There is no method with the name 'setCursor'.
Mouse.setCursor("default")

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 83: There is no method with the name 'setCursor'.
Mouse.setCursor("default")

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 251: There is no method with the name 'constrainValue'.
this.lens._x = Math.constrainValue(x, 0, this.content_mc._width-this.lens._width+hdif);

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 252: There is no method with the name 'constrainValue'.
this.lens._y = Math.constrainValue(y, 0, this.content_mc._height-this.lens._height+vdif);

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 260: There is no method with the name 'constrainValue'.
this.lens._width = Math.constrainValue(w, 0, this.content_mc._width)

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 261: There is no method with the name 'constrainValue'.
this.lens._height = Math.constrainValue(h, 0, this.content_mc._height)

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 350: There is no method with the name 'setCursor'.
Mouse.setCursor("dragHand")

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 353: There is no method with the name 'setCursor'.
Mouse.setCursor("default")

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 363: There is no method with the name 'setCursor'.
Mouse.setCursor("default")

**Error** Symbol= ZoomPane, layer=script, frame=1:Line 415: There is no property with the name 'constrainValue'.
Math.constrainValue = function(n, mn, mx) {

Total ActionScript Errors: 12 Reported Errors: 12



Can you think of why its happening?

M@?)
 
basically mx components are not going to work on 2004...this was documented by macromedia and ill post the link when i find it.

2004 is a serious upgrade from mx and is a very much stricter language. functions for instance now must return a value. there a clear distiction in 2004 between functions and methods that wasnt really there in mx

in mx, because the version of ECMA Script that it is based
on is not typed and doesn't require functions to be of a defined type, all variables are of variant type. In "real" programming, like AS 2, a function will have to be declared like this:

public int MyFunction(iOldNumber){
return(iOldNumber*2);
}

...and the value that it returns must be of the type
specified in the function declaration. So for this example the function would be available from anywhere in the project (because its scope is public) and the value it
returns would always be an integer.

so when you try to run code written in mx which is calling 'functions' that 2004 interprets (correctly) as methods then the code will fail.
 
Oh, I see. So what would I need to do to make the component work?

M@?
 
its either publish as mx or do an extensive rewrite of the component code
 
Hmmm - don't really have the time to go through all that. I think I'll have to publish as mx or find a similar mx 2004 component...

Thanks for you time and knowledge...

M@)
 
i wouldnt really think about publishing anything with 2004 for another 6 months or so or until the uptake of flash player 7 hits >75%

too few people will be able to view it
 
True, but I'd rather get it working now, and have less work to do later...
M@)
 
How long and how much do you think someone would change to recode this component?

M@)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top