  | |  | Re: How would you modify the vertical position of an element w | Re: How would you modify the vertical position of an element w 2005-10-07 - By Tony
Back Yeah, I guess I left off some information there. I abandoned that approach some time ago. What I have currently:
lBytes = _root.getBytesLoaded(); tBytes = _root.getBytesTotal(); percentLoaded = Math.floor((lBytes/tBytes)*100); loader.bar._xscale = percentLoaded; loader.percent.text = percentLoaded + "% of " + Math.floor(tBytes/1024) + "K loaded."; spider._y = percentLoaded * 6; if (lBytes>=tBytes && tBytes>0) { if (count>=12) { gotoAndPlay("main"); } else { count++; gotoAndPlay("preload"); } } else { gotoAndPlay("preload"); }
seems to be the closest to what I've been trying for, except for the fact that while the loader bar (which has no other code than what's on the timeline (above) works fine, only only thing that I see of the spider is the web it's dangling on for a brief second after the loader hits 100% - even though the spider is originally position off the top of the page. ?
--- In pro_flash@(protected), "ud" <bkinney@(protected)> wrote: > I'm not sure I agree about avoiding onClipEvents, but your code has some > other problems. > > 1. take off the quotes for sure like MK said > 2. set the value of vpos BEFORE you call move(); > 3. get rid of the conflicting line mcObject._y=0; > 4. where is percentLoaded coming from? I don't see you setting it's value > anywhere. > 5. this code would only work if mcObject is a child of the clip you've put > the code on. > > -- -- Original Message -- -- > From: "MK" <flabbygums@(protected)> > To: <pro_flash@(protected)> > Sent: Wednesday, September 28, 2005 9:40 PM > Subject: [Pro Flash Users] Re: How would you modify the vertical position of > an element while > > > > --- In pro_flash@(protected), "Tony" <thudman@(protected)> wrote: > >> How would you modify the vertical position of an element while > >> preloading? Using a standard preloader, I've added this to an object > >> on the stage: > >> > >> onClipEvent (load) {MovieClip.prototype.move = function(x,y){ > >> this._x = x > >> this._y = y > >> } > >> mcObject._x = 425 > >> mcObject._y = 0 > >> mcObject.move(0,"vpos"); > >> vpos = (600/percentLoaded)*100 > >> } > >> > >> Why doesn't this work? > > > > In general you should try to stay away from onClipEvents.. then try > > taking the quotes off vpos - the quotes tell the player it's a string.. > > > > > > > > > > > > > > > > > > ========================= > > Pro_Flash: Professional Web Developers Using Macromedia Flash > > To subscribe: mailto:pro_flash-subscribe@(protected) > > To UNSUBSCRIBE: mailto:pro_flash-unsubscribe@(protected) > > > > Yahoo! Groups Links > > > > > > > > > > > > > >
-- ---- ---- ---- ------ Yahoo! Groups Sponsor -- ---- ---- ---- --~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/IHFolB/TM -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----~->
========================= Pro_Flash: Professional Web Developers Using Macromedia Flash To subscribe: mailto:pro_flash-subscribe@(protected) To UNSUBSCRIBE: mailto:pro_flash-unsubscribe@(protected) Yahoo! Groups Links
<*> To visit your group on the web, go to: http://groups.yahoo.com/group/pro_flash/
<*> To unsubscribe from this group, send an email to: pro_flash-unsubscribe@(protected)
<*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Earn $52 per hosting referral at Lunarpages.
|
|
 |