Scrollpane Content
i have a movie clip with a scrollPane name "scrollPane1" after loading a movie clip "my_mc" into the scrollpane using the method scrollPane1.contentPath="my_mc" i want to add certain onclick and onrollover events to the components of the "my_mc" movie clip it is all being done on the fly and loads from dynamic set of data...can some one tell me some way by which i can access a button name "button1 " which is inside the movie clip "my_mc" which is placed in the scrollPane "scrollPane1".... Hope this thing has a work around and some one knows it.....Hoping for a reply soon
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 12-06-2004, 06:07 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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
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
Scrollpane Set Content ?
Is there a command to set the content of Scrollpane by Actionscript, and also how to detect when it loads completely. I'm having problems with it spilling out the content over its borders. I saw an idea to load the file in a Loader component wait for it to finish loading then load it into Scrollpane but don't know how to set the content in actionscript.
ScrollPane Content
Hi i am trying to take data that i recieve from a database and put
that data into a scroll pane. I can recieve the data fine and put it
on the page, but how can i add this to a scrollpane? here is my code
to get the data on the page.
function getShirts_Result(rs){
cant = rs.result.length //how many rows are in our recordset?
for(var i=0; i<cant; i++){
//Dinamyc put base on stage and fetch data to it
attachMovie("base", "base"+i, i, {_x:(300*(i%2))+250,_y:
425+(350*int(i/2))})
this["base"+i].ShirtName_txt.text =
rs.result.getItemAt(i).Name
this["base"+i].ShirtPrice_txt.text =
rs.result.getItemAt(i).Price
this["base"+i].ShirtPicture_ld.loadMovie(rs.result.getItemAt(i).Picture1)
}
}
ok so you can probably tell, but the movie clip base needs to be
loaded into the scrollpane and then the two text blocks and the loader
need to recieve the data from the db .
thanks for any help i have been trying to work this out, but nothing
shows up inside the scrollpane.
Scrollpane Content
i have a movie clip with a scrollPane name "scrollPane1"
after loading a movie clip "my_mc" into the scrollpane using the method scrollPane1.contentPath="my_mc" i want to add certain onclick and onrollover events to the components of the "my_mc" movie clip it is all being done on the fly and loads from dynamic set of data...can some one tell me some way by which i can access a button name "button1 " which is inside the movie clip "my_mc" which is placed in the scrollPane "scrollPane1"....
Hope this thing has a work around and some one knows it.....Hoping for a reply soon
Scrollpane Content Too Big ~PLEASE HELP
Hi, frist time poster here. I have a limited knowledge of flash so please forgive me. Im doing a photography portfolio and i have a scrollpane which refuses to display the entire content. I created a jpg 480x3000px with all the images side by side. However the scrollpane only displays half of this. The scroll slider moves to the very end, but there is still over half the image left undisplayed. Is there any actionscript that will fix this? Ive spent all day online looking for the answer please, any help would be incredibly useful.
ScrollPane Content Not In The Frame?
I am trying to dynamically create the content inside a Scroll Pane, but when the movie clip inside is has other movie clips attached to it, the content comes out of the frame. The scroll bars still move it up and down, but outside of the content frame, like it is on another layer.
I am refreshing the content of the frame, but it can't seem to handle it when the Movie clip inside of it changes due to attachmovie or duplicateMovieClip?
help!?
Content Of Scrollpane Component
I have this code i my scrollpane content movieclip:
for (i=1; i<=12; i++) {
attachMovie("linkname", "att"+[i], i);
setProperty("att"+[i], _x, i*80);
loadMovie("picture.jpg", "att"+[i])
}
OBS!! "att"+ is "att"+ [ i ] ...
I want the code to generate 12 movie clips called att1 to 12, all of them containing the 'picture.jpg'
And the scroller it self should only be able to display 5 instenses at a time.
When I do this, - I get NO scrolbars eventhough they are both set to 'auto'
Can anybody help me please??
Regards
Godowsky
Getting That Content Into The Scrollpane Component
Okay, - I try this question again...
Maybe this time I'm able to make it simple.
I have a contentmovie clip that is 'linked' to the scrollpane component, - in properties of the component Scroll content has the name of my contentmovie clip.
Okay, - If I place 5 movieclip instences in the contentmovie clip I get a perfect scroller, - BUT if I want to place the 5 movieclips dynamically, - it doesn't work.
SO my question is:
Who do I dynamically place content (movieclips) in the contentmovie clip of my scrollpane component.
Thanks
Godowsky
Scrollpane And LoadScroll Content Too Big?
Can't seem to figure out a problem I have with Scroll pane - basically I'm loading a swf into it. The size of the swf is larger than the Scrollpane. It loads in fine, but it loads in larger than the scrollpane itself - ie outside of it.
It only happens if I load it from a web server ie http:// address. If I load it locally it fits in fine.
I've tried different web servers too. Also tried it with JPGs and the same thing happens.
I've also installed the latest player into MX. Still the same.
I've seen a few people with the same problem but I can't seem to find the solution.
Any ideas?
Printing Content Of Scrollpane
Hi,
I have not found the relevant info in trying to print the content of a scrollpane. There is a JPEG converted into a clip. I have tried to use the #p on the frame I want to be printed, then I have placed a button on the main timeline targeting the "bmovie". when I print, I get an image of the interface and my scroll pane ..... How do u only print the content of the ScrollPane?
Many thanks,
Luke
Dynamic Content In A Scrollpane?
Hey all;
Here's what I would like to do, and I want to know the best way to do it:
I'm trying to make a movie that will display jpgs and text. The text describes each jpg. Its sort of a catalog, but without the ability to purchase. Simply shows a jpg of the product, and then some descriptive text next to it. This movie will get loaded into the main swf that contains the rest of the site.
I would like to be able to load these dynamically, and I would like it to be linked/referenced to/from either a txt or xml file, so that I can add new groups of jpgs and text easily.
The area I have to work with to display all this is 320x320px. So I was thinking a scrollpane would work best for displaying it all, but I'm not sure so....thats why I'm asking here.
Also, I'm not real familiar with the inner workings of the scrollpane, so any suggestions are greatly appreciated.
Thanks to all in advance.
Restricting Scrollpane Content?
I have a scrollpane created by script. Then the content of the scrollpane is created by script, which is a bunch of text fields attached to a mc. Then the content (mc) is assigned to the scrollpane. This works, but the content (rows of text fields)overflows the boundries of the scrollpane. How can I get the content to stay within the area of the scrollpane, and still be scrollable? Please help, I've searched the posts and can't find anything that adresses this.
//1
this.attachMovie("FScrollPaneSymbol", "myScrollPane_sp", 45);
this.myScrollPane_sp._x = 190
this.myScrollPane_sp._y = 125
this.myScrollPane_sp.setSize(594, 320);
this.myScrollPane_sp.setDragContent(false)
this.myScrollPane_sp.setVScroll("auto")
this.myScrollPane_sp.setHScroll(false)
//2
this.createEmptyMovieClip("blank_mc", 50)
var c = 1
var newY = 5
var theHeight = 50
var theName = "textbox_txt" + c
for (x = 0; x < 10; x++ ) {
this.blank_mc. createTextField(theName,100+c,5,newY,575,theHeight
);
//x,y coordinates are relative to reg pt of mc.
this.blank_mc[theName].border = true
this.blank_mc[theName].text = c + ". " + "Hello";
//calc next placement for next text field
newY += (theHeight + 5)
c++
var theName = "textbox_txt" + c
//reassign name
}
//3
this.myScrollPane_sp.setScrollContent(blank_mc);
//leave off quotes to use 'value' of mc
Changing Scrollpane Content
Hi everyone. I'm sure this is possible in some way but could anyone tell me how please?
I have a scrollpane displaying buttons and mcs inside. What I want to do is to be able to click buttons, which are inside the scrollpane, to change the content of the scrollpane.
1. I don't want to delete the scrollpane but just change the things inside.
2. Button determines the scrollpane content
I was thinking on the lines shown below which basically says when pressing a button go to layer2 but I'm sure this is not enough.
_level0.paneContent["button" + id].onRelease = function () {
gotoAndPlay("layer2");
}
Pre-loading Scrollpane Content
Hi
I've got a pretty simple movie.
2 scenes
second scene has scrollpane, to load external swf as content.
I have an action layer with this.
eggs_sp.loadScrollContent("eggs000.swf");
Works fine.
The first scene is to be the preloader.
with this script running the show.
if (eggs_sp._framesloaded >= _totalframes) {
gotoAndPlay ("Scene 2", "1");
} else {
total_bytes = eggs_sp._framesloaded.getBytesTotal();
loaded_bytes = eggs_sp._framesloaded.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
}
This is not working.
Help!
Thanks in advance
eggs
ScrollPane With Dynamic Content
well,
i want to show a movie clip with dynamic content in a scrollpane,
when i see it in my computer , its good , but in the internet
the content does not fit in the scroll pane, and it size is more than scroll pane and it fall outside of scroll pane,
and scroll pane's scrollbar does not appear,
what should i do ?!
thanks
Scrollpane Content Problems - Please Help
I am a newbie to Flash and am working in MX (not MX 2004). I am trying to use setScrollPosition to control the horizontal position of an SWF that is loaded with loadScrollContent into a scrollPane in the main flash movie. I want to control this scrolling with buttons that are on the main movie level.
Is this possible? I feel I am missing something basic here. I tried applying code like this to a button that I wanted to control the content's position with :
on (release) { contentpane.setScrollPosition(380,0);
}
I was hoping that upon clicking the button the loaded content inside the scrollpane would scroll to the position of (380,0) relative to the position of the scrollpane. But it just didn't work when i tested it. No movement at all. Will someone please tell me what I am doing wrong?
Also, will this cause the content in the scrollPane to jump to the new location or visibly scroll/slide to it? I wish to produce a visible scrolling effect.
thanks very much in advance to anyone who replies
- (a very frustrated) shadedblue
Scrollpane Content Alignment?
How do I align the content of scrollpanes? When I put sumthing in a movie clip and link the MC to the scrollpane, the MC scrolls but it automatically puts it up against the top left of the pain instead of in the center like i want it.
Draggable Content Scrollpane.
ok for some reason all the stuff inside of my scrollpane is draggable, how do i diable that, also i can click any of the buttons or anything inside of it for some reason.
Centering Content In Scrollpane
i notice whenever i make content in a scrollpane, and the scrollpane size is wider than the content is, the content will justify on either the right or left side of the pane. is there any way to center the content?
Targeting ScrollPane Content
Hey everyone,
I have a scrollPane on the root timeline along with the main movie control buttons.
The scrollPane parameter is set to import a movieclip that has its own buttons and is is basically representing a Web page for training purposes.
Does anyone know how to get the buttons in the scrollPane movieclip to tab in sequence with the main control buttons on the root timeline?
I'm at a total loss, and beginning to think it's not possible.
Scrollpane Content Lock
is there a way to lock the content of a scrollpane when both scrollpolicies are set to off? I don't want the user to be able to drag the content past its boundaries. thanks
phar
<< SCROLLPANE External Content BUG
I have main movie called - 13e.swf
This loads a scrollpane movie - content_main.swf
with contentpath = - pane_menu.swf
into MC - mvmain
All this works fine offline ,
when online it has the MX MAJOR BUG porblem of loading
it too slow for the scrollpane to calculate
so it overlaps the scrollbox size.
(even if extrenal swf is 1k).
I have tried preloader... no good or send me one that
waits till all is loaded then shows up in scrollpane
working online.
(an example of working scrollpane online would
be a novel experience too )
I have read through some similar posts but still im
not able to make it work.
Please show me a fix for this.
are there any other available 3rd party scrollpane
compnents that scroll and load external.swf and works.
I have heard about the scrollpane refresh fix.
but im novis at actionscript and i cant figure it out.
please show an example and where to put it on my movie
and how i can determine when the full content of the
swf has loaded for it to refresh at the righ time.
and not give me a garbled scrollpane result.
macromedia should have a notice saying
SCROLLPANE NOT USALBLE STAY AWAY !!!!
thank you !
windows xp
flash mx 2004
im going to lay down and cry now... !!!
ScrollPane And Dynamic Content
i want to make a dynamic content that will be loaded into a scrollpane like in the attched exmple.jpg
i need an unknown number of line where in each line i have (like in the example.gif)
an image and then a text an between each 2 ines i have a long seperating line!
how do i do this?
thnaks in advance
peleg
Preloader For Scrollpane Content?
Hello (again) again.
I've nearly wrapped up this magazine project I'm working on, but there's one last thing that's defeating me.
This is how my movie's set up: On the main timeline I have a small magazine, produced with the FlippingBook component. Below that is a menu bar. On the level above, with its ._visible property initially set to false, is a scrollpane that loads in a larger version of the current page when the smaller instance is clicked. Off the left-hand side of the stage is a larger scrollpane, called "printLoader", that loads in the saame file as the scrollpane on the main stage but at full size, so it can be printed without cropping. This all works fine.
Then, the client wanted a preloader bar (and the print button disabled until the external .swf had finished loading). This works - at least with the first page loaded into the scrollpane. The problem seems to be that the external .swf is staying in the scrollPane when the preloader is called, and it's referencing the first (or current) one loaded rather than the new one that's replacing it. I tried putting the preloaders into the external files themselves, but they get printed along with the main frame (even though they don't have a #p label on them).
So: How can I make sure the external .swf is unloaded? And how can I make the preloader check the bytesLoaded and bytesTotal of the movie that's in the scrollpane?
Cheers!
How To Change ScrollPane.content
I have a Scrollpane component instance in which I use the following code to set its contents:
Code:
var GalleryMC = ScrollPane.content.createEmptyMovieClip("Gallery"+Gallery.id, i);
This works perfectly, however, later on during the movie I would like to change the content of the Scrollpane to a different, existing movie clip... Theoretically, the code would look like this:
Code:
ScrollPane.content = MCInstance;
However, this doens't work. Does anyone know how to assign a different, existing MovieClip Instance to the content of a ScrollPane?
Thanks in advance for any help!
Aaron
Preload Scrollpane Content
Hi everyone, can anyone tell me how to preload the content that shows up in my scroll pane.
look at my site and click on stores, you will see that it is delayed quite a bit, how do I speed that up?
http://www.blueholdings.com/fla/splash-clear3.html
thanks
Simone
ScrollPane Not Scrolling My Content
Code:
System.security.allowDomain("http://www.helpexamples.com");
this.createClassObject(mx.containers.ScrollPane, "my_sp", 20);
my_sp.move(50, 30);
my_sp.setSize(180, 160);
my_sp.contentPath = "http://www.helpexamples.com/flash/images/image2.jpg";
my_sp.createTextField("txt",10,10,10,100,100);
my_sp.txt.text="asdasdas";
This code is scrolling the picture but is not scrolling the text field! Please hel me!
Scrollpane Dynamic MC For Content
I am working on a nav bar. I dynmicaly create a movie clip. Then I dynamicaly create the button components in that movie clip. I then want this to be in the scrollpan. However I can not get it to work. I found that you can do with setScrollContent(myMC) However when I enter that code flash does not recognize that function. It is not in my docs. yet I find it on macromedia site http://www.macromedia.com/support/fl...ionary328.html
what am I doing wrong please help
Code:
this.createEmptyMovieClip("menuBTN",getNextHighestDepth());
btnY=0
for(i=0;i<10;i++){
menuBTN.createClassObject(mx.controls.Button, "button"+i, getNextHighestDepth()+i, {label:"Test Button"});
menuBTN["button"+i]._y=btnY;
btnY+=22;
}
this.createClassObject(mx.containers.ScrollPane, "menu", 10);
menu.setSize(132, 158);
menu.contentPath(menuBTN)
// Create listener object for scroll vertical position.
var scrollListener:Object = new Object();
scrollListener.scroll = function(evt_obj:Object) {
trace("hPosition: " + menu.hPosition + ", vPosition = " + menu.vPosition);
};
// Add listener.
menu.addEventListener("scroll", scrollListener);
Scrollpane Content And For Loop
Hello.
I am having trouble using a for loop to populate a scrollpane. I can get one swf loaded in just fine. Does anyone have a good link on how to get multiple swfs into the scrollpane component (Studio 8)? I am using contentPath currently.
Thanks,
1M.
Print ScrollPane Content?
I'm trying to figure out why I can't print a loaded form correctly. I have the print button on the form swf itself, instructing to print the content on it's page.
I have a main SWF that loads a SWF, that loaded SWF then loads the form SWF I want to print in a scrollPane. It prints perfectly when I test the form SWF, but when I load it into my project, it is a mess. I see some of the content from the form, so I know it's targeting the right content, but it's mangled.
This is what I have for my print function:
printMe.addEventListener(MouseEvent.CLICK, printPage);
printMe.buttonMode = true;
function printPage(event:MouseEvent):void
{
var myPrintJob:PrintJob = new PrintJob();
myPrintJob.start();
myForm.scaleX = .85;
myForm.scaleY = .85;
var theForm:Sprite = myForm as Sprite;
myPrintJob.addPage(theForm);
myPrintJob.send();
myForm.scaleX = 1;
myForm.scaleY = 1;
myPrintJob = null;
}
Am I going about this the wrong way?
Thanks!
Change Scrollpane Content To Different Mc
Hello. I currently have my scrollpane working fine. I have a movieclip dragged onto the stage where my scrollpane is and i use this code:
Code:
mcpane.source = aboutcontent;
aboutcontent.x = -50
aboutcontent.y = 20
however, now i would like to put links at the top. When i click on the link, the content of the scrollpane changes to another movie clip.
How can i do this? Do i need to drag all of the movieclips onto the stage?
How do i remove the old content, and then load the new content from a mc into the pane?
Thank so much for any help
regards,
J
Can I Use LoadMovie To Set ScrollPane Content?
i'm trying to load external swf files into a scrollpane. i'm using the loadMovie command, but when i do , the content extends outside the scrollPane (no scrolling happens). how can i get around this in the simplest manner?
thanks.
morgan
Scrollpane Content Overflow
The situation which I have run into is this.
I have have a set of scroll panes on a site and when the scrollpane is loaded, sometimes its content overflows the boundries of the sroll pane itself, and sometimes the scroll pane doesn't show up at all. It is a very basic setup where I am simply specifying the external swf to load into the scroll pane through the component's parameters window. This issue only appears in IE not in Firefox. It also does not happen every single time, but enough that it isn't acceptable for our needs for this site. If the scroll pane is loaded a second time by leaving and coming back into that section, then the scroll pane works , but the issue appears pretty consistently the first time the scroll pane is ever hit. I have seen many similar issues people have hit to this, and alot of "fixes" but none seem to be helping our situation. If anyone knows a sure fire way , or a way that has helped them fix this issue, I would greatly appreciate the help.
Thanks in advance.
Pete
Scrollpane Content Issue
I am using flash pro 8.
The scrollpane is on the stage and the content path is set to songButtons_mc, the name of the movie clip that loads into it.
In the first frame of the songButtons movie clip, I have placed the following code in an actions layer:
function playSong (mc:String,sLabel) {
eval(mc+'_btn').onRelease = function() {
_root.gotoAndStop(sLabel);
}
}
the scrollpane component with this code works perfectly until the movie is loaded into another .swf movie, then nothing works.
How do I get this to work? I am new to using components.
Thanks in advance for your help.
Mark
Scrollpane Cuts Off Content
http://www.flashteam.org
I have a scrollpane on each page and it cuts off the content on every single one. The scrollpane links to a movie clip from the library. As you can see, the scrollpane cuts the content off and leaves a 100 px by 100 px box which is completely useless. I need the whole content to be displayed, and it is really frustrating because there is no logical reason why it shouldn't do what I want it to. I am sorry, but Flash 8 has proven to be inconsistent and buggy. I searched Google on the issue and found nothing that helps.
Upon visiting the site, "about" page will load correctly, but clicking on the buttons to go to other pages will bring up the buggy scrollpane. If you also notice, hovering over the buttons to make the color shoot up will cause part of the scrollpane to appear (buggy). Please help. I can provide the .fla file if needed.
I will give anyone who solves this problem free web hosting for 6 months.
Scrollpane Content Not Responding
I have content in a scrollpane which I would like users to be able to drag (content is larger than the pane). There are also rollover areas in the content that are only accessable when scrolldrag is false (makes sense). So, I've set the scrollpane scrolldrag property to false until the user presses the Ctrl key:
//Listener for Ctrl key to allow drag
createEmptyMovieClip('_keyListener',999);
Key.addListener(_keyListener);
_keyListener.onKeyDown=function(){
if (Key.getCode() == 17) {
spFloorplan.scrollDrag = true;
}
}
_keyListener.onKeyUp=function(){
if (Key.getCode() == 17) {
spFloorplan.scrollDrag = false;
}
}
Unfortunately, once the Ctrl key is pressed and released, the content is no longer responding to onRollOver events. I've tried doing a setFocus on the content, redraw on the scrollpane; nothing seems to get back to the initial state. Help!
Jeff
ScrollPane.content.addChild
I have a scrollPane on my stage, linked to an emptyClip. I am trying to dynamically add clips to this scroll pane, but ScrollPane.content.addChild gives me:
1061: Call to a possibly undefined method addChild through a reference with static type flash.displayisplayObject.
ScrollPane.content.addChild segment is part of the document class.
Refresh A ScrollPane Content
Hi, I use a scrollPane component and the content of my component is dynamic.
I'd like to refresh my scrollPane scroll bar in order to scroll my content correctly.
I import a clip in my scrollPane. There's nothing in this clip. After that i create a dynamic menu (like a tree) in this clip. The problem is that the scrollBar never appear because initialy the clip imported is empty.
Thanks for your help
ScrollPane Source Content
I have a couple of different sprites with text inputs and text fields placed inside of them
and I have a scrollpane that I use to display the the different sprites.
the first time I set the source of the scrollpane to oone of the sprites it works fine, but when I set the source
of the scrollpane back to the sprite the size of the sprite is slightly smaller so now part of it is cut of.
AS3 ScrollPane: Switching Content
It seems I've come across a curious question that I've not been able to definitively answer myself, so I thought I'd post it and see if anyone bites.
When using a ScrollPane component (AS3) you can utilize either the load() method or change the .source property to modify the content of the pane. To load another swf or image, there's no question I'd use the load() method.
But what if I want to switch the content of the pane to a MovieClip class in my library? Do I use the load() method or just change the .source property with the name of the MovieClip class I want to appear within the pane? I'd love to be able to use the load() method, but it's first parameter requires a URLRequest object ("The request parameter of this method accepts only a URLRequest object whose source property contains a string, a class, or a URLRequest object.")
How can you specify a class in a URLRequst object?
The ultimate goal here is to have the complete event fire when I change content which can then invoke a handler to essentially reset the ScrollPane instance.
So what's the right thing to do here? Use the load() method or change the .source property when utilizing an internal MovieClip class from the library as ScrollPane content?
Edited: 04/24/2008 at 09:43:22 AM by jasonLampitt
Print ScrollPane Content
I'm trying to figure out why I can't print a loaded form correctly. I have the print button on the form swf itself, instructing to print the content on it's page.
I have a main SWF that loads a SWF, that loaded SWF then loads the form SWF I want to print in a scrollPane. It prints perfectly when I test the form SWF, but when I load it into my project, it is a mess. I see some of the content from the form, so I know it's targeting the right content, but it's mangled.
This is what I have for my print function:
printMe.addEventListener(MouseEvent.CLICK, printPage);
printMe.buttonMode = true;
function printPage(event:MouseEvent):void
{
var myPrintJob:PrintJob = new PrintJob();
myPrintJob.start();
myForm.scaleX = .85;
myForm.scaleY = .85;
var theForm:Sprite = myForm as Sprite;
myPrintJob.addPage(theForm);
myPrintJob.send();
myForm.scaleX = 1;
myForm.scaleY = 1;
myPrintJob = null;
}
Am I going about this the wrong way?
Thanks!
Add Dynamic Content To ScrollPane
I have created a Address Class that uses Remote Hosting to get addresses for site locations and creates the appropriate listings in a MovieClip.
I am trying to use this class as the source for a scroll pane inside another movie clip.
I get the site locations to show up in the scrollPane but they will not scroll.
I believe I need to pause some how in the constructor until I have all the site addresses created.
Anyone know how I would do that or know how to get the scrollpane to scroll.
Thanks
Adam
Here are some snippets
The container MovieClip
import FlashCFMXApplication.AL_Addresses;
import fl.containers.ScrollPane;
var scrollPane:ScrollPane;
scrollPane = new ScrollPane;
scrollPane.scrollDrag = true;
scrollPane.width = 270;
scrollPane.height = 380;
scrollPane.y = -180;
scrollPane.source = new AL_Addresses;
addChild(scrollPane);
stop();
AL_Addresses.as
package FlashCFMXApplication{
import flash.display.Sprite
public class AL_Addresses extends Sprite
{
import flash.display.*;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.net.Responder;
import fl.data.DataProvider;
import FlashCFMXApplication.ArrayCollectionDP
private var siteTitleFormat:TextFormat;
private var siteCityFormat:TextFormat;
private var requestObject = new Object;
private var getStateSites = new Responder(getSites, onFault);
private var getStats = new Responder(getSiteStats, onFault);
public var maxWidth:int;
public var Addresses_mc = new MovieClip();
public var getStateSites_mc:MovieClip;
public var box:Shape = new Shape();
public function AL_Addresses() {
import flash.net.NetConnection;
var myService:NetConnection;
myService = new NetConnection();
//set encoding to AMF0 for complex objects
myService.objectEncoding = 0;
myService.connect("
How To Drag Out The Content From The Scrollpane?
in my writing.fla file, I want to drag out the strokes from the scrollpane to the box on the right. However, I have no idea on why the stroke cannot be dragged out the scrollpane.
Anybody know the solution?
|