Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Clearing ScrollPane



Hi guys,

What's the code to clear the current contents of a scrollPane without turning off the visibility of the scrollPane itself. I just want to clear the contents of it so that I can load other mc's into it by button actions. Thanks!



FlashKit > Flash Help > Flash MX
Posted on: 03-24-2003, 12:25 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] Button Inside Scrollpane, Cannot Control MC Outside Of Scrollpane?+emptymc
Hi, first look at the example of how it should work :

http://www.surfacingmedia.com/VIDEOPLAYER2.html
notice the Buttons in the scroller on the right tell the MC on the left to GOTO MC frame i want it too (each frame then holds Player for specific video.)
works great right?

Now when I load this into my main site into an empty movieclip i use for all section content it Does not work at all! sure it loads the first video but the buttons are disabled?
(use link below navigate to photo/video and selet video.)
http://www.surfacingmedia.com/

the code is the same just calls to the videoplayer MC and tells it to goto a certain frame.
it doesnt work when loaded into my empty MC. ?
any suggestions?
If kill the scrollpane altogether, buttons work fine then even loaded into emptyMC. seems once buried in scrollpane its too deep for buttons to work? which for me defeats the purpose kinda.
Note-Flash 8 (i am a code lightweight i used the BEHAVIORS commands gotoand stop on frame select the MC.)

Thanks in advance i will answer some posts while i am here that i can now.

ScrollPane Auto Scroll On Frames Within ScrollPane
Hi Guys,

I am using an instance of the scrollPane component to load in scrollable content, some of the items of content are .swfs that have separate navigation within them. I am wondering how I can get the scrollPane to adjust the amount it can scroll based on the content on each frame of the movie that has been loaded into the scrollPane. Ideally the scrollbar would also turn off when the content is small enough for there to be no need for the scrollbar.

Thanks,

-Jim

Swapping Scrollpane Content With Button Outside Scrollpane
Hi,

I'm terribly new to flash which is probably why I couldn't solve this with any tutorial out there.

I've got a scrollpane, and outside that I have a few buttons working as a nav bar. I want these buttons to load a different movieclip (which isn't in the stage, it's in the library) to the scrollpane.

Using the tutorial on this site (the one where you add or remove a blue movieclip to the scrollpane) I got as far as adding the movieclip to the scrollpane. Problem is, I need the buttons to unload the current movieclip before loading the new one.

(So for example, if the movieclip called "home" is loaded in the scrollpane and I click on the button "Patterns & Textures" I want that button to unload "home" from the scrollpane and load the movieclip "patterns")

My code so far looks like this:



Code:
scrollPane.setStyle("borderStyle", "none");

var i:Number=0;
var mcMain:MovieClip;
function init() {

scrollPane.contentPath = "home";
mcMain = scrollPane.content;
trace(mcMain);

}
init();

brushes_btn.onRelease = function() {

mcMain.attachMovie("brushes", "brushes"+i, mcMain.getNextHighestDepth(), {_y:50*i+5, _x:5});
i++;
scrollPane.invalidate();

};
Taken from the tutorial.

I'm pretty sure I don't need the + i part because I won't have more than one mc in the scrollpane at once, but I don't know how to remove it without screwing it up.

I'd greatly appreciate any help!

Scrollpane Content Not Limited To Scrollpane
I am using the scrollpane component in flash mx. I have content loaded into the scrollpane via actionscript. The content loads up, but the scrollbars scroll it past the edges of the scrollpane. The content then overlaps the rest of my movie(outside the scrollpane. How can I fix this? shouldn't there be a mask there? thanks for your help, garrett

Loading Mc In One Scrollpane From Mc Clip In Another Scrollpane
I'm still stuck.

I have one movie clip with a whole bunch of buttons 'loaded' into scrollpane and I want each button to load a different mc into a different scrollpane when clicked.

I tried using "attachMovie" but I'm still very confused.

Is this what I use?

If so, do I go

on(release){
attachMovie("mc name", "frame label of loaded mc", "level not in use");

}


Any help is greatly appreciated.
Thanks in advance.

Scale Scrollpane Content Not Scrollpane
Friday arvo, fantastic.

Any way I can scale a externally loaded clip sitting in a scrollpane.

I can scale the scrollpane no probs using a slider but I want the scrollpane to be static and the swf inside the scrollpane to scale.

cheers in advance.

H

Postioning Content In Scrollpane Without Using Scrollpane
Hi guys.
Not sure if this is possible. i had a look through the help files but had no luck I have 2 questions so here goes.
i am using V2 components in particular the scrollbar component.
I am attaching an mc to the scrollbar the mc contains several lines of text.
Is it possible to use a button elsewhere in the movie to set the postion of the mc in the scrollpane. Essentially moving the content up or done without using the scroll pane buttons or track bar?
How on earth do i change the colour of the scrollbar track button?

thanks
Paul

Scale Scrollpane Content Not Scrollpane
Friday arvo, fantastic.

Any way I can scale a externally loaded clip sitting in a scrollpane.

I can scale the scrollpane no probs using a slider but I want the scrollpane to be static and the swf inside the scrollpane to scale.

cheers in advance.

H

Clearing Out Xml
when i test in flash, i can reload my xml by redefining new XML
yet in my browser, sometimes it doesnt update

why is that

how can i avoid it

SO Clearing
I am trying to get used to shared objects and now I am trying to clear one... I tried using the sgame1.clear(); to clear it... but it never cleared it. I put an

Code:
if(sgame1.data.name != undefined) {
sgame1.clear();
trace("cleared");
}

but when i ran it about 3 times it kept giving me "cleared" which means that it didnt totaly wipe out the SO... any suggestions?... thanks

~Bill

Clearing.
hi!!

in one scene of my movie I have drawnt shapes usibng action script. When I add a button onto that scene to go to another scene, that all works, but the shapes from the previous scene are still there. Even if i do a back button to a previous scene the shapes remain. I do not know how to clear the shapes?

Can somebody help me please!!

Thanks for reading!

Clearing Out XML?
Hi there,

I have built a generic movie clip that gets populated from an xml file. (actually its php generated xml) it contains both text and an image. My problem is that when you close the clip down and then click on another button to open the same movie clip but with different info on it, the last image remains for about half a second. What I want to know is if there is any way of clearing the xml out on the close maybe, so that when its re-opened it contains only the new data and image.

Hope that is clear if not let me know

Thanks

Clearing Cach
Is there any code to clear cache on unloading a movie or on browser unload?

I know how to clear cache via browser proerties etc, but i need to know how to do it without allowing all my site browsers doing it manually all the time.

By simply refeshing the browser, does not refresh the swf.


Please Help!!!!!

Clearing The Cache?
Can you clear a client browser's cache on loading a flash movie?

I have a shopping basket that uses Flash as front end and an Access database, using ASP as middle ware.

The basket works fine

My problem is that if a user wants to shop again after checkout, i want them to be able to go back to the start of the movie, but have a refreshed, non cached, version.

My prototype movie shows stock amounts of each individual product. As items are placed in the basket, the stock amounts go down, and up if the user changes their mind. This is all visible on the front end.

Stock amounts are updated on checkout.


After checkout i am using a loadMovieNum instruction to load the same movie again on the same level.

I always recieve a cached version when veiwing in the browser

Any help will be greatly appreciated

Clearing A Picture
Hi,

I would like to start a movie with a completely black screen. As you scroll over the screen, you get a part of the picture. (So you are kind of erasing the black to get to the picture underneath.)

Are there movies out there that do this? What would be the way to do it? (I am thinking mouseover buttons of some sort...)

Thanks for any advice!

Deena

Clearing A Txt Field
g'day can neone tell me if they know of an action whereby i can attach it to an onrelease command to clear a txt field.

i have used a few txt fields (input text fields) in a form using flash five, and would like to have a reset button which clears these fields, is this possable?

look forward to any suggestions

cheers

Assistance In Clearing MC's
Ill simplify me earlier question.
How does one clear a swf loaded movie clip?
I dont want to unload the movie and I dont want to have
the visibility set to nothing.
I tried putting another blank frame in the MC and when i directed to play that frame, the loaded swf was still displayed. Confused. Please help.
Nathan

Clearing Pages
Hi,

I've set up a menu which calls up pages and clears up previous pages. However each time I call up a page I have to clear any possible previous pages.

On clicking the Homepage button it goes to frame 2 of the homepage movie instance which contains information. All other movie instances are made to go to frame 1, which are blanks.

EXAMPLE:
on (release) {
_root.ClimbingPage.gotoAndStop("1");
_root.AbseilingPage.gotoAndStop("1");
_root.OutdoorSkillsPage.gotoAndStop("1");
_root.EventsManagementPage.gotoAndStop("1");
_root.AthletesPage.gotoAndStop("1");
_root.AboutUsPage.gotoAndStop("1");
_root.EmploymentPage.gotoAndStop("1");
_root.PortfolioPage.gotoAndStop("1");
_root.ContactUsPage.gotoAndStop("1");
_root.OurExpeditionsPage.gotoAndStop("1")
_root.HomePage.gotoAndPlay("2");
}

This seems like a really dumbass way of doing it. Can anyone please help?

Cheers

Clearing A Variable
Hi,

in my movie I have a variable called "name".
The user has to fill in the variable.

The movie checks whether the variable is null. If it is it responds: "Please fill in a name".

So far so good!!

But now the user can return and fill in another name.
When I set the variable to null again:

name=null

The code works but the inputfield displays "null"!!!

Is there a way to clear the name variable totally?

Clearing Combo Box
Hey all,
I am trying something so simple yet it seems so complicated! I have a combo box drop down that I would like to clear out. I am loading the list from a PHP script.
I am trying to use removeAll() function and yet its not removing it or sometimes it freezes my combo box.

I have this AS on my button:

on(release) {
_root.dropDown.removeAll();
gotoAndPlay(1);
}

So basically its suppose to clear the combo box, then go back to the first frame and load the variables all over again with the new info from the PHP script...

Help!!

Clearing The Screen?
i am making a movie, where it starts with pictures on the bottom half, and pictures on the tope half. Then when i click "stuff"(button) it will clear the original top pictures, and replace it wit the "stuff" content. I can not get the screen to clear when the button is pressed, it jus shows the original pics, and the "stuff" content on top of it, any ideas on how to clear it?

Clearing The Cache
MX on Mac / internet explorer 5
my flash seems to be choking(slow...frame by frame then stop) on one particular piece of video off my website which plays fine on other computers.
I suspect it has something to do with a corrupt file in my cache.
I emptied IE cache but the problem remains.
Does flash have its own cache somewhere and how do i clear it?
I reinstalled the player but that didn't help..i assume the support files were not replaced...what are the flash player support files and how do i do a clean install?

THANKS

Clearing My SharedObject
I have all these cookies that I have created and I just want to be able to remotely clear them using an external swf. How do I ActionScript that external swf to clear those specific cookies that were created??? Thanks in advance.

Clearing The Cache On A Pc
how do you clear the cache on a pc? (I'm a mac person.)

Clearing A MC With UnloadMovie
I got an instance of a movie clip in my mainmovie. throuhg out the movie I load several clips inside of that MC and also several textFields. I need to clear the clip out so that I can load a new set of clips and text fields. I'm using MovieClip.unloadmovie() and it clears everything but inmediately after I try to attach the new clips and text fields into that movieclip but I think they also get deleted. What's hapening? is the unloadMovie an asyncronous method? How can I get my clip to be clear out of anything inside it so that I can start loading new stuff afterwards? Thanks in advance.

Clearing A Movie ?
Ok i have this interface now, that plays movie clips (Not external) on button clicks. But i have some exit buttons that allow to exit a particular movie clip, and start where it left off. And this is where i don't understand what i should do...

http://www.oricom.ca/komaro/images/Lcar.swf

The engine button has this script:

on (release) {
_root.NEWCOL.gotoAndPlay(2);
}

the exit button in newcol clip, has this:

on (release) {
unloadMovie(this);
}

The problem is when i try to rehit the engine button, Newcol will not play again...this is where i am lost.

Clearing My Interval
I am making this programmatic fade function with paremeters, using an interval. It works, but I son't know how to clear this interval. The actionscript dictionary didn't show how to clear an interval of this type. Please help; Thanks in advance.
Jason

This is my Script:


var increment:Number = 5;
var targetName:MovieClip = circle.circle2;
var newAlpha = 10;
this.circle._alpha=100;
trace(targetName);
//frame Script
stop();
AlphaIt (targetName, 100,0,100,10);
//functions
function FadeIt (targetClip:MovieClip,startA,endA,steps,time){

}
function AlphaIt(targetMc:MovieClip, mSeconds,startAlpha,endAlpha,stepCount) {
aDelta=(endAlpha-startAlpha)/stepCount;
trace("SC"+newAlpha);
newAlpha=startAlpha;
setInterval(function () {
setAlpha(targetMc);
if (newAlpha == endAlpha) {
clearInterval(this);
} else {
newAlpha+=aDelta;
}
}, mSeconds);
}
function setAlpha (tMc:MovieClip){
trace("ok: " +newAlpha);
tMc._alpha = newAlpha;
}

Clearing FLV Using Netstream
Hi there.

Just put a new site up: www.faithsfx.co.uk which uses flv's in the video section.
Can't work out how to unload an FLV once it has started playing. If someone plays an MP3 on the site, I need the FLV to close the stream and unload.

At the moment, I am getting around it by loading another blank 1 frame long flv, but I would really like to know how to do it properly.

Thanks

Memory Clearing
hi,

I imported a few video files into the library and then deleted them from there, but the flash file size is still huge.

Is there some kind of clipboard in Flash? If so, how can I clear it?

thanks

Nurzik

[F8] Clearing Variables...
I am working on a complex flash game with code everywhere that is un-organized, and same with all of the movie clips.

I was wondering if there was a way to clear all of the variables and movie clips on the stage.

This would also be a help for a flash movie I have that adds a new instance of a movie like copy paste on its own, and I'd like to be able to restart it once it fills up the screen, but adding code to each movie clip to unload it once it is done would be so tedious. There has got to be a better way.

[F8] Cache Clearing
Quickie: I'm testing out some stuff involving loading large files in remotely (namely music and video) and to do this I need to actually have it reload each time, not just pull it out of the cache, is there any way to clear that out of the flash player?

Thanksya

-SG

ClearInterval Not Clearing
Help.

I have a main timeline with buttons. Each button goes to a specific frame in the timeline.

In the first frame only is a Movie clip. This movie clip (movie1_mc) is an animation that uses functions to pause in its own timeline for a few seconds. Thus, the animation will play until it reaches a pause function, waits 6 seconds and plays onto the next pause function.

However, I cannot get this animation to stop when I am in the main timeline. I'd like it to stop when a button from the main timeline is used to advance to a frame in the main timeline.

For instance, if I my button advances me to frame 10 in the main timeline, all is fine until the movie1_mc starts playing again. It will pop into view and run a random speeds.

Below is the script used in frames within the mc.


function hold() {

gotoAndPlay("one");///This gotoAnd Play advances the movie1_mc timeline to the next interval stop.

clearInterval(delayID);

}

var delayID = setInterval(hold, 6000);
stop();


Any help is appreciated.

[MX] Clearing A Textfield
Hello,

Here is what I am after. I am creating a simple login with only a password box. If the password is wrong I have a dynamic textbox saying it's incorrect. I'm trying to make the dynamic text clear itself when the user clears the password box and starts typing again. The only reason I'm wanting this done is so the phrase "incorrect password" isn't sitting there constantly. I've tried using the setFocus and getFocus properties to then clear my variable for the dynamic text. I even tried onKillFocus thinking that might get me what I'm after. None of this cleared the text. Any help would be appreciated. Thanks in advance.

Mo

Clearing A Form
Hi all,

I was wondering if someone could help me I have a form on my site and want it to clear after its submited and anyone tell me the script for this and where to implement it, here is the curent script:

on (release)
{
if ((upload_data.selected == true) || (brochure_request.selected == true))
{
if (CName.length < 3 || Phone.length < 5)
{
ContactStatus = "please fill required fields";
} else
{
if (brochure_request.selected == true)
{
newsletter = "";
loadVariablesNum ("index.php", "0", "POST");
ContactStatus = "Your request has been delivered and will be actioned shortly";
}
if (upload_data.selected == true)
{
getURL("upload_page.php?up=yes&name="+Name+"&cname ="+CName+"&phone="+Phone+"&email="+Email+"&address ="+Address+"&comm="+Comments,blank);
}
}
} else
{
ContactStatus = "please check one of the radio buttons";
}
}

Clearing Form
Hi,

I am trying to clear a form after i click on the submitt button, the button is from the components library and everything works but after i click on it the form doesn't refresh, can anyone help with that?

Clearing A TextArea
is there anyway to clear the contents of a TextArea?

Or should I be using a different component if I want to completely update the contents...

been using flash for about 2 days btw.. :$

thanks in advance

Clearing Cache
Hi guys, some quick help/advice needed.

I've done a search through various forums but haven't found the answer yet. I have a website (http:://www.cmykreative.com) that has 1 main .swf file that loads various other .swf files one after the other when it has finished playing using:

onFrame (60)
{
loadMovie("http://www.cmykreative.com/cmyk_banners/cmyk_intro_02.swf");
}

My query is this . . . when I make changes to the 02.swf, 03.swf files they don't show in the browser as it is still caching the previous versions. Manually clearing the cache allows the first .swf file to show but it continues to show the older versions of subsequent files.

Is there some coding I can put in that 'forces' the browser to NOT cache any of the .swf files OR that clears the cache automatically before loading. I am often making changes to these files and it's becoming a pain now!

Any ideas?

Chris
chris@cmykreative.com

P.S. . . . the original files were created using SwishMax . . .

[CS3] Clearing The Stage
I have a series of objects I have added to the stage. There can possible be 14 or less of them. They are called card1, card2, etc. When the game is over I want to clear all of these from the stage but don't know how to do it sense I don't know how many will be loaded sense it determines on how the game goes. Heres what I tried to do but I don't know how to really do it.

function clearView():void
{
for (var i:uint = 0; i < cardsOut; i++)
{
removeChild(card[i]);
}
}

[CS3] Clearing A Form
I have built a form using Flash CS3. I have the text boxes set as the Input Text type and all of them have both instance and variable names. For example, the first name box is fname and last name box is lname for both the instance and the var.

When I publish the form, the text boxes display the following:
"_level0.application.form1.fname" for the first name box, and
"_level0.application.form1.lname" for the last name box

Originally, I tried clearing the text fields when the form loaded with the following:
onClipEvent (load) {
_parent.fname = "";
_parent.lname = "";
}

That worked. But, for some reason, it disabled the ability for the user to tab between fields. Tabbing would accomplish nothing and made filling out the form slightly more tedious. Also, leaving the var name and clearing the instance name does the same thing.

Any ideas on what's causing it to post this text when it loads? Or on another way to clear the text boxes when the form loads? I've also tried messing with maxChars and restricting the type of characters; but, because it is a script inserting the text and not a user, it has no effect.

Any help is appreciated. Thanks in advance.

[F8] Clearing The Stage
Hi

I have this vague feeling that I came across a as2 function that would clear the stage completely.

I have tried searching the help files, but can't find anything?

Was it just a dream?

thanks

E

Clearing IE Cache
I saw somebody posting this same thing but nobody responded. is there a way to clear IE cache with actionscript? Thanks in advanced for the replys

J

Clearing All Movieclips At Once
i'm having trouble removing the movieclip from the stage when i move to next frame...

for example... i've attached the 30 movieclips on frame A...
but when i go to frame B, the 30 different movieclips are still there playing...

how do i remove them all before i move to frame B?

Clearing Timeouts
I have a Story-like flash animation, the story contains several events and in each event there are some settimeout-delays to trigger some actions to go with the narrator.

Then I have a "chapter selection" where you can jump to an events. Now if I watch a event number 2 and then decide to jump to event 4, the settimeouts that was declared in event 2 are still going :S

So I'll need some kind of a supercommand that I can call when the user jumps between events that clears ALL timeouts at the moment.

Any advice?

Components Not Clearing?
I ran into a problem yesterday dealing with components and thought that I would post. I had a hard time finding anything on the subject so I am hoping this may help someone else.

I had made a small movie, somewhat of a slideshow that was around 8 frames long. Basically you would advance in the slide show and also have the option to return to the previous step. Some of the slides contained the checkbox component.

When getting to the end of the slide show and then going backward through it I noticed the component checkbox was not clearing the stage and therefore interfering with content on previous slides.

The solution was that I had not yet given instance names to each of the components. Once I named them they cleared the stage with no problem. This may be common knowledge but thought I could share any way! Hope it helps someone.

Label Clearing
I need to place theCode information in a label. It works fine the first time, but once the information changes the new information goes right on top of the old information. Is there some how I can clear the label before the new information goes on to the label? I tried to clear the label before each time by 'theLabel.text = "";' method, but that doesn't seem to be working.

// The Label
var theLabel:Label = new Label();
theLabel.text = "";
theLabel.move(180,40);
theLabel.autoSize = "left";
theLabel.selectable = true;
addChild(theLabel)

if (theLabel.text == ""){
theLabel.text = theCode;
}

Clearing A Video
I have a script that loads in an external flv file.

i can remove the instance of _video from the stage, however i cant seem to reference it properly in order to clear its NetStream.

Here's the code:


Code:
package {

import flash.display.*;
import flash.net.*;
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.media.*;
import flash.geom.*;

public class MainStageDocCLass extends MovieClip {


private var _localConnection:LocalConnection;
public var myLoader:Loader = new Loader();
var nc:NetConnection = new NetConnection();
private var _video:Video = new Video(532,272);





public function MainStageDocCLass() {

try {
_localConnection = new LocalConnection;
_localConnection.connect( "sfgovChannel");
_localConnection.client = this;
} catch (err:Error) {/*NULL*/
}

loadHomeNav();
trace("MainStageDocCLass.as has loaded");
}

public function loadItems(clip:String, xpos:uint, ypos:uint):void {
var myLoader:Loader = new Loader();
addChild(myLoader);
myLoader.load(new URLRequest(clip));
myLoader.x = xpos;
myLoader.y = ypos;
}

public function loadVideo() {
loadItems("AgencyContent/OfficeContent/Topic1/SectionA/CloseMovieClip.swf", 0, 325);
addChild(_video);
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
function onStatusEvent(stat:Object):void {
trace(stat.info.code);
}
var meta:Object = new Object();
meta.onMetaData = function(meta:Object)
{
trace(meta.duration);
};
ns.client = meta;
_video.attachNetStream(ns);
ns.play("example.flv");

}

public function closeMovies() {
_video.clear();
nc.close();
removeChild(_video);
trace("closeMovies success");
}


}
}
im pretty sure i need to issue ns.close(); but i dont know how to access it from a different method.

ns.close(); gives me Access of undefined property ns

Help Clearing A MovieClip
Hi i am new to actionscript. I've created a movieclip and i'e copied an image over to the movieclip. I want to clear the movie clip so i can copy another image to it. is there anyway this can be done? ive tried MovieClip.graphics.clear(); but this does not do anything..

Help Clearing Xml From Cache
Hi all,
I have a movie (interactive.swf) which loads a an intercative map.(mapa.swf) When you pass over a sector of the map, (the big dark green sector from the bottom left ) a telephone number is diplayed. It works, but if you reload the movie , then nothing happens. I supose it must be cache matters. Please, how do I fix it?? Thanks a lot for your help cause Ive tried everything and nothing works.
thanks again!

Clearing Xml And Swf Cache?
Hi folks from Actionscript.org! This is the first time I post here, and certainly not my last. Perhaps I'll be able to contribute my knowledge as time goes on, but for now I do have a particular question.

I have a website that is currently all flash-based. Unfortunately if you return to that website, it won't change a thing until you delete your temporary internet files, being that it is flash. So for every update, I have a new .swf file ie: 2801091.swf and this works perfectly fine. However when you enter the calendar, it loads the .xml file but it's always what's been cached.

Is there a way...
1) Everything about the flash file can be revised if it's the newest version so dated .swf files aren't created every time there's an update?

2) A way to clear the .xml cache or refresh it every time the calendar is opened?

The file itself is at scelf.org for a better understanding.

Thank you!

Copyright © 2005-08 www.BigResource.com, All rights reserved