Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6163435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:49:29+00:00 2026-05-23T21:49:29+00:00

I’m using Flash Pro. CS5 with ActionScript 3, and I’ve never worked with flash

  • 0

I’m using Flash Pro. CS5 with ActionScript 3, and I’ve never worked with flash before, and I’ve searched for a while for the way to do this and I continuously get syntax errors with this code. I saw someone asked a similar question, and a person said the code was deprecated, so I can only assume since mine looks very similar that its also deprecated. From flash I’m trying to make a button that will open a PDF file. The code I have right now is;

on(release){
    getURL("Index Dividers.pdf");
}

and my syntax error keeps saying ‘expecting semicolon before left brace’ Stupid as it may sound, I added a semicolon before the left brace, and then one error turned into 3 errors, so that didnt solve anything. So does anyone know the proper code to open a PDF file? It will be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:49:29+00:00Added an answer on May 23, 2026 at 9:49 pm

    getURL has been replaced with navigateToURL, which works by accepting a URLRequest object. In your case, it looks like this:

    navigateToURL(new URLRequest('Index Dividers.pdf'));
    

    As for the click handler, you can’t you the on(ACTION) notation anymore, everything is event based now. You need to set up a listener on your target, and assign a handler function to be called when the event fires:

    this.addEventListener(MouseEvent.CLICK,clickHandler);
    
    function clickHandler(evt:MouseEvent):void
    {
        navigateToURL(new URLRequest('Index Dividers.pdf'));
    }
    

    A bit more about events:

    Firstly, an event. An event can be thought of as a message that an object broadcasts when an action has occurred. The one we’re using here is MouseEvent.CLICK. This actually resolves to the string ‘onClick’, that is stored in the MouseEvent class, but don’t worry about those details for now. An object will broadcast this event when the user clicks it with their mouse. Other mouse events include MouseEvent.MOUSE_OVER and MouseEvent.MOUSE_OUT. There are other events for all kinds of things, and you can even create your own.

    Now listeners. In order to know when an event has been dispatched by an object, you add a listener to that object. Using the example from above, we’ll break it down:

    this.addEventListener – we’re saying that we want to listen for an event coming from the targeted object. You have changed this in your code to target a button instance, which is perfect.

    (MouseEvent.CLICK, – this is the event you want to listen for.

    clickHandler); – this is the function that will be called as a result of the event being detected.

    So now all you need is the function that we’ve named as the handler (the second parameter to addEventListener. This function must accept one argument, an event object. This is a reference to the actual instance of the event that was dispatched, and so for a mouse event it will be typecast as MouseEvent. In the above example we didn’t have any use for this object, but you must still have it in the function declaration or Flash will not compile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
In order to apply a triggered animation to all ToolTip s in my app,
I want use html5's new tag to play a wav file (currently only supported
I want to count how many characters a certain string has in PHP, but
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.