Help Needed With Scripting and Error Messages
I am working to build a script to change orders in SAP using Java. I begun by recording steps and combining them. I am having issues with the Warning and Error Messages. Can someone help me write language to have the script enter through the warnings or errors if they pop up, but move to the next step if nothing pops up?? Some orders have the message, some do not, some have multiples... etc...
Thanks!!
Hello Jamie.
Getting popup you can use an Loop like below (this is now for Excel VBA coded):
For Each subWindow In Session.Children
If subWindow.Name = "wnd[1]" Then
On Error Resume Next
Session.FindById("wnd[1]").sendVKey 0
Session.FindById("wnd[1]/usr/btnANSWER_YES").press
Session.FindById("wnd[1]/usr/btnSPOP-OPTION2").press
End If
Next
For Messages in SAP session statusbar like this:
If Session.FindById("wnd[0]/sbar").Text <> "" Then ...
To catch error Messages defined by messagetype you can use this:
If Session.FindById("wnd[0]/sbar").messagetype = "S" Then ... 'sucess messagetype
If Session.FindById("wnd[0]/sbar").messagetype = "I" Then ... 'Information messagetype
If Session.FindById("wnd[0]/sbar").messagetype = "E" Then ... 'Error messagetype
Aso...like we have in SAP
Hope this help a bit to achieve your requirements.
Best regards,
Holger
Similar Messages
-
Help needed with header and upload onto business catalyst
Can someone help with a problem over a header please?
I have inserted a rectangle with a jpeg image in background, in the 'header' section, underneath the menu. It comes up fine on most pages when previsualised, going right to the side of the screen, but stops just before the edge on certain pages. I have double checked that I have placed it in the right place in relation to the guides on the page.
That's one problem.
The second problem is that I tried to upload onto business catalyst, which got to 60% and refused to go any further, saying it couldn't find the header picture, giving the title and then u4833-3.fr.png. The picture is in the right folder I have double checked. And it isn't a png. Does it have to be ?
And the third problem is that I got an email following my upload from business catalyst in Swedish. I am living in France.
Can anyone help ? Thanks.Thanks for replying,
How can I check the preview in other browsers before I publish a provisional site with BC?
The rectangle width issue happens on certain pages but not others. The Welecom page is fine when the menu is active, also the contact page, but others are slightly too narrow. Changing the menu spacing doesn’t help - I was already on uniform but tried changing to regular and back.
In design mode the rectangle is set to the edge of the browser, that’s 100%browser width right?
Re BC I have about 200 images on 24 different pages and it seems to be having difficulty uploading some of them. But it has managed a couple I named with spaces but not others I named with just one name.
Is there an issue on size of pictures ? If I need to replace is there a quick way to rename and relink or do I have to insert the photos all over again?
I’m a novice with Muse with an ambitious site !
Thanks for your help.
Mary Featherstone
Envoyé depuis Courrier Windows
De : Sanjit_Das
Envoyé : vendredi 14 février 2014 22:15
À : MFeatherstone
Re: Help needed with header and upload onto business catalyst
created by Sanjit_Das in Help with using Adobe Muse CC - View the full discussion
Hi
Answering the questions :
- Have you checked the preview in Muse and also in other browsers ?
- Does the rectangle width issue happens when menu is active , or in any specific state , Try to change the menu with uniform spacing and then check.
- In design view the rectangle is set to 100% browser width ?
With publishing :
- Please try to rename the image file and then relink
- If it happens with other images as well , see if all the image names includes strange characters or spaces.
- Try again to publish
With e-mail from BC :
- Under preferences , please check the country selected.
- If you have previously created partner account in BC and selected country and language then it would follow that, please check that.
Thanks,
Sanjit
Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6121942#6121942
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6121942#6121942
To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6121942#6121942. In the Actions box on the right, click the Stop Email Notifications link.
Start a new discussion in Help with using Adobe Muse CC at Adobe Community
For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0. -
Images with success and error messages
Hi,
I am using theme 20. I want to add a success image on all success messages and an error image on all validation failure messages. I can do this by putting img tag in messages individually. Is there an easy way by which I can make sure that all success and error messages are always displayed with a corresponding image without including img tag in every message?
Thanks,
BhaveshHi Bhavesh,
in page template there is Subtemplate region related to success, error and notification messages. You can put there your HTML tags and add some css class or image for every page using this template.
Regards,
Przemek -
Newbie - help needed with array and dictionary objects
Hi all
Please see the code below. I've posted this code in another thread however the original issue was resolved and this is now a new issue I'm having although centered around the same code.
The issue is that I'm populating an array with dictionary objects. each dictionary object has a key and it's value is another array of custom objects.
I've found that the code runs without error and I end up with my array as I'm expecting however all of the dictionary objects are the same.
I assume it's something to do with pointers and/or re-using the same objects but i'm new to obj-c and pointers so i am a bit lost.
Any help again is very much appreciated.
// Open the database connection and retrieve minimal information for all objects.
- (void)initializeDatabase {
NSMutableArray *authorArray = [[NSMutableArray alloc] init];
self.authors = authorArray;
[authorArray release];
// The database is stored in the application bundle.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"books.sql"];
// Open the database. The database was prepared outside the application.
if (sqlite3_open([path UTF8String], &database) == SQLITE_OK) {
// Get the primary key for all books.
const char *sql = "SELECT id, author FROM author";
sqlite3_stmt *statement;
// Preparing a statement compiles the SQL query into a byte-code program in the SQLite library.
// The third parameter is either the length of the SQL string or -1 to read up to the first null terminator.
if (sqlite3preparev2(database, sql, -1, &statement, NULL) == SQLITE_OK) {
// We "step" through the results - once for each row.
// We start with Letter A...we're building an A - Z grouping
NSString *letter = @"A";
NSMutableArray *tempauthors = [[NSMutableArray alloc] init];
while (sqlite3_step(statement) == SQLITE_ROW) {
author *author = [[author alloc] init];
author.primaryKey = sqlite3columnint(statement, 0);
author.title = [NSString stringWithUTF8String:(char *)sqlite3columntext(statement, 0)];
// FOLLOWING WAS LEFT OVER FROM ORIGINAL COMMENTS IN SQLBooks example....
// We avoid the alloc-init-autorelease pattern here because we are in a tight loop and
// autorelease is slightly more expensive than release. This design choice has nothing to do with
// actual memory management - at the end of this block of code, all the book objects allocated
// here will be in memory regardless of whether we use autorelease or release, because they are
// retained by the books array.
// if the author starts with the Letter we currently have, add it to the temp array
if ([[author.title substringToIndex:1] compare:letter] == NSOrderedSame){
[tempauthors addObject:author];
} // if this is different letter, then we need to deal with that too...
else {
// create a dictionary to store the current tempauthors array in...
NSDictionary *tempDictionary = [NSDictionary dictionaryWithObject:tempauthors forKey:@"authors"];
// add the dictionary to our appDelegate-level array
[authors addObject:tempDictionary];
// now prepare for the next loop...
// set the new letter...
letter = [author.title substringToIndex:1];
// remove all of the previous authors so we don't duplicate...
[tempauthors removeAllObjects];
// add the current author as this was the one that didn't match the Letter and so
// never went into the previous array...
[tempauthors addObject:author];
// release ready for the next loop...
[author release];
// clear up the remaining authors that weren't picked up and saved in the "else" statement above...
if (tempauthors.count > 0){
NSDictionary *tempDictionary = [NSDictionary dictionaryWithObject:tempauthors forKey:@"authors"];
[authors addObject:tempDictionary];
else {
printf("Failed preparing statement %s
", sqlite3_errmsg(database));
// "Finalize" the statement - releases the resources associated with the statement.
sqlite3_finalize(statement);
} else {
// Even though the open failed, call close to properly clean up resources.
sqlite3_close(database);
NSAssert1(0, @"Failed to open database with message '%s'.", sqlite3_errmsg(database));
// Additional error handling, as appropriate...
Message was edited by: dotnetterOk, so I know what the issue is now...I just don't know enough to be able to resolve it!
it's the tempAuthors objects.
It's an NSMutableArray which is create on the line before the start of the WHILE loop.
Having looked through the debugger, I can see that each dictionary object is created (with different codes which I assume are memory addresses) so all is well there. However, on each iteration of the loop in the middle there is an IF...ELSE... statement which in the ELSE section is clearing all objects from the tempAuthors array and beginning to repopulate it again.
Looking at the containing dictionary objects in the debugger I can see that the tempAuthors object that each contains has the same code (again, I'm assuming this is a memory address) - so if I understand correctly, it's the same object...I assumed that when I created the dictionary using the dictionWithObject call that I would be passing in a copy of the object, but it's referencing back to the object which I then go on to change.
Assuming the above is correct, I've tried several "stabs in the dark" at fixing it.
I've tried relasing the tempAuthors object within the ELSE and initialising it again via an alloc...init - but this didn't work and again looking through the debugger it looks as though it was confused as to which object it was supposed to be using on the following iteration of the WHILE loop (it tried to access the released object).
Having read a little more about memory management can someone tell me if I'm correct in saying that the above is because the tempAuthors object is declare outside the scope of the WHILE loop yet I then try to re-instantiate it within the loop (does that make sense???).
Sorry for the long post...the more I can understand the process the less I can hopefully stop relying on others for help so much.
I am continuing to read up on memory management etc but just not there yet.
Regards
Wayne -
Bonjour à tous
Hi everybody
Sur Lr 5.3 sous windows 7 j'ai ce message d'erreur voir en pièce jointe que dois je faire s'il vous plaît... des informations de mon catalogue ont disparu paramétre de recherche par exemple)
Merci à tous
Lr5.3 with windows seven, i jave an arror message ( see the picture) what can i do please? i've noticed taht some catalog items are missing now ( for serch, for example)
Thank you all
PatriceDon't post reams of information like this - it means nothing.
Also, this is an iWeb forum which is concerned with website building and your post has nothing to do with this.
Please look more closely when posting to ensure that you are posting in the correct forum, which you have not. Nobody here can help you with your problem. -
Help needed with BootCamp and WinXP
I've installed Bootcamp on my new MacBookPro and after the first reboot during windows XP installation the machine doesn't boot. I have to hold down "option" to choose to boot from Mac OS, but booting from the windows partition generates an error message which ask for a bootable device.
I've done it twice with identical resuklt.
What am I doing wrong?
How can I fix it?
Regards,
Joe.-When formatting, you did choose the right drive to format for Windows right? :-/
-
Help needed with footers and shrinking text
Hi Guys
I got a report that I want to print conditional headers and footers for. When I specify that I only want a foooter to appear on the last page, I get REP-1216 error, I checked out Metalink and followed a note on how to get around it but I'm having no joy. Can anyone help me out? I also want to make certain bits of the header and footer visible depending on a value retrieved from the report query only I get REP-1314 saying that my format trigger referencesa column at the wrong frequency. I know the value is in another frame but how do I make this value available in the margin so that the formatting will work?
Also, I want to be able to shrink some lines of an address if it has a null value at runtime e.g
My House
First Address Line
Second Address Line
<Null>
Post Code
I want to format it so that it appears as:
My House
First Address Line
Second Address Line
Post Code
I really appreciate if someone could help me out as always this is very urgent!
Many thanks
CiaranHi Ciaran,
I only want a foooter to appear on the last page
I am quoting from Note 1017067.102 on Metalink (REP-1216 when running report with field in margin) - you might have already seen this note...
Objects in the margin region are restarted on every physical page. As a
result, not all print condition types make sense for margin objects. Because
objects are restarted on every page, it is as if you are always on the first
page of the object.
The print condition FIRST is the same as the print condition ALL.
The print conditions LAST and ALL BUT LAST are invalid because "LAST" is never
reached.
The print condition ALL BUT FIRST causes the object to never appear because
the object never goes beyond "FIRST" page.
Thus, the only valid print conditions for the object are FIRST and ALL.
also want to make certain bits of the header and footer visible depending on a value retrieved from the report queryYou can use conditional formatting / format trigger only for objects that are in the same group in the data model. For example, you can reference employee_id in the format trigger of employee_name if they are in the same group. In your header / footer Format Trigger, you can reference only report-level columns. So if you can make your column to appear at the report level (outside of any group), you may be able to reference it from the header / footer.
want to be able to shrink some lines of an address if it has a null value at runtime You may be able to use Anchors. See Builder Help for more information and examples.
Navneet. -
Help needed with doubles and integers
I just want to start telling all you that you have been a big help to me the last couple of months. Now, for my issue. I'm having a problem doing some work with doubles and integers. Below is the code I've tried. But, I keep getting mismatch types. I need num3 to fill in a JTextField by the end with the answer for the calc. Num2 is fill in from a JTextField with a double.
Int num1 = 0, num4 = 0, num3 = 0;
double num2 = 0, totint = 0;
for(count = 0; num4 < count; count++)
totint = (1 + num2);
System.out.println(totint);
num3 = double (num1 * totint);
String k = Integer.toString(num3);
tf3.setText(k); (This is a JTextField)
Test data
num1 = 10000
num2 = 3.4
num4 = 4
num3 = the value from the calcFirst of all, your for loop is never going to run.
for (count = 0; num4<count; count++)
totint = (1 + num2);
System.out.println(totint);
num4 = 4 and will not be less than count, so the for loop will not be executed.
Second, what exactly are you trying to accomplish here. The way you have your code set up, the for loop (if it were to execute) would print out 4.4 each time it passes, then do the calculation. You may need to rethink your objective. -
Help needed with consolidating and moving itunes folder.
I have imported songs into itunes using with the Copy Files To iTunes Folder When Adding To The Library box unchecked and moved the location of my music folder to an external hard drive. I already had a folder full of music files on this hard drive so I now have 2 folders with music files, the iTunes folder with music recently imported from cd's and the old folder. The library points to references to both of these folders but not ALL of the files in the old folder as I don't need them in iTunes.
I now want to be able to listen to my iTunes library when not connected to the external drive. How do I do this? If I reset the location of my iTunes folder back to the macbook do I then need to consolidate, and if I do will only the files with reference pointers go into this folder? I don't want all the music files in the old folder to go onto the macbook, only the ones with reference pointers to them, plus the ones in the iTunes music folder.I have imported songs into itunes using with the Copy Files To iTunes Folder When Adding To The Library box unchecked and moved the location of my music folder to an external hard drive. I already had a folder full of music files on this hard drive so I now have 2 folders with music files, the iTunes folder with music recently imported from cd's and the old folder. The library points to references to both of these folders but not ALL of the files in the old folder as I don't need them in iTunes.
I now want to be able to listen to my iTunes library when not connected to the external drive. How do I do this? If I reset the location of my iTunes folder back to the macbook do I then need to consolidate, and if I do will only the files with reference pointers go into this folder? I don't want all the music files in the old folder to go onto the macbook, only the ones with reference pointers to them, plus the ones in the iTunes music folder. -
Help needed with hatches and fill patterns
Hi,
I'm trying to do an architectural drawing of a building in illustrator. I have the geometry set up in rhino and exported it but I now need to add the brick and pavement patterns to the geometries But I've no idea how to do it accurately?
I'll attach the drawing as a jpeg as is now so you can see what I mean. Excuse the messiness, still very much a work in progressenvelope distort might be teh easiest way.
you could also try using the perspecting grid, but matching the plane can be a pain and sometimes the forshortening is completely the oppositie of what it should be.
so i'd do envelope. draw the face you want to fil. draw a square with the same proportions of the face you want to fill. fill that square with your pattern at the size that they should be. move that square behing the shape of your plane. then make envelope distort with obejct on top.
mask out the holes in the shape as needed with a clipping mask or solid shapes.
play with the envelope handles to adjust for perspective foreshortening. -
Help needed with singleSelection and multiple selection in table.
Hi ,
How do i implement the singleSelection and multipleSelection on table rows.
How do i capture the checked rows?
How should the code be written and where should it be written.
I should be capturing the values of the checked rows and pass it to the pl/sql package.
I have a table - in -table so there is a singleselection on the outer table and multiple selection on the Inner table.
Could anyone help me with this.
Thanks,One solution to most of your questions : Read the advanced table section of Dev guide.
Always go through the dev guide before putting up the issue. Let the forum be for those scenarios which dev guide doesn't covers in much detail.
--Shiv -
Help needed with terminal and sudo
I recently had an awful time trying to upgrade to Mavericks from Mountain Lion. I couldn't do it, I got the gray screen with the logo and nothing else.
After a couple of days trying to sort it out I have gone back to Mountain Lion by restoring from my Time machine backup.
I was contemplating trying to install Mavericks 1 more time and tried making a boot disk using Lion Disk Maker. The process failed and I was getting the message, "Root is not in the sudoers file" When I've doe a bit more investigating it seems that there may be a problem with my sudo file.
When I tried to create the boot disk from the terminal I get the message that my user account is not in the sudoers file. My user account has full admin privileges.
Can anybody that understands the terminal please tell me what I need to do?
Thanks
JohnJohn,
Since you cannot use sudo, corrective choices dwindle to either root (superuser) privileges, or reinstalling OS X. Apple has an assistance article on superuser. You should treat root privileges with the utmost respect, use it to solve this particular problem, and then resort only to sudo when necessary. My root is enabled and I never use it -- which begs for me to deactivate it.
The ownership on /etc/sudoers is root, wheel — and the permissions are 440 (-r--r-----).
Hopefully, you have a rudimentary vi editor knowledge, as the correct tool for editing the sudoers file is /usr/sbin/visudo.
There are only two active privilege lines in my /etc/sudoers file:
root
%admin
Hope this helps. -
Help needed with Express and SQL Dev
Recently was asked to make a sql server application work with Oracle. I have never worked with Oracle products and no one in my small shop has either. I downloaded the Express 10g onto a virtual machine on my dev server and oracle SQL Developer locally. I have no idea how to connect to the Express db on the prod server using sql developer. I have tried Basic and TNS connection types and all the errors are very cryptic. Any help is appreciated. Do I need to install anything client side to connect to the server?
I figured it out. I had to use the Basic connection type and I DL'd the J2EE .
Edited by: jt_stand on Sep 25, 2008 10:51 AMHad to use the Basic connection type and get the right combination of options. I can now connect to my remote Express server with my local sql developer program.
-
Help needed with Copying DVD error in Toast Titanium 6
(I tried to post to Roxio forum but couldn't get registered) ... hope someone can help
I made an iDVD of a school event (Métis Gathering) and burned it to DVD through the iDVD program (iDVD 6)
I used Toast (6.0.3) to make 8 copies of the dvd.
Now I need to make more copies, but Toast never finishes the 'recording' (copying) session ... it gives me "couldn't complete the last command: I/O error, result code -36."
I'm using the original DVD, which was only played once and I've kept it as a master .... I don't see any scratches or anything on it.
What's happening? What can I do?
Any help is appreciated, thank you
Eliz
iMac 17", Intel Core Duo , 512 Ram, 160 GB Mac OS X (10.4.6)With the luxury of two internal burners, I've never
used Toast that way.
I find it a luxury just to have a dvd burner!!
Any way, back to the saga .... I tried the same original master dvd at home again, no copying possible, so setting the speed wasn't a factor
So, I put in the copy I made at school .... I made a disk image with disc utility, then burned the image ... at a slower speed ... with toast. Seems fine. I'm going to save the disc image as a data dvd to use as the future master, no more copying with toast for me!
Since I've managed to overcome this little problem using a second computer (the luxury of which I won't have, come July), i think I'm okay ... just need to remember to try a slower burn speed from the start next time ...
But, why wouldn't it read the dvd? almost like it had a shelf life or something
Thank you for your help
Eliz -
Help Needed With Scrollbar and Content
I'm having a difficult time with the Scrollbar component. I'm trying to have a scrollbar set up to navigate a text field or a MC of a text field. I managed to get it functioning within the desired frame, however when I jump to another frame, that very same content appears on the other frame, despite the fact that said frame did not have the scrollbar nor the content pasted within.
The bar seems to do what I want it to do save for the unwelcomed presence outside of the frame of choice. Here's the code I'm using. This is the keyframe code:
import boppreh.ui.Scrollbar
var scrollbar1:Scrollbar = new Scrollbar(boomboom, 500, true, false, 293, bar, slider, arrowUp, arrowDown)
addChild(scrollbar1)
scrollbar1.x = 50
scrollbar1.y = 50
And this is the code found in the AS file:
package boppreh.ui
import flash.display.*
import flash.events.*
import flash.geom.Rectangle;
import flash.utils.Timer
import flash.ui.Keyboard
* Scrollbar to handle single display objects.
* Author: Lucas Boppre Niehues ([email protected])
* Date: 09/02/2010
public class Scrollbar extends Sprite {
/// The default width for the default slider, bar and arrows, as well as the default arrows' height
public static const DEFAULT_SIDE:Number = 20
/// The delay (in milliseconds) between clicking and holding an arrow and the slider moving continously
public static var SCROLL_DELAY:Number = 300
/// The number of lines to be scrolled every second during continous scrolling
public static var LINES_PER_SECOND:Number = 1.5
/// Number of pixels to be scrolled for each mouse wheel line (default lines per wheel tick is 3)
public static var PIXELS_PER_LINE:Number = 16
protected var windowSize:Number
protected var contentPadding:Number
protected var isVertical:Boolean
/// Stored movement to be applied on the next "scroll()" call
protected var movement:Number
/// Timer used to control the delay before continous scrolling
protected var timer:Timer
protected var content:DisplayObject
protected var contentBounds:Rectangle
protected var bar:InteractiveObject
protected var arrowUp:InteractiveObject
protected var arrowDown:InteractiveObject
protected var slider:InteractiveObject
protected var partHold:InteractiveObject
protected function get eventOrigin():String {
if (partHold == arrowUp)
return ScrollEvent.ARROW_UP
else if (partHold == arrowDown)
return ScrollEvent.ARROW_DOWN
else if (partHold == bar)
return ScrollEvent.BAR
throw new Error("Unkown event origin.")
private var mouseOffset:Number
protected function get maxContentPos():Number {
if (isVertical)
return -(contentBounds.height - windowSize) - 1
else
return -(contentBounds.width - windowSize) - 1
/// The content's current position, in a scale from 0 to 1
public function get position():Number {
if (isVertical)
return contentBounds.y / maxContentPos
else
return contentBounds.x / maxContentPos
public function set position(value:Number) {
value = Math.min(1, Math.max(value, 0))
var newContentPos:Number = value * maxContentPos
setPosition(content, isVertical ? null : newContentPos, isVertical ? newContentPos : null, false, false)
contentBounds = content.getBounds(this)
if (isVertical) {
bar.height = windowSize - (arrowUp.height + arrowDown.height)
slider.height = (windowSize / Math.max(contentBounds.height, windowSize)) * bar.height
var newSliderY:Number = arrowUp.height + (-newContentPos / contentBounds.height) * bar.height
setPosition(slider, null, newSliderY, false, false)
} else {
bar.width = windowSize - (arrowUp.width + arrowDown.width)
slider.width = (windowSize / Math.max(contentBounds.width, windowSize)) * bar.width
var newSliderX:Number = arrowUp.width + (-newContentPos / contentBounds.width) * bar.width
setPosition(slider, newSliderX, null, false, false)
updatePartsPositions()
* Creates a new Scrollbar object to scroll a single Display Object.
* @param content the object to be scrolled
* @param windowSize the height or width of the scrollbar, depending if it's vertical or not; i.e.: the dimension of the content's visible part
* @param isVertical defines if the scrollbar's parts should be placed on the right or bottom of the content, and if the content should be scrolled upways or to the right
* @param autoUpdate automatically checks for dimensions changes in any part and updates accordingly. Use only if the content will be resized
* @param contentPadding the distance between the content and all the other parts
* @param bar the bar object to be used; if null, a default one will be used
* @param slider the slider object to be used; if null, a default one will be used
* @param arrowUp the arrow up/left object to be used; if null, a default one will be used
* @param arrowDown the arrow down/right object to be used; if null, a default one will be used
public function Scrollbar(content:DisplayObject, windowSize:Number, isVertical:Boolean=true, autoUpdate:Boolean=false, contentPadding:Number=5, bar:InteractiveObject=null, slider:InteractiveObject=null, arrowUp:InteractiveObject=null, arrowDown:InteractiveObject=null) {
this.content = content
this.windowSize = windowSize
this.contentPadding = contentPadding
this.isVertical = isVertical
this.bar = bar || createDefaultBar()
this.arrowUp = arrowUp || createDefaultArrow(false)
this.arrowDown = arrowDown || createDefaultArrow(true)
this.slider = slider || createDefaultSlider()
timer = new Timer(SCROLL_DELAY)
timer.addEventListener(TimerEvent.TIMER, startScrolling)
addParts()
if (autoUpdate)
this.addEventListener(Event.ENTER_FRAME, update)
configureListeners()
update()
position = 0
protected function scroll(e:*= null):void {
// This nested if forbids the slider to continue moving if the user is
// "holding" the bar and the slider already reached the mouse position
if (e && (e is Event) && (Event(e).type == Event.ENTER_FRAME)) {
if (partHold == bar) {
var sliderBounds:Rectangle = slider.getBounds(this)
if (isVertical) {
if (mouseY > sliderBounds.top && mouseY < sliderBounds.bottom) {
stopScrolling()
return
} else {
if (mouseX > sliderBounds.left && mouseX < sliderBounds.right) {
stopScrolling()
return
scrollPixels(movement)
* Scrolls the content by the specified ammount.
* @param number number of pixels to be scrolled
protected function scrollPixels(number:Number):void {
position += number / -maxContentPos
protected function configureListeners():void {
slider.addEventListener(MouseEvent.MOUSE_DOWN, startSliderDrag)
for each (var part:InteractiveObject in [arrowUp, arrowDown, bar]) {
part.addEventListener(MouseEvent.MOUSE_DOWN, fixedPart_onMouseDownHandler)
addEventListener(MouseEvent.MOUSE_WHEEL, mouse_onWheelScrollHandler)
addEventListener(KeyboardEvent.KEY_DOWN, keyboard_onKeyDownHandler)
protected function fixedPart_onMouseDownHandler(event:MouseEvent):void
partHold = InteractiveObject(event.currentTarget)
if (partHold == arrowUp) {
movement = -PIXELS_PER_LINE
} else if (partHold == arrowDown) {
movement = PIXELS_PER_LINE
} else if (partHold == bar) {
var sliderBounds:Rectangle = slider.getBounds(this)
if (isVertical) {
if (mouseY > (sliderBounds.top + sliderBounds.height / 2))
movement = windowSize
else
movement = -windowSize
} else {
if (mouseX > (sliderBounds.left + sliderBounds.width / 2))
movement = windowSize
else
movement = -windowSize
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, eventOrigin))
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling)
partHold.addEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
timer.start()
protected function keyboard_onKeyDownHandler(event:KeyboardEvent):void {
switch (event.keyCode) {
case Keyboard.UP:
case Keyboard.LEFT:
movement = -PIXELS_PER_LINE
break
case Keyboard.DOWN:
case Keyboard.RIGHT:
movement = PIXELS_PER_LINE
break
case Keyboard.SPACE:
case Keyboard.PAGE_DOWN:
movement = windowSize
break
case Keyboard.PAGE_UP:
movement = -windowSize
break
case Keyboard.HOME:
movement = 0
position = 0
break
case Keyboard.END:
movement = 0
position = 100
break
default:
return
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.KEYBOARD))
protected function startScrolling(e:*=null):void {
timer.reset()
this.addEventListener(Event.ENTER_FRAME, scroll)
movement = (movement * (LINES_PER_SECOND * PIXELS_PER_LINE)) / stage.frameRate
dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_START, eventOrigin))
protected function stopScrolling(e:*=null) {
timer.stop()
this.removeEventListener(Event.ENTER_FRAME, scroll)
stage.removeEventListener(KeyboardEvent.KEY_UP, stopScrolling)
stage.removeEventListener(MouseEvent.MOUSE_UP, stopScrolling)
dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_STOP, eventOrigin))
if (partHold) {
partHold.removeEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
partHold = null
protected function mouse_onWheelScrollHandler(event:MouseEvent) {
// The mouse wheel delta arrives inverted
var delta:int = -event.delta
movement = delta * PIXELS_PER_LINE
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.MOUSE_WHEEL))
//{ region Slider Drag functions
protected function startSliderDrag(event:MouseEvent) {
if (isVertical)
mouseOffset = slider.getBounds(this).y - this.mouseY
else
mouseOffset = slider.getBounds(this).x - this.mouseX
stage.addEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
stage.addEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_START, ScrollEvent.SLIDER))
protected function stopSliderDrag(event:MouseEvent) {
stage.removeEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_STOP, ScrollEvent.SLIDER))
protected function onSliderDrag(event:MouseEvent) {
if (isVertical) {
if (bar.height == slider.height)
return
} else {
if (bar.width == slider.width)
return
if (isVertical)
position = (this.mouseY + mouseOffset - arrowUp.height) / (bar.height - slider.height)
else
position = (this.mouseX + mouseOffset - arrowUp.width) / (bar.width - slider.width)
//} endregion
//{ region Visual functions
/// Adds all required parts to the scrollbar's display list
protected function addParts():void {
setPosition(content, 0, 0, false, false)
addChild(this.bar)
addChild(this.arrowUp)
addChild(this.arrowDown)
addChild(this.slider)
addChild(this.content)
* Updates all parts to fit the new dimensions and positions.
public function update(e:*= null):void {
contentBounds = content.getBounds(this)
updatePartsPositions()
// Ugly, but updates everything that was not update in the above call based on the content's position and size
position = position
protected function updatePartsPositions(event:Event = null):void {
if (isVertical) {
// The parts width is divided by 2 because they will be center aligned
var newX:Number = contentBounds.width +
contentPadding +
Math.max(slider.width, arrowUp.width, arrowDown.width, bar.width) / 2
setPosition(arrowUp, newX, 0, true, false)
setPosition(bar, newX, arrowUp.height, true, false)
setPosition(arrowDown, newX, arrowUp.height + bar.height, true, false)
setPosition(slider, newX, null, true, false)
} else {
var newY:Number = contentBounds.height +
contentPadding +
Math.max(slider.height, arrowUp.height, arrowDown.height, bar.height) / 2
setPosition(arrowUp, 0, newY, false, true)
setPosition(bar, arrowUp.width, newY, false, true)
setPosition(arrowDown, arrowUp.width + bar.width, newY, false, true)
setPosition(slider, null, newY, false, true)
updateMask()
private function updateMask():void {
if (content.mask && this.contains(content.mask))
removeChild(content.mask)
var contentMask:Sprite = createWindowMask()
addChild(contentMask)
content.mask = contentMask
protected function setPosition(part:DisplayObject, newX:Object=null, newY:Object=null, alignHorizontal:Boolean=false, alignVertical:Boolean=false):void {
var bounds:Rectangle = part.getBounds(this)
if (newX is Number)
part.x = int(newX) + (part.x - bounds.x) - ((alignHorizontal) ? bounds.width / 2 : 0)
if (newY is Number)
part.y = int(newY) + (part.y - bounds.y) - ((alignVertical) ? bounds.height / 2 : 0)
//} endregion
//{ region Functions to draw parts
private function createDefaultBar():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xFFFFFF)
if (isVertical)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
else
image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
image.graphics.endFill()
//image.buttonMode = true
return image
private function createDefaultArrow(inverted:Boolean):Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xBFBFBF)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, DEFAULT_SIDE)
image.graphics.endFill()
image.graphics.lineStyle(3)
if (isVertical) {
if (inverted) {
image.graphics.moveTo(4, 4)
image.graphics.lineTo(10, 16)
image.graphics.lineTo(16, 4)
} else {
image.graphics.moveTo(4, 16)
image.graphics.lineTo(10, 4)
image.graphics.lineTo(16, 16)
} else {
if (inverted) {
image.graphics.moveTo(4, 4)
image.graphics.lineTo(16, 10)
image.graphics.lineTo(4, 16)
} else {
image.graphics.moveTo(16, 4)
image.graphics.lineTo(4, 10)
image.graphics.lineTo(16, 16)
image.buttonMode = true
return image
private function createDefaultSlider():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xBFBFBF)
if (isVertical)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
else
image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
image.graphics.endFill()
image.buttonMode = true
return image
private function createWindowMask():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(0)
image.graphics.beginFill(0x000000, 1)
if (isVertical)
image.graphics.drawRect(0, 0, content.width + 1, windowSize)
else
image.graphics.drawRect(0, 0, windowSize, content.width + 1)
image.graphics.endFill()
image.alpha = 0
return image
//} endregion
And this is the ScrollEvent AS file:
package boppreh.ui
import flash.events.Event;
* Events related to the Scrollbar class.
* Author: Lucas Boppre Niehues ([email protected])
* Date: 09/02/2010
public class ScrollEvent extends Event
/// Dispatched when a scroll movement occurs
public static const SCROLL:String = "scroll"
/// Dispatched when the user has clicked and is holding an arrow or the bar
public static const CONTINOUS_SCROLL_START:String = "continous scroll start"
/// Dispatched when the user has clicked and dropped an arrow or the bar
public static const CONTINOUS_SCROLL_STOP:String = "continous scroll stop"
/// Dispatched when the user starts dragging the slider part
public static const SLIDER_DRAG_START:String = "slider drag start"
/// Dispatched when the user stops dragging the slider part
public static const SLIDER_DRAG_STOP:String = "slider drag stop"
/// Origin type representing the arrow up part
public static const ARROW_UP:String = "arrow up"
/// Origin type representing the arrow down part
public static const ARROW_DOWN:String = "arrow down"
/// Origin type representing the bar part
public static const BAR:String = "part"
/// Origin type representing the slider part
public static const SLIDER:String = "slider"
/// Origin type representing the keyboard
public static const KEYBOARD:String = "keyboard"
/// Origin type representing the mouse wheel
public static const MOUSE_WHEEL:String = "mouse wheel"
public var origin:String
* Creates a new ScrollEvent object.
* @param type the object type (first group of declared constants)
* @param origin the object that originated the event (second group of declared constants)
public function ScrollEvent (type:String, origin:String, bubbles:Boolean = false, cancelable:Boolean = false) {
this.origin = origin
super(type, bubbles, cancelable)
Any help would be appreciated. I've been stuck here all day.I'm having a difficult time with the Scrollbar component. I'm trying to have a scrollbar set up to navigate a text field or a MC of a text field. I managed to get it functioning within the desired frame, however when I jump to another frame, that very same content appears on the other frame, despite the fact that said frame did not have the scrollbar nor the content pasted within.
The bar seems to do what I want it to do save for the unwelcomed presence outside of the frame of choice. Here's the code I'm using. This is the keyframe code:
import boppreh.ui.Scrollbar
var scrollbar1:Scrollbar = new Scrollbar(boomboom, 500, true, false, 293, bar, slider, arrowUp, arrowDown)
addChild(scrollbar1)
scrollbar1.x = 50
scrollbar1.y = 50
And this is the code found in the AS file:
package boppreh.ui
import flash.display.*
import flash.events.*
import flash.geom.Rectangle;
import flash.utils.Timer
import flash.ui.Keyboard
* Scrollbar to handle single display objects.
* Author: Lucas Boppre Niehues ([email protected])
* Date: 09/02/2010
public class Scrollbar extends Sprite {
/// The default width for the default slider, bar and arrows, as well as the default arrows' height
public static const DEFAULT_SIDE:Number = 20
/// The delay (in milliseconds) between clicking and holding an arrow and the slider moving continously
public static var SCROLL_DELAY:Number = 300
/// The number of lines to be scrolled every second during continous scrolling
public static var LINES_PER_SECOND:Number = 1.5
/// Number of pixels to be scrolled for each mouse wheel line (default lines per wheel tick is 3)
public static var PIXELS_PER_LINE:Number = 16
protected var windowSize:Number
protected var contentPadding:Number
protected var isVertical:Boolean
/// Stored movement to be applied on the next "scroll()" call
protected var movement:Number
/// Timer used to control the delay before continous scrolling
protected var timer:Timer
protected var content:DisplayObject
protected var contentBounds:Rectangle
protected var bar:InteractiveObject
protected var arrowUp:InteractiveObject
protected var arrowDown:InteractiveObject
protected var slider:InteractiveObject
protected var partHold:InteractiveObject
protected function get eventOrigin():String {
if (partHold == arrowUp)
return ScrollEvent.ARROW_UP
else if (partHold == arrowDown)
return ScrollEvent.ARROW_DOWN
else if (partHold == bar)
return ScrollEvent.BAR
throw new Error("Unkown event origin.")
private var mouseOffset:Number
protected function get maxContentPos():Number {
if (isVertical)
return -(contentBounds.height - windowSize) - 1
else
return -(contentBounds.width - windowSize) - 1
/// The content's current position, in a scale from 0 to 1
public function get position():Number {
if (isVertical)
return contentBounds.y / maxContentPos
else
return contentBounds.x / maxContentPos
public function set position(value:Number) {
value = Math.min(1, Math.max(value, 0))
var newContentPos:Number = value * maxContentPos
setPosition(content, isVertical ? null : newContentPos, isVertical ? newContentPos : null, false, false)
contentBounds = content.getBounds(this)
if (isVertical) {
bar.height = windowSize - (arrowUp.height + arrowDown.height)
slider.height = (windowSize / Math.max(contentBounds.height, windowSize)) * bar.height
var newSliderY:Number = arrowUp.height + (-newContentPos / contentBounds.height) * bar.height
setPosition(slider, null, newSliderY, false, false)
} else {
bar.width = windowSize - (arrowUp.width + arrowDown.width)
slider.width = (windowSize / Math.max(contentBounds.width, windowSize)) * bar.width
var newSliderX:Number = arrowUp.width + (-newContentPos / contentBounds.width) * bar.width
setPosition(slider, newSliderX, null, false, false)
updatePartsPositions()
* Creates a new Scrollbar object to scroll a single Display Object.
* @param content the object to be scrolled
* @param windowSize the height or width of the scrollbar, depending if it's vertical or not; i.e.: the dimension of the content's visible part
* @param isVertical defines if the scrollbar's parts should be placed on the right or bottom of the content, and if the content should be scrolled upways or to the right
* @param autoUpdate automatically checks for dimensions changes in any part and updates accordingly. Use only if the content will be resized
* @param contentPadding the distance between the content and all the other parts
* @param bar the bar object to be used; if null, a default one will be used
* @param slider the slider object to be used; if null, a default one will be used
* @param arrowUp the arrow up/left object to be used; if null, a default one will be used
* @param arrowDown the arrow down/right object to be used; if null, a default one will be used
public function Scrollbar(content:DisplayObject, windowSize:Number, isVertical:Boolean=true, autoUpdate:Boolean=false, contentPadding:Number=5, bar:InteractiveObject=null, slider:InteractiveObject=null, arrowUp:InteractiveObject=null, arrowDown:InteractiveObject=null) {
this.content = content
this.windowSize = windowSize
this.contentPadding = contentPadding
this.isVertical = isVertical
this.bar = bar || createDefaultBar()
this.arrowUp = arrowUp || createDefaultArrow(false)
this.arrowDown = arrowDown || createDefaultArrow(true)
this.slider = slider || createDefaultSlider()
timer = new Timer(SCROLL_DELAY)
timer.addEventListener(TimerEvent.TIMER, startScrolling)
addParts()
if (autoUpdate)
this.addEventListener(Event.ENTER_FRAME, update)
configureListeners()
update()
position = 0
protected function scroll(e:*= null):void {
// This nested if forbids the slider to continue moving if the user is
// "holding" the bar and the slider already reached the mouse position
if (e && (e is Event) && (Event(e).type == Event.ENTER_FRAME)) {
if (partHold == bar) {
var sliderBounds:Rectangle = slider.getBounds(this)
if (isVertical) {
if (mouseY > sliderBounds.top && mouseY < sliderBounds.bottom) {
stopScrolling()
return
} else {
if (mouseX > sliderBounds.left && mouseX < sliderBounds.right) {
stopScrolling()
return
scrollPixels(movement)
* Scrolls the content by the specified ammount.
* @param number number of pixels to be scrolled
protected function scrollPixels(number:Number):void {
position += number / -maxContentPos
protected function configureListeners():void {
slider.addEventListener(MouseEvent.MOUSE_DOWN, startSliderDrag)
for each (var part:InteractiveObject in [arrowUp, arrowDown, bar]) {
part.addEventListener(MouseEvent.MOUSE_DOWN, fixedPart_onMouseDownHandler)
addEventListener(MouseEvent.MOUSE_WHEEL, mouse_onWheelScrollHandler)
addEventListener(KeyboardEvent.KEY_DOWN, keyboard_onKeyDownHandler)
protected function fixedPart_onMouseDownHandler(event:MouseEvent):void
partHold = InteractiveObject(event.currentTarget)
if (partHold == arrowUp) {
movement = -PIXELS_PER_LINE
} else if (partHold == arrowDown) {
movement = PIXELS_PER_LINE
} else if (partHold == bar) {
var sliderBounds:Rectangle = slider.getBounds(this)
if (isVertical) {
if (mouseY > (sliderBounds.top + sliderBounds.height / 2))
movement = windowSize
else
movement = -windowSize
} else {
if (mouseX > (sliderBounds.left + sliderBounds.width / 2))
movement = windowSize
else
movement = -windowSize
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, eventOrigin))
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling)
partHold.addEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
timer.start()
protected function keyboard_onKeyDownHandler(event:KeyboardEvent):void {
switch (event.keyCode) {
case Keyboard.UP:
case Keyboard.LEFT:
movement = -PIXELS_PER_LINE
break
case Keyboard.DOWN:
case Keyboard.RIGHT:
movement = PIXELS_PER_LINE
break
case Keyboard.SPACE:
case Keyboard.PAGE_DOWN:
movement = windowSize
break
case Keyboard.PAGE_UP:
movement = -windowSize
break
case Keyboard.HOME:
movement = 0
position = 0
break
case Keyboard.END:
movement = 0
position = 100
break
default:
return
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.KEYBOARD))
protected function startScrolling(e:*=null):void {
timer.reset()
this.addEventListener(Event.ENTER_FRAME, scroll)
movement = (movement * (LINES_PER_SECOND * PIXELS_PER_LINE)) / stage.frameRate
dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_START, eventOrigin))
protected function stopScrolling(e:*=null) {
timer.stop()
this.removeEventListener(Event.ENTER_FRAME, scroll)
stage.removeEventListener(KeyboardEvent.KEY_UP, stopScrolling)
stage.removeEventListener(MouseEvent.MOUSE_UP, stopScrolling)
dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_STOP, eventOrigin))
if (partHold) {
partHold.removeEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
partHold = null
protected function mouse_onWheelScrollHandler(event:MouseEvent) {
// The mouse wheel delta arrives inverted
var delta:int = -event.delta
movement = delta * PIXELS_PER_LINE
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.MOUSE_WHEEL))
//{ region Slider Drag functions
protected function startSliderDrag(event:MouseEvent) {
if (isVertical)
mouseOffset = slider.getBounds(this).y - this.mouseY
else
mouseOffset = slider.getBounds(this).x - this.mouseX
stage.addEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
stage.addEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_START, ScrollEvent.SLIDER))
protected function stopSliderDrag(event:MouseEvent) {
stage.removeEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_STOP, ScrollEvent.SLIDER))
protected function onSliderDrag(event:MouseEvent) {
if (isVertical) {
if (bar.height == slider.height)
return
} else {
if (bar.width == slider.width)
return
if (isVertical)
position = (this.mouseY + mouseOffset - arrowUp.height) / (bar.height - slider.height)
else
position = (this.mouseX + mouseOffset - arrowUp.width) / (bar.width - slider.width)
//} endregion
//{ region Visual functions
/// Adds all required parts to the scrollbar's display list
protected function addParts():void {
setPosition(content, 0, 0, false, false)
addChild(this.bar)
addChild(this.arrowUp)
addChild(this.arrowDown)
addChild(this.slider)
addChild(this.content)
* Updates all parts to fit the new dimensions and positions.
public function update(e:*= null):void {
contentBounds = content.getBounds(this)
updatePartsPositions()
// Ugly, but updates everything that was not update in the above call based on the content's position and size
position = position
protected function updatePartsPositions(event:Event = null):void {
if (isVertical) {
// The parts width is divided by 2 because they will be center aligned
var newX:Number = contentBounds.width +
contentPadding +
Math.max(slider.width, arrowUp.width, arrowDown.width, bar.width) / 2
setPosition(arrowUp, newX, 0, true, false)
setPosition(bar, newX, arrowUp.height, true, false)
setPosition(arrowDown, newX, arrowUp.height + bar.height, true, false)
setPosition(slider, newX, null, true, false)
} else {
var newY:Number = contentBounds.height +
contentPadding +
Math.max(slider.height, arrowUp.height, arrowDown.height, bar.height) / 2
setPosition(arrowUp, 0, newY, false, true)
setPosition(bar, arrowUp.width, newY, false, true)
setPosition(arrowDown, arrowUp.width + bar.width, newY, false, true)
setPosition(slider, null, newY, false, true)
updateMask()
private function updateMask():void {
if (content.mask && this.contains(content.mask))
removeChild(content.mask)
var contentMask:Sprite = createWindowMask()
addChild(contentMask)
content.mask = contentMask
protected function setPosition(part:DisplayObject, newX:Object=null, newY:Object=null, alignHorizontal:Boolean=false, alignVertical:Boolean=false):void {
var bounds:Rectangle = part.getBounds(this)
if (newX is Number)
part.x = int(newX) + (part.x - bounds.x) - ((alignHorizontal) ? bounds.width / 2 : 0)
if (newY is Number)
part.y = int(newY) + (part.y - bounds.y) - ((alignVertical) ? bounds.height / 2 : 0)
//} endregion
//{ region Functions to draw parts
private function createDefaultBar():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xFFFFFF)
if (isVertical)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
else
image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
image.graphics.endFill()
//image.buttonMode = true
return image
private function createDefaultArrow(inverted:Boolean):Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xBFBFBF)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, DEFAULT_SIDE)
image.graphics.endFill()
image.graphics.lineStyle(3)
if (isVertical) {
if (inverted) {
image.graphics.moveTo(4, 4)
image.graphics.lineTo(10, 16)
image.graphics.lineTo(16, 4)
} else {
image.graphics.moveTo(4, 16)
image.graphics.lineTo(10, 4)
image.graphics.lineTo(16, 16)
} else {
if (inverted) {
image.graphics.moveTo(4, 4)
image.graphics.lineTo(16, 10)
image.graphics.lineTo(4, 16)
} else {
image.graphics.moveTo(16, 4)
image.graphics.lineTo(4, 10)
image.graphics.lineTo(16, 16)
image.buttonMode = true
return image
private function createDefaultSlider():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xBFBFBF)
if (isVertical)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
else
image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
image.graphics.endFill()
image.buttonMode = true
return image
private function createWindowMask():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(0)
image.graphics.beginFill(0x000000, 1)
if (isVertical)
image.graphics.drawRect(0, 0, content.width + 1, windowSize)
else
image.graphics.drawRect(0, 0, windowSize, content.width + 1)
image.graphics.endFill()
image.alpha = 0
return image
//} endregion
And this is the ScrollEvent AS file:
package boppreh.ui
import flash.events.Event;
* Events related to the Scrollbar class.
* Author: Lucas Boppre Niehues ([email protected])
* Date: 09/02/2010
public class ScrollEvent extends Event
/// Dispatched when a scroll movement occurs
public static const SCROLL:String = "scroll"
/// Dispatched when the user has clicked and is holding an arrow or the bar
public static const CONTINOUS_SCROLL_START:String = "continous scroll start"
/// Dispatched when the user has clicked and dropped an arrow or the bar
public static const CONTINOUS_SCROLL_STOP:String = "continous scroll stop"
/// Dispatched when the user starts dragging the slider part
public static const SLIDER_DRAG_START:String = "slider drag start"
/// Dispatched when the user stops dragging the slider part
public static const SLIDER_DRAG_STOP:String = "slider drag stop"
/// Origin type representing the arrow up part
public static const ARROW_UP:String = "arrow up"
/// Origin type representing the arrow down part
public static const ARROW_DOWN:String = "arrow down"
/// Origin type representing the bar part
public static const BAR:String = "part"
/// Origin type representing the slider part
public static const SLIDER:String = "slider"
/// Origin type representing the keyboard
public static const KEYBOARD:String = "keyboard"
/// Origin type representing the mouse wheel
public static const MOUSE_WHEEL:String = "mouse wheel"
public var origin:String
* Creates a new ScrollEvent object.
* @param type the object type (first group of declared constants)
* @param origin the object that originated the event (second group of declared constants)
public function ScrollEvent (type:String, origin:String, bubbles:Boolean = false, cancelable:Boolean = false) {
this.origin = origin
super(type, bubbles, cancelable)
Any help would be appreciated. I've been stuck here all day.
Maybe you are looking for
-
Rep-3002 while calling report from form in character mode on web environment
When I call a report by using run_product from a form , i get rep-3002. my report is in character mode. if i change it to bitmap that works fine. but my requirement is of character mode on web environment. please help.
-
My sister gave me her computer b/c my old one crashed. She has an iTunes account on this computer. I want to have access to mine. I am able to see my library through sharing, but when I dock my iPod, my songs won't transfer. Help is much appreciated.
-
Photoshop Elements 12 does not open.
On the splash screen when I click Organizer it opens the Organizer, when I click on Photo Editor, nothing happens. I have uninstalled and reinstalled twice.
-
Creating a network icon on the desktop?
Hi I currently have the HD and idisk icons on my desktop but I need to get the network icon on there as well, so I can double click on it instead of having to click on go, then network. Any ideas how I do this? Thanks
-
I know that this is not a strictly related xml matter. I would like to know if anyone can help me in finding a business rule based engine to be used inside a campaign management application