View Full Version : Stuck at the Component Definitions part...
CyanBlue
06-07-2003, 03:39 AM
Can somebody tell me what I am doing wrong???
I did(?) create a preloader component and added items in the Component Definitions window... and when I test this in the new test file, what I have typed in the property panel doesn't get recognized by the component... (You can see it in the trace window once you run the movie file...) What am I doing wrong???
Oh, just in case... The font name should be the linkage identifier name set in the library... ;)
TIA
File has been replaced to the working version in case somebody needs it... The link to the sample is at the bottom of this page...
senocular
06-07-2003, 03:49 AM
the component definition variables are already part of the component object. You dont have to assign them in your constructor function (loader). They're already there - put there from the ... well, the Component Definitions window :D
CyanBlue
06-07-2003, 04:05 AM
Thank you for the mighty fast anwer, senocular... ;)
I did comment out the initialization part, and it works... YaY... Here goes my first preloader... :D
http://www.cfhosting.it/CyanBlue/Tests/Preloader/Preloader%20Test.html
Okay... That worked... ;)
How about this one???
I have created new layer and added this script into the frame 1.../*
this.attachMovie("FPreloaderSymbol", "theLoader", 1234);
this.theLoader.image = "Doggy.jpg";
this.theLoader.locX = 50;
this.theLoader.locY = 100;
this.theLoader.theFontName = "Times SC";
this.theLoader.theFontSize = 20;
this.theLoader.targetDepth = 5555;
*/When I tried it, I get to see this...-------------------------
this = _level0.theLoader
drawBox : [type Function]
loadCheck : [type Function]
runLoader : [type Function]
drawLoader : [type Function]
-------------------------Where are all my properties??? I don't get it... :(If I uncomment the one in the library, I get this...-------------------------
this = _level0.theLoader
drawBox : [type Function]
loadCheck : [type Function]
runLoader : [type Function]
drawLoader : [type Function]
theDepth : 1
theFontSize :
theFontName :
locY :
locX :
image :
name :
-------------------------Can you tell me why??? I don't get it... Why the properties are not applied when I try it with the script??? :(
Wait... If I initialize the instance this way,this.attachMovie("FPreloaderSymbol", "theLoader", 1234, {image:"Doggy.jpg", locX:50, locY:100, theFontName:"Times SC", theFontSize:20, targetDepth:5555});I get to see this...-------------------------
this = _level0.theLoader
drawBox : [type Function]
loadCheck : [type Function]
runLoader : [type Function]
drawLoader : [type Function]
image : Doggy.jpg
locX : 50
locY : 100
theFontName : Times SC
theFontSize : 20
targetDepth : 5555
-------------------------Why is it different???
CyanBlue
06-07-2003, 04:11 AM
I cannot have multiple instances on the stage either... The first instance gets discarded and the second instance is showing... Both instances has been dragged from the library... There's gotta be something in the code... But when I test locally I got this...Error opening URL "file:///E|/CyanBlue/Preloader/Doggy.jpg?uniqueID=57"
Error opening URL "file:///E|/CyanBlue/Preloader/Ranch.jpg?uniqueID=62"That means there are two instances on the stage that is trying to work, but somehow I just see one instance working on the stage after all... :confused:
senocular
06-07-2003, 04:23 AM
ok, heres how it works. Theres an order to it all.
if you drag a component on the screen...
- initClip actions run
- Component Definition properties added.
- constructor is run
- main movie frame actions run
- anything in component out of initclip block run
When attached:
- initClip actions run
- anything before attachMovie is run (obviously)
- movieclip is technically attached
- init object properties are copied into the movieclip
- constructor is run (init properties already in, constructor function run with no arguments)
- anything after the attachMovie call is run
- anything in component out of initclip block is run
so when dealing with this, you can see where conflictions or missing properties might go. The ones you are looking for (I think) just werent being added before the trace call was displayed
CyanBlue
06-07-2003, 04:38 AM
Obviously this thing is harder than I thought... :D
I have solved multiples thing which was quite easy because it was the depth issue, but I am still not understanding it right for the attachMovie() part... I'll keep working on it...
Thanks alot, senocular... :)
CyanBlue
06-07-2003, 07:58 AM
Yay... It's working... :D
I have no idea how sluggish or whatever happens...
I don't care... It's working... :p
Whoever is interested in my first component...
http://www.cfhosting.it/CyanBlue/Tests/Preloader/Preloader%20Test%205.html
http://www.cfhosting.it/CyanBlue/Tests/Preloader/Preloader%20Test%205.zip
retrotron
06-07-2003, 01:30 PM
Very cool, CyanBlue. Nice work!
And thanks to senocular for listing that order of precedence with components, that's good to keep straight.
CyanBlue
06-07-2003, 04:21 PM
Heh... I know that it isn''t the best job I could do, but I guess I did a decent job... I'm proud of myself thanks to you guys... ;)
That order of precedence with components, I'll need to get my brain staightened up abit more to understand it... ;D
As for the performance... How was it??? Was it jerky or was it bearable???
retrotron
06-07-2003, 04:49 PM
It was just fine for me . . . perhaps preloaders are jerky because the data comes in chunks rather than 1 byte after the other, you know first 15 bytes, then 100 bytes, then 4 bytes . . . in this case the preloader would simply adjust to whatever it is receiving, so first you get 15bytes, then it jumps to 100bytes, then 4bytes, etc. That makes me wonder how those preloaders you see that are real smooth work.
CyanBlue
06-07-2003, 10:40 PM
Hm... Yeah... I guess we got some big work ahead... ;)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.