Adding buttons and the scroll to dynamic text bar

Hello

I'm trying to connect a dynamic text to the scroll bar and buttons. I did the tutorial and Lynda.com and practically pasted the code with my names of files and for some reason it does not work. He said I "access of undefined property mask_mc" did I need to create a variable for that? I have not in the tutorial.

Right now I have the dynamic text to load successfully in 2 different places and I wantd to add the scroll bar. I put the variables on the code in frame 1 and then I put the loading code on the frame where it is needed.

Any suggestions?

Thank you! Sandra

HERE'S THE CODE FOR FRAME 1:


var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest;


var scrollPercent:Number = 0;
var minScroll:Number;
var maxScroll:Number;
var targetScroll:Number = philText_mc.y;
relaxation of the var: number = 5;
var scrollAmt:Number = 15;
var scrollDirection:Number = 0;

HERE'S THE CODE FOR WHICH TEXT SUPPORT:

textReq = new URLRequest ("text_philosophy.txt");


function philosophyTextLoaded(event:Event):void {}
philText_mc.philosophy_txt.text = textLoader.data;
minScroll = philText_mc.y;
maxScroll = minScroll - philText_mc.height + mask_mc.height;
}

function dragScroller(event:MouseEvent):void
{
var dragX:Number = line_mc.x - scroller_mc.width/2 + 1;
var dragY:Number = line_mc.y;
var dragW:Number = 0;
var dragH:Number = line_mc.height - scroller_mc.height;

scroller_mc.StartDrag (false, new Rectangle (dragX, dragY, dragW, dragH));
stage.addEventListener (MouseEvent.MOUSE_UP, stopDragging);
stage.addEventListener (Event.ENTER_FRAME, setScrollPercent);
stage.removeEventListener (Event.ENTER_FRAME, scrolling).
}

function stopDragging(event:MouseEvent):void
{
scroller_mc.stopDrag ();

}

function setScrollPercent(event:Event):void
{
scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
If (scrollPercent < 0)
{
scrollPercent = 0;
}
ElseIf (scrollPercent > 1)
{
scrollPercent = 1;
}
targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
philText_mc.y = (philText_mc.y - targetScroll) / acceleration;
}

function scrollUp(event:MouseEvent):void
{
setDirection (scrollAmt);
}

function scrollDown(event:MouseEvent):void
{
setDirection(-scrollAmt);
}

function setDirection(dir:Number):void
{
scrollDirection = dir;
stage.addEventListener (Event.ENTER_FRAME, scrolling).
stage.addEventListener (MouseEvent.MOUSE_UP, stopScrolling);
stage.removeEventListener (Event.ENTER_FRAME, setScrollPercent);
}

function scrollText(event:Event):void
{
targetScroll += scrollDirection;
philText_mc.y = (philText_mc.y - targetScroll) / acceleration;
if(philText_mc.y > minScroll)
{
philText_mc.y = minScroll;
targetScroll = minScroll;
}
of other if(philText_mc.y < maxScroll)
{
philText_mc.y = maxScroll;
targetScroll = maxScroll;
}
scrollPercent = (philText_mc.y - minScroll) / (maxScroll - minScroll);
scroller_mc.y = (scrollPercent * (line_mc.height - scroller_mc.height)) + line_mc.y;
}

function stopScrolling(event:MouseEvent):void
{
scrollDirection = 0;
}

textLoader.load (textReq);
scroller_mc.buttonMode = true;
philText_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
scroller_mc.addEventListener (MouseEvent.MOUSE_DOWN, dragScroller);
textLoader.addEventListener (Event.COMPLETE, philosophyTextLoaded);
up_btn.addEventListener (MouseEvent.MOUSE_DOWN, scrollUp);
down_btn.addEventListener (MouseEvent.MOUSE_DOWN, drop);

I don't know if I already talked to you or not Sarah... I've made for one person recently however... I do not consider myself to be an expert with this stuff, and I gain no rewards for my outlook on the approach of a design solution. I say, if it works, use it.  If you can think of another way to help you on a Knoll, continue it... Doing this reaches you to achieve the solution that you need for the approach that you have filed.  Everything what you end up doing, you learn new things...  With Flash you really learn only by try, fail, rinse and repeat... (my opinion/experience)

Tags: Adobe Animate

Similar Questions

  • SideWinder X 8 right click the button and the scroll button no longer works

    the scroll button works more out of nowhere and shortly after also the button right of the mouse has stopped working, is in any way I could fix it? I tried to reinstall the software for this, after the scroll button does not, which did not help.

    Hello

    1. it works on another computer?

    I suggest you to follow the steps from the link below and check if it helps.

    Method 1:  Mouse, touchpad and keyboard under Windows problems: http://windows.microsoft.com/nl-BE/windows/help/mouse-touchpad-and-keyboard-problems-in-windows

    Method 2:  The problems with the mouse button or scroll the parameters

    http://support.Microsoft.com/kb/303091

    Hope this information is useful.

  • Adding an amount of math to dynamic text

    Hi all

    I'm working on a keyboard that has a clock, allows you to enter an amount of time and then reverse this amount or add seconds.

    Here is the file: Flash movie

    As you can see there are a few things that I couldn't do because of my level of skill from the beginning:

    1 a) 14:34 is not really a clock works, its just the text. While he didn't need actually works like a real clock, it should have the colin flashing, and when you press one of the numbers 1-9, it should clear away and present: 00, or: 0 (number of powered button).

    1 (b) how to restrict the area of dynamic text to only four numbers in the form "xx: xx", where x is a number from 0 to 9, then a space on each side of the colin. Get numbers added the right first x and have pumped to the next placeholder. (dc: ba)

    (2) even once, press OK isn't really count anything, it just says: "cooking". "." The OK key, how to know the button down to 0 regardless of the number in the dynamic text box?

    (3) the Add button is supposed to add 2 seconds to any number (except the clock) is displayed in the dynamic text box, but he simply placed a 2 beside the numbers. If 01:04 is displayed, add pressed must assimilate 01:06, not 1:042

    Here is the code:


    Btn1.thenumber.text = "1";
    btn2.thenumber.text = '2 ';
    btn3.thenumber.text = '3 '.
    btn4.thenumber.text = '4 ';
    btn5.thenumber.text = "5";
    btn6.thenumber.text = "6";
    btn7.thenumber.text = "7";
    btn8.thenumber.text = '8 ';
    btn9.thenumber.text = "9";
    btn0.thenumber.text = '0 '.
    okButton.theNumber.text = "OK";
    cancel.theNumber.text = "CANCEL";
    addmore.theNumber.text = "add";
    theCode.text = '02:34;



    Btn1.onPress = function () {}
    theCode.text += '1 ';
    };
    btn2.onPress = function () {}
    theCode.text += '2 '.
    };
    btn3.onPress = function () {}
    theCode.text += '3 '.
    };
    btn4.onPress = function () {}
    theCode.text += '4 '.
    };
    btn5.onPress = function () {}
    theCode.text += "5";
    };
    btn6.onPress = function () {}
    theCode.text += "6";
    };
    btn7.onPress = function () {}
    theCode.text += "7";
    };
    btn8.onPress = function () {}
    theCode.text += "8."
    };
    btn9.onPress = function () {}
    theCode.text += '9 '.
    };
    btn0.onPress = function () {}
    theCode.text += '0 ';
    };
    okButton.onPress = function () {}
    theCode.text = "Cooking";
    };
    cancel.onPress = function () {}
    theCode.text = '02:34;
    };
    addmore.onPress = function() {}
    theCode.text = theCode.text + 2;
    }

    I'd do it in a completely different way. Use numbers and then display as text. For example, you do the math with the number and only change to the text when you want to display it. For example:

    If (myVar<>
    myVar = "0" + myVar
    }

    You can also code to check if the number is greater than 59, in which case he must go to '00' and the numbers hours increment.

  • Whenever I try to click on the "back" button or the scroll bar, I get a popup asking me stupid questions, i.e.: Customize the toolbar / return reload etc how can I disable this gene

    When I click on the "back" button or the scroll bar with my mouse, I get a popup asking if I want to customize my toolbar back/reload/open (scrolling) or in a new window? I'm then cannot clear the pop-up window. How can I remove/fix this very annoying problem. I spend a lot of time trying to remove these popups and they keep recurring. No fix for that. I can't seem to find one in the preferences, and I'm starting to hate this OS because of this. Help!

    Please post a screenshot that shows what you hear. Please do not include personal information.

    Start a reply to this message. Drag the image file in the editing window downloading. Alternatively, you can include text in the response.

  • Scroll buttons in the scroll bar of the timeline in AdobePremiere CS6

    I see a lot of questions about the scrolling speed in the timeline, but I used very intense buttons scroll, when I had long delays (more than 4 hours) and I was with ZoomIn almost 90%.

    No one knows, is it possible to activate the scroll buttons in the scroll bar of the timeline in AdobePremiere CS6, as it was in CS5/CS4?

    CS5 image: http://www.maclife.com/files/u129772/2010/06/premiere_full.jpg

    CS6 image: http://www.100acrefilms.com/blog/wp-content/uploads/2012/04/Premiere-Pro-CS6.png

    Scroll to demo buttons CS5 imageon the bottom margin, the bar mounting horizontal scrolling left and right.

    Demo image CS6, on the horizontal scroll bar of the timeline bottom margin does not contain the scroll buttons.

    Currently there are no available in Premiere CS6 scroll button, as in a classic scroll bar.

    I would like to have back the scroll buttons in the horizontal scroll bar of the timeline, that were available in version CS5, CS4, CS3, Pro2.

    In a calendar with more than 3 hours, it was very convenient to go right or left, that even I, I zoomed in.

    I pressed the left/right scroll button in the timeline, and I was able to move with one (or more) images in desired side.

    Thank you for the answers / suggestions.

    There is no settings for this user.  The scroll bar is now a scroll/zoom combo bar and we are pretty well stuck with her.  You can grab the bar and move it if you wish, and I am pleased to announce that first Pro CC now scrolls a flow can be used with the mouse wheel. (On my system Windows 8 personal, at least.  "We'll see if that's true for my Windows 7 edition rigging as well.)

  • Cannot restart or refresh my iPhone 7 from the "home" button and the sleep/wake button at the same time

    I'm having difficulty trying to restart and update my iPhone 7 using the Home button and the sleep/wake button at the same time, when I do my phone takes a screenshot of the home screen.

    Should I turn off my Touch ID?

    Basically my home button button and / standby works not together at the same time.

    You need hold the House and turn off the button for 20 seconds, until the Apple logo appears.

  • The orange Firefox button and the Navigation toolbar is on the same line

    Someone interfered with my Firefox settings and goofed a bit. Now the orange Firefox button and the Navigation toolbar are on the same line/line, as shown in the image below. Can you help me with the Firefox orange button at the top of the Navigation toolbar (as usually is the case)?

    http://PUU.sh/4NoO8.jpg

    Thank you very much! I had this same problem. I'd rather have my tabs at the top, in line with the orange. For some reason any that an add-on reset my 'browser.tabs.drawInTitlebar' to false, which looked horrible and wasted a whole bar of space by the presence of a large space empty on the top of my screen. It fixed my problem!

  • How can I remove the 'Subscribe now' button and the topic when you see an RSS feed?

    How can I remove the 'Subscribe now' button and the topic when you see an RSS feed?

    It is a yellow box that appears at the top of the page. It has options to subscribe to the RSS feed displayed.

    How can I remove this whole box to display?

    Thank you
    ~ Michel

    Make sure that the userContent.css file is a CSS (cascading style sheet) file and is not a hidden .txt file extension.

    You can use this button to go to the Firefox profile folder:

    • Help > troubleshooting information > profile directory: see file
  • I a s 6 more and when using the phone, if my face touches the screen it clicks on the logout button and the phone hangs up the call. Is it possible to prevent this without holding the phone away from my face when calling?

    I a s 6 more and when using the phone, if my face touches the screen it clicks on the logout button and the phone hangs up the call. Is it possible to prevent this without holding the phone away from my face when calling?

    iPhones have a proximity sensor which is supposed to automatically turn off the screen when you hold it in your face. If this is not the case you can take the phone and have it checked.

  • In the latest version of MF, there is a missing button, who was in the previous version: between backward/forward buttons and the bar hits there was little flash, who showed a few recent pages I just went through. How can I restore it?

    In the latest version of MF, there is a missing button, who was in the previous version: between backward/forward buttons and the bar hits there was little flash, who showed a few recent pages I just went through. How can I restore it?

    If you mean the drop marker so you can always get history buttons front and rear, if necessary by left clicking and for a second, or by right-clicking on them.

    If you want to continue the brand drop there too there is that Extension to https://addons.mozilla.org/en-US/firefox/addon/backforward-dropmarker/

    Also the abbreviation for Firefox is Fx

  • The "Open new tab" button and the shortcut "Ctrl T" fail to open a NEW TAB

    The "Open new tab" button and the shortcut "Ctrl T" fail to open a NEW TAB

    Install Firefox 4 beta that healed, but brought other problems.

    The Ask toolbar is initially in the version of Firefox 3.6.13. Obviously something in this extension is not compatible with a Firefox security patch. Disable this extension or uninstall it.

  • The Start button and the taskbar on my computer has changed and I don't know how to get back to its original look, I have windows vista

    The Start button and the taskbar on my computer has changed and I don't know what to do to get back to its original state. I have windows Vista

    Hello

    Have you changed the desktop theme?

    Change windows to Classic view

    http://Windows.Microsoft.com/en-us/Windows-Vista/change-Windows-to-Classic-view

    Refer: Change Desktop Theme

    http://Windows.Microsoft.com/en-us/Windows-Vista/change-desktop-theme

    Why are some Visual elements will automatically turn off?
    http://Windows.Microsoft.com/en-us/Windows-Vista/why-are-some-Visual-elements-being-automatically-turned-off

    Thank you

  • the Start button and the taskbar disappeared in windows vista

    Original title: start button

    the Start button and the taskbar disappeared in wondows vista.

    It's ok in the profiles of other users.

    Hi GavinAlston,

    ·         Since when are you facing this problem?

    ·         You did it last changes before the show?

    ·         Are you able to see the desktop icons?

    Step 1: I suggest that you put your computer in safe mode and check if it helps.

    What is safe mode?

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-safe-mode

    Start your computer in safe mode

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode

    If you are able to run safe mode then try to clean boot.

    Step 2: I recommend you perform the clean boot.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

  • Problems with the sound button and the wireless button

    I have a computer laptop dv6-2155dx, and he has a problem with the sound, the button bar button and the wireless button, all of them continue to work, I do not know if I made a mistake and let them turn off or there is another way to get available.

    I need some advice.

    Hello

    Do a hard reset:

    1 disconnect all devices and remove all USB devices and multimedia cards.

    2 disconnect the power adapter, remove the battery and then press in and hold the button for at least 1 minute.

    3 reconnect the power adapter (do not connect the battery), press the power button

    Verification is your problem is resolved or not.

  • This may seem like a strange question, but im trying to encode two buttons Flash Adobe, next and previous, however, when I put the thumb to the next scene and play on the next button and the previous scene and play on the previous button, it keeps switchi

    This may seem like a strange question, but im trying to encode two buttons Flash Adobe, next and previous, however, when I put the thumb to the next scene and play on the next button and the previous scene and play on the previous button, it keeps switching autour.

    If you have symbols of button on the stage to the next and previous, each of these symbols has an instance name with a listener event attached to it. The event listener is linked to a mandate. You can have a single event point to a function. So for example, if you have a next button and a click event that points to a function that says something like nextFrame(); and then you want to use the next button to point to a function that says something like nextScene(); you will need to use another instance of this next button and have this different instance to use a different event handler to point to a different function. Who help me?

Maybe you are looking for

  • Pavilion DV7: Looking for laptop with 2 HDD bays

    I'm looking to replace my Pavilion dv7 with a new laptop computer.Can someone tell me what current models have 2 bays for hard drives, because it is what I currently have.I don't want to replace the optical drive.

  • Replacement for HP Pavilion Elite e9250t HARD drive

    I get an error message saying "A disk in a RAID 0 volume is a failure". I plan to replace both drives, currently, to 500 discs with a capacity higher than as 2 TB each. The Pavilion Elite e9250t supports 2 TB disks? And can I install them with RAID,

  • Key to PC upgrade/Windows 7 OEM

    I have a Dell Vostro 220, which is about 5 years old. Following a recent update to Photoshop, I find that I have problems with the 4 GB of RAM constraint, imposed by the motherboard and also the OEM Windows 7 Pro 32-bit. So I intend to replace the ca

  • 64-bit driver for printer deskjet 5550

    When you try to upgrade to win 10 of win 7 I found this 10 victory did not support the driver 64 bits (deskjet 5550. When I tried to come back to win 7 64-bit driver was absent. I have been all over the site of HP and others to find a 64 bit driver w

  • Please help to cancel the subscription to Premiere Pro duplicate

    Hi Please help to cancel the one subscriptions to the Premiere Pro due to the extra double subscriptions because of the delay of payment. My ID REMOVED I thank you in advance[personal information... [Mod - https://forums.adobe.com/docs/DOC-3731][This