Action Script Newbie (Calling a URL)

All, sorry I know this is probably an easy one, but I am a
flash newbie and trying to learn what I can. Basically, I have the
code for a simple MouseEvent.CLICK.
(I watched the Lynda.com Flash videos.)
//nav buttons
var nextSection:String = "TEST1";
function onHomeClick(evt:MouseEvent):void {
nextSection ="TEST2";
trace(nextSection);
push_btn.addEventListener(MouseEvent.CLICK,onHomeClick);
This works fine, so I understand the concept, so how do I
open a webpage to any website. Would like for it to open in a
different window.
Thanks

Here's a link to information that will help you:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html?flash/net/package.htm l&flash/net/class-list.html

Similar Messages

  • Action Script Newbie has problem with Slide Show Pro

    Hi,
    here is a demo page -
    http://www.libertypromotions.com/asptest/newsite/cars/product_page.htm.
    The flash gallery in the top left is my problem child. I am
    using Slide Show pro to display my images but I want to add some
    external buttons that will switch albums when you click them (all
    images are in there own album, giving me the Grid effect when you
    click see all) I have asked for help on how to do this on their
    forums, but they are useless (so far) so I came here. Below is the
    code SSP provides for external Next/Previous buttons that switch
    images inside albums.
    I am hoping someone here knows SSP well enough to help me
    with this.
    Thanks in advance.

    cowenstx,
    Javascript is VERY different from Java. Your code example is Javascript, a scripting language invented by Netscape. Do a web search for "javascript images" for lots of good pointers.

  • Action script flash

    hello
    i have made one touch screen frame using infrared for my project i am a U.G student of electronics and communication and i have made this touch screen frame to count the coordinates so i passed my coordinates to com port and i want to pass this coordinates to flash action script game called wall pong but i dont know the flash action script as i haven't studied the action script so how can i pass this coordinates to flash i can able to pass the coordinates to net port .but from that i couldn't pass it to flash game i have download the code from the internate. but i couldn't understand. what should i do??? can any one help me out??

    to communicate with any kind of non-standard hardware you will have to run some kind of virtual server that listens to your device and prepares it for flash.
    Look into WiiFlash, it manages to get Flash communicating with a WiiMote:
    https://code.google.com/p/wiiflash/
    It will certainly give you an idea how to jumpstart your won project

  • Help with Nav Bar using Action Script 3

    I am a flash NOOB to say the least.  Trying to teach myself.  Thank God for YouTube! LOL!  Anyway, I have build a Nav Bar for a site that has a sliding bar on the bottom of it that follows the mouse.  The problem with this nav bar is that when you change pages inside the site, the slider resets back to position X/Y = 0 and you really don't know what page you are on for sure without me having to identify each page in the page body itself.
    Does anyone know of a way using action script to have the URL of the page sent to flash and in turn use that URL to set the X and Y position of the slider to the appropriate X and Y of the button on the Nav Bar for the page the user is on?
    I have heard of using flash.external.ExternalInterface but now for sure how this really works nor if I can assign it to a variable for reference inside the action script.
    Any help would be appreciated greatly!!

    The Flash Nav Bar is at the top of each page.  But yes, when you click a button inside the flash nav bar it takes you away from your current page and loads a new one.  I am trying to tell the swf file which page it is on so I can set the X and Y position of the slider.
    You will have to excuse me if I am so noob that I loose any of your replies to this as just as Flash is new to me, so is the lingo.
    Thank you for your help.  I will research FlashVar but if you have any other ideas then I am open to them.

  • Problems adding  url link to buttons in action Script 3

    each time I added it link 1 to the button on file i get these error messages-  
    1046: Type was not found or was not a compile-time constant: link1.
    1180: Call to a possibly undefined method link1.
    Warning: 3594: exec is not a recognized method of the dynamic class RegExp. var r:Object = p.exec(s);  
    This is the code I am using:   import flash.net.navigateToURL; import flash.net.URLRequest;  var link_one:link1;  link_one = new link1(); stage.addChild(link_one);  link_one.addEventListener(MouseEvent.CLICK, buttonClickHandler);  function buttonClickHandler(event:MouseEvent):void { var url:String = "http://www.masterpiececorp.com/ARMREF.htm"; var request:URLRequest = new URLRequest(url); navigateToURL(request); }    I have no other problems with link 3 or 4, just link 1  I still cannot get my urls link to movie clips on the flash  
    Can you upload flash here? if not I have a image capture I can use to have you look at my buttons  and action script code. i have been to every forum I know and not any have been helpful at all. This is my last hope.
    Very frustrated newbie  Gina T
    Message was edited by: gtaylor0406

    The way you had your code originally would be correct...
    var link_one:link1;
    link_one = new link1();
    addChild(link_one);
    The 1046 error is indicating it doesn't recognize the link1 class.  So the first thing you need to make sure of is that you have assigned the link1 class designation to whatever symbol that is in the library.

  • Help... link URL from XML to Flash Action Script 2

    I am trying to link a different URL to each of my files in XML and use this XML in Flash were I created a carousel. In the carousel, when you click on a picture I would like to insert a specific URL. Each picture will have a different URL (http://------------).
    Here are my codes:
    XML:
    <icons>
    <icon image="icon1.png" tooltip="Planning" />
    <icon image="icon2.png" tooltip="Investments" />
    <icon image="icon3.png" tooltip="Education" />
    <icon image="icon4.png" tooltip="Insurances" />
    <icon image="icon5.png" tooltip="Mortgages" />
    <icon image="icon6.png" tooltip="Retirement" />
    <icon image="icon7.png" tooltip="Business Owner" />
    <icon image="icon8.png" tooltip="Banking" />
    </icons>
    Flash Action Script 2:
    import mx.utils.Delegate;
    var numOfItems:Number;
    var radiusX:Number = 250;
    var radiusY:Number = 75;
    var centerX:Number = Stage.width/2;
    var centerY:Number = Stage.height/2;
    var speed:Number = 0.01;
    var perspective:Number = 60;
    var home:MovieClip = this;
    var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
    tooltip._alpha = 0;
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function()
    var nodes = this.firstChild.childNodes;
    numOfItems = nodes.length;
    for(var i=0;i<numOfItems;i++)
      var t = home.attachMovie("item","item"+i,i+1);
      t.angle = i * ((Math.PI*2)/numOfItems);
      t.onEnterFrame = mover;
      t.toolText = nodes[i].attributes.tooltip;
      t.icon.inner.loadMovie(nodes[i].attributes.image);
      t.ref.inner.loadMovie(nodes[i].attributes.image);
      t.icon.onRollOver = over;
      t.icon.onRollOut = out;
      t.icon.onRelease = released;
    function over()
    home.tooltip.tipText.text = this._parent.toolText;
    home.tooltip._x = this._parent._x;
    home.tooltip._y = this._parent._y - this._parent._height/2;
    home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
    home.tooltip._alpha = 100;
    function out()
    delete home.tooltip.onEnterFrame;
    home.tooltip._alpha = 0;
    function released()
    function moveTip()
    home.tooltip._x = this._parent._x;
    home.tooltip._y = this._parent._y - this._parent._height/2;
    xml.load("icons.xml");
    function mover ()
    this._x = Math.cos(this.angle) * radiusX + centerX;
    this._y = Math.sin(this.angle) * radiusY + centerY;
    var s = (this._y - perspective) / (centerY+radiusY-perspective);
    this._xscale = this._yscale = s * 100
    this.angle += this._parent.speed;
    this.swapDepths(Math.round(this._xscale) + 100);
    this.onMouseMove = function()
    speed = (this._xmouse-centerX)/10000;
    Thanks so much for the help.

    You should be able to add that data into your xml tags and then extract it in the AS2 onLoad function...
    XML:
    <icons>
    <icon image="icon1.png" tooltip="Planning" linkURL="http://www.someURL.com/somePage.html" />
    AS2:
    xml.onLoad = function()
    etc....
    t.onEnterFrame = mover;
    t.toolText = nodes[i].attributes.tooltip;
    t.urlLink = nodes[i].attributes.linkURL;
    etc...

  • Call an URL on Button action

    How to call an URL on action of Button

    Hi Poonam,
    Use this code inside the action of the Button.
    String linkToBeOpen = "https://www.sdn.sap.com/irj/sdn";
    IWDWindow window =
    wdComponentAPI.getWindowManager().createNonModalExternalWindow(
                        linkToBeOpen,
                        "My window title");
    window.show();
    Regards,
    Mithu

  • Flash Newbie needs help with Movie Clips/Action Scripting

    Hi -
    I'm having a problem with my movie clips playing
    simultaneously and cannot, for the life of me, figure out what I
    have done wrong. I'm new to flash, so I may have set something up
    incorrectly, but here's what I have so far:
    11 layers, total: 1 layer with 10 control buttons, each
    button with the following actionscript:
    on (release) {
    gotoAndPlay(85);
    Where the number changes in relation to which keyframe the
    next movie is on.
    I have 10 movies, total, but they are only movie clips,
    essentially photo slide shows with audio, made all in the library.
    The problem happens when I click on the second or third
    button. Not only does the movie that I have selected begin to play,
    but all of the previous clips do as well, so it all sounds quite
    garbled. I don't know what I am missing in the action script, as my
    Action Layer has a stop command on it at each keyframe where there
    is a new clip to play.
    I have tried to add a stopAllSounds command, but I'm afraid
    that doesn't do anything because it is not a "sound file" per se,
    playing in the timeline.
    I'm at the end of my rope and really need some help in
    figuring this one out. My project is hanging in the balance on
    this, as I have scripted everything else correctly and it runs
    beautifully.
    Please help!
    Thanks,
    Caroline

    Each layer has a blank keyframe before and after each
    movieclip. Each movie clip is at a different frame. Even with the
    blank keyframes added, the second video starts to play and then the
    first video begins to play. Same happens if I click on the third
    button. Third plays, and starts 1st and 2nd shortly thereafter. Is
    there an action script I can put in that will tell the timeline
    that, when a button is clicked, no matter where the movieclip is,
    it will stop and start the newly selected movieclip?

  • Newbie here, with button action script issue

    I have just started to scrach the surface with actionscript
    and I have attempted to assign it to buttons. Much to my supprise,
    it worked, sort of... All my buttons require a double click the
    first time you click on them. I was able to put
    this together, by
    using the following action script for all my buttons:
    on (release) {
    ybutton.onRelease = function() {
    gotoAndStop(28);
    So I have 2 questions. What actionscript will give me the
    single click that I am looking for? Also, is there any shortcut to
    making a broad change? In other words, will have to switch out the
    code for every button on 37 frames?
    Thank you

    1: // You needed two clicks because you have 2 onRelease.
    on (release) {
    gotoAndStop(28);
    2: Yes, it'll go fast I would copy the above and paste where
    needed then just change the frame #.

  • Updating HTML code dynamically and calling a URL

    Hi All,
    I have the following requirement -
    Consider the below HTML code:
    In the above code, the URL >>
    https://secure3.i-doxs.net/nytimes/BillaccessView.asp has to be called and this should PICK UP the values from the above code - For example: Client and ABCCO. In other words, the page that is going to be displayed by specifying the URL should use the values that are dynamically generated and specified in the above code. 
    Please let me know if you have any inputs on how to achieve this.
    Best Regards,
    Rajeev

    Hi there ,
    i have a solution for your problem as follows :
    Do not mention the action in form tag ; do it as follows .
    if you have a submit button then use following code in onclick even of submit as onClick="do_this()"  else use onsubmit="do_this()" in <form > tag .
    Include the following <script> </script> in Head element .
    the JS function do_this should be as follows :
    <Script language="JavaScript">
    function do_this()
       var w_ele;
       w_ele = document.getElementById('CLIENT') ;
       w_client = w_ele.value ; // this will give u the name entered in client text field ie. ABCCO in this case.
    var w_url = "https://secure3.i-doxs.net/nytimes/BillaccessView.asp?w_clien="+ w_client ;
      w_form = document.getElementByID('FRM_MAIN');
      w_form.action = w_url ;
    /*this will call the url as "https://secure3.i-doxs.net/nytimes/BillaccessView.asp?w_client=ABCCO" */
    </script>
    NOTE :
    you need to define ID property for form and text element . currently you have used juse name property .
    in the w_url , before' ? ' the name of the parameter in which you want to capture the dynamic client value in target should appear ( i have used w_client just as an example)
    so modifications needed in ur HTML as :
    <FORM name="frmMain"  id="FRM_MAIN" method="POST">
    and
    <TD> First Name: </TD><TD><INPUT type="text" id="CLIENT" name="Client" value="ABCCO" size="50" maxlength="32"></TD>
    I am sure this will solve ur problem as i have done the same thing. if not then feel free to mail me at [email protected]
    do reward me points if found useful.

  • Where do I put my Action Script?

    So, I created a small Flash site with no loading of external
    swfs. I am strictly using the timeline using labels. I have a layer
    for my main buttons (home, portfolio and timeline). I have selected
    AS3 for the file and I have those buttons working fine.
    I have a button for my portfolio where thumbnails will pop up
    after being pressed. I want to link those thumbnails to the URL's
    of the actual websites. Where do I put the action script?
    I also want to have my email at the bottom of the screen so
    you can click on it to email me. I am used to using AS2 whwere you
    simply put the code on the button.
    Thanks,
    Gabe

    Hey, so thank you for the fast reponse. I totally agree with
    you on learning AS3, I don't want to go back to AS2.
    I already have the code you supplied so I understand what it
    is doing but my question is where do I put it in this case? I
    always create an action layer as you mention. In my action layer, I
    have frame 1 with my preloader code and then frame 2 with my code
    for my main buttons. They call to the labels. So, when I press
    portfolio for example, it goes to that label.......a shape tween
    starts and my portfolio thumbs appear. I then want those thumbs to
    link to the URL of those sites.
    So, where do I stick your code?
    Thanks again for all your help. I am NEW to AS3 and this is
    great learning.
    Thanks,
    Gabe

  • Action Script and button Behavior

    Imported a bmp as png, made it into a movie clip. Setup the
    AS to call for page 4. It works great. I would now like to have a
    text box come up on the rollover. I tried to nest the mc into a
    button. I can make the text box work but the script won’t
    work when I click.
    Could you refer me to a resource that would explain the
    relationship between the two. Or is there another way to do this.
    So the text box says “Click here for more Info”.
    Can’t click to execute Action Script, I think it is not
    addressable because it’s nested in the button.
    If I reverse the nesting then the text box in the over frame
    won’t execute.

    Mjddoyle wrote:
    > Imported a bmp as png, made it into a movie clip. Setup
    the AS to call for page
    > 4. It works great. I would now like to have a text box
    come up on the rollover.
    > I tried to nest the mc into a button. I can make the
    text box work but the
    > script won?t work when I click.
    > Could you refer me to a resource that would explain the
    relationship between
    > the two. Or is there another way to do this.
    > So the text box says ?Click here for more Info?. Can?t
    click to execute Action
    > Script, I think it is not addressable because it?s
    nested in the button.
    > If I reverse the nesting then the text box in the over
    frame won?t execute.
    Sorry, a bit chaotic and i can't really get your arrangement.
    Please upload what you have so far, we will go from there.
    There is so many ways to achieve the same thing in flash that
    there
    is no point going into it, could turn up suggested solution
    totally
    does not suit your project. Need to see what you have so far.
    Upload to your server and provide URL for us to check.
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Having trouble adding action script to button symbol

    Hello everyone:
    I am hoping someone will read this as I am a developer in
    'dires straits' with Flash ( a newbie). My problem regards a
    layer called "button" which has already been converted to symbol
    and turned into an invisible button. The problem lies when I try to
    use the selection tool to select it so that I can add action script
    to it. Instead of the actions dialogue box saying "actions-button",
    it says "actions-frame", and as a result, the action script doesn't
    work. I don't know what to do, it should be simple to select it but
    something is wrong. If you feel a need to help a developer in need,
    you can email me at [email protected], and I can e-mail
    you the file so that you can help. Thanks, or you can call me at
    310-867-5167
    Corinna

    Can you plant the fla file on a server and provide a link to
    it? Zip it up first if possible.

  • Adding data to cfgrid using action script

    how can i add data to a grid row called name in action
    script. i have a cfselect control containing name of students and i
    want to add the values of the selected student from the list to
    grid.

    Did you add your instance of SpectrumCanvas to the stage with addChild()?
    If so, you should boil your posted code to a more simple example.
    If this post answered your question or helped, please mark it as such.

  • Error message with Action Script 2.0 file

    Hi,
    I am trying to edit an old flash file that uses Action Script 2.0. I am using CS6 and keep getting the following error message after publishing:
    Scene 1, Layer 'AS', Frame 1, Line 5, Column 29
    1067: Implicit coercion of a value of type int to an unrelated type String.
    Can you suggest any fixes or workarounds? I also have Flash 4.0. Can i downsave the file? If so, how?
    Thanks!

    Thank you. I think that did fix the original two errors. But now upon test of the file, I get some new errors:
    Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 3
    1120: Access of undefined property ratio.
    Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 20
    1180: Call to a possibly undefined method number.
    Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 27
    1120: Access of undefined property _root.
    Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 9, Column 27
    1120: Access of undefined property ratio.
    And on the MoneySlide layer in Actions:
    this.ratio = 0;
    this.loadBar._width = 0;
    this.dragger.ratio.text= "$0";
    dragger.onPress=function(){
              this.startDrag(true,0,0,line._width,0);
              this.onEnterFrame=function(){
                        ratio=Math.round(number(_root.transitBenefitLimit/100)*(this._x/(line._width/10 0)));
                        loadBar._width = Math.round(this._x);
                        dragger.ratio.text= "$"+ratio;
    dragger.onRelease=dragger.onReleaseOutside=stopDrag;

Maybe you are looking for

  • Call Web Service

    i have call a Web Service of test Il seguente testo d'errore è stato elaborato nel sistema DV1 : Errore di chiamata delle funzioni del SOAP run-time L'errore si è verificato nell'application server sapdev01_DV1_10 e nel processo operativo 0 . Tipo di

  • Heirarchy Level in BW Rerports

    Hello Experts, Need to show the Activated Hierarchy Level in the reporting header (Upper left corner of the Excel Sheet). Is there any way. I tried out the option of activating the display option if the "Value of Nodes" in the properties of the hiera

  • Probem with AirPort Extreme Update 2007-001 and InternetConnect

    Hello, I have just installed AirPort Extreme Update 2007-001 through SoftwareUpdate. SoftwareUpdate reported a successful installation and invited me to restart. On restart, the machine does connect correctly to my wireless network, but InternetConne

  • How to export Address Book content as Unicode with applescript?

    Hello, I have a problem for exporting address book content. I'd like to export "My Card" to a vcf file and use another application to read it. So I have the following applescript: *+tell application "Finder"+* *+set theFolder to folder "TemporaryItem

  • Exit from CIN within Error Handling Sub-Function

    I have a CIN which has the code divided betwee the CINRun() function, a number of other functions & a #included .C file. I want to put some error handling into my CIN, so if an error occurs I want execution to return from the CIN to LabVIEW immediate