View Full Version : window component does not link to movieClip
najamd
07-27-2006, 02:35 PM
Hey Guys,
Im having some problems with linking the window component to a MovieClip i got.
I tried both...
lwin.setScrollTarget(lbutt);
lwin.contentPath(lbutt);
but nothing seems to link the "lbutt" movie clip to the "lwin" window...
Any ideas what im doing wrong... both these items are already on stage and im linking them through scripting right now but i dont mind hard code them together but the component inspector is not helping much too... :(
Thanks,
Najam D.
sleekdigital
07-27-2006, 02:54 PM
You need to RTFM ...
There is no setScrollTarget method for the window component, at least not the V2 component which I assume you are using since you posted this in the AS 2 forum.
For the contentPath...
Property; sets the name of the content to display in the window. This value can be the linkage identifier of a movie clip in the library, or the absolute or relative URL of a SWF or JPEG file to load.
Based on what you said, it sounds like you are setting it to the instance name of a clip on the stage, which is not right.
najamd
07-27-2006, 03:11 PM
Hey sleekdigital!
whats RTFM?... and yeah... im trying to link them using instance name... what should i be doing to link them then?
Thanks!
sleekdigital
07-27-2006, 03:13 PM
RTFM means Read The F'ing Manual :)
I already said what you should be doing. Look at the quote in my previous post. The quote is from the Flash help.
najamd
07-27-2006, 04:02 PM
Im pasting the help doc example here so you can point out where it says anything about a F'ing linkage identifier...
/**
Requires:
- Window component in library
*/
import mx.managers.PopUpManager;
import mx.containers.Window;
System.security.allowDomain("http://www.flash-mx.com");
// Create window.
var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true, { contentPath:"http://www.flash-mx.com/images/image2.jpg"});
i see this Window thing being stupid or im lossing it.. cause if i cant link a movieClip on stage or a dynamic one i made on stage what the hell is the point of this?... in Flash Actionscripting 8 bible.. it says "You can add content to Window instances in exactly the same way as you add content to ScrollPane instances."
sleekdigital
07-27-2006, 04:21 PM
That example uses a URL to an external file....
contentPath:"http://www.flash-mx.com/images/image2.jpg"
As the quote I showed you says you can use a linkage ID OR "the absolute or relative URL of a SWF or JPEG file to load"
And yes this is exactly how it works for the scroll pane also. Maybe the reason you take issue with this is because you are used to the V1 components perhaps? The window and scrollpane components are quite useful. To me it actually makes more sense for them to work this way. Instead of building content is some arbitrary clip and then linking it to a window, you just build the content directly in the window ... I do that by setting the content path to a blank movieclip in the library.. then I just attach whatever content I want to the window.content clip. I do it that way because usually my content consists of more than one movieclip.
Since you noticed that the window component works the same as the scroll pane in terms of setting content, you might find this useful...
http://www.sleekdigital.com/News/11.aspx
here :
var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true, { contentPath:"http://www.flash-mx.com/images/image2.jpg"});
Window.contentPath
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
windowInstance.contentPath
Description
Property; sets the name of the content to display in the window. This value can be the linkage identifier of a movie clip in the library, or the absolute or relative URL of a SWF or JPEG file to load. The default value is "" (an empty string).
by aware !
var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true, { contentPath:"http://www.flash-mx.com/images/image2.jpg"});
my_win.content.someProperty <---- WILL NOT work !
//content creation is ASYNCRON !!!
LOOKUP "Window.complete"
najamd
07-27-2006, 04:48 PM
hmmm... linkage ID?.... you mean like... "_level0.logm" right?
najamd
07-27-2006, 04:51 PM
:p i think it might have been more simple to just make this dragging window from scratch then try to figure it out... LOL!..
sleekdigital
07-27-2006, 04:52 PM
linkage ID is a property you set for a moviclip in the library. Right -Click a movieclip and select "properties"
najamd
07-27-2006, 04:53 PM
this is just a little thing i want to add to a big project of ours which is using XML sockets... and right now those XML Sockets look more simple then this window crap.. :p
najamd
07-27-2006, 04:54 PM
oHHHHHHHH!!!!!... :D
let me try this...
hmmm... linkage ID?.... you mean like... "_level0.logm" right?
NO
_level0.logm
logm --> INSTANCE NAME
linkage id --> right click symbol in lib / Linkage .... / Identifier == linkage ID
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.