Read the part of a URL with ActionScript?

Hello. I was wondering if it is possible to read a part of a URL with ActionScript...

... For example, if I have three specific sites by country:

* www.somewebsite.com
* www.somewebsite.com.uk (United Kingdom)
* www.somewebsite.com.ca (canada)

I just want to make a Flash file I can load on three sites, but according to the site on which is pulled up, the file will do something different. So (in plain English) I mean:

If the URL contains '.uk', do something.
If she ".ca", do something else.
If she didn't do a third thing.


How I would write only in ActionScript, or is it still possible to read the URL of the page that plays on the .swf movie?...

Thank you!...

DIY_Lobotomy

> Hello. I was wondering if it is possible to read a part of a URL
> with ActionScript...

This is the case. :) Read the property MovieClip._url of the main timeline (the
main scenario is a clip), or the hand LoaderInfo.url property
the chronology loaderInfo property... If you use ActionScript 3.0.

for example
in a scenario main pre-ActionScript 3.0...
trace (this._url);

in a main storyline ActionnScript 3.0...
trace (this.) LoaderInfo.URL);

That will show you the domain name of the HTML file that contains the
SWF, you're in, and you can use strings, such as indexOf() methods to see if
the URL contains ".com", "co.uk" or similar. If you are using ActionScript
3.0, you can use regular expressions (see the RegExp class).

David Stiller
Co-author, Foundation Flash CS3 for designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design."

Tags: Adobe Animate

Similar Questions

  • How can I select all the cells in an AdvancedDataGrid with ActionScript?

    How can I select all the cells in an AdvancedDataGrid with ActionScript? I selectionMode = "multipleCells" and designViewDataType = "flat".
    Basically, I have a contextmenu and want to add a "select all" option.

    Thank you

    Yes you can do in actionscript as well.
    If selectionMode is set to multipleCells then:
    Section A Code attached

    If selectedMode is set to multipleRows, then there are two ways to do it.
    1 - the solution is given by Bryan Dresselhaus in his last message.
    2-section B in the attached Code

  • Reading the part of a string

    I have a table with a column "otname."
    Table1.otname contains several lines of alphanumeric string that resembles the following sample data:

    11.10.32 * 12 *. U.A.F.3.2.21.249.1
    2001.1.1003 * 8281 *. A.THE. PAINVIN
    2010.1.1003 * 8261 *. A.THE. B.B

    I want to read the fourth number in each chain (part of the string in bold) and write a query in Oracle 10 g
    to read its description stored in another table. My dilemma is to write the first part of the query.i.e. Choose the fourth issue of each string in an array

    My second query will be something like this:
    select description_text from table2 where sncode = 8281  -- fourth part of the data sample in every string
    Thank you very much.

    novice

    Oops... I forgot to change that:
    Fixed query:

    SELECT   description_text
       FROM   table1, table2
      WHERE   SUBSTR (otname, INSTR (otname,'.', 1, 3)
                             + 1,
                             INSTR (otname, '.', 1, 4)
                                  - INSTR (otname,'.', 1, 3)
                                  - 1)
                                   = sncode
    

    This will return rows from your table if the sncode appears as the fourth string (delimited by '.') in otname. What is your requirement?

    Kind regards
    JO

  • If I can reverse a Tween created with the GUI... .with actionscript?

    Hi all

    I'm newer Flash, so it does not take much for granted. I have large gaps in my understanding.

    I created a motion tween (by good service a movieClip on the timeline and selecting 'create the motion tween'). Now I want to reverse the trend (using the term of "yoyo") when the audio file is played. I know how to do this with an interpolation (using the tween class) which was created in the first place with actionscript. How can I do overturn if interpolation is not already (named and included) my actionscript?

    Thank you

    If you tween is in a MovieClip you can actually play the MovieClip it back like this:

    addEventListener(Event.ENTER_FRAME, enterFrame);
    function enterFrame(e:Event):void {
          prevFrame();
    }
    

    I do it all the time.

    -Aaron

  • How to read the XML doc in variable with XPath?

    Suppose that a variable in BPEL contains an entire XML document as (without the quotes):

    "value1 < foo > < bar > < / bar > < bar > value2 < / > < / foo >.

    How to read of BPEL an XPath expression with the value of the second
    < bar > element in a nother variable "target"?

    What do I have to use getvariabledata? How to pass the XPath?

    Peter

    Peter

    Here's how you can get there by business to be divested. You can access it by writing the XML expression (do not select foo--> bar directly on the tree) as below

    bpws:getVariableData ('Variable_name', 'Foo','/ NS4:foo / NS4:barbpws:getVariableData("intCounter")') and assign it to the variable "target". Here the value of the variable integer "intCounter" represents the nth element under the tag "foo". Let us know if you face any issues.

    Hope this will help.

  • Silverlight plugin crashes when Netflix Progess bar to advance or re-read the part of the film

    Netflix okay and amd starts successfully runs movies using Silverlight 5.1.20913.0 and the current version of Firefox (26?)
    However if I try to move forward or backward, using the slider of Netflix, silvery light crashes with the following message
    «A Script on this page may be busy, or it may have stopped responding etc.»
    "Script: http://movies.netflix.com/WiPlayer?movieid=70248289 & trkid = 13462100 & tctx=-99%2C-99%2C87ddc936-30f9-44a2-952b-92aa6b28a381-660455:0"
    CPU at 100% load.
    Netflix works flawlessly with IE 8 and Silverlight. BBC Iplayer etc pass OK OK movies
    I'm running on windows XP service pack 3 on a HP a1429.uk PC with AMD Athlon 64 processor.
    I installed the patch 'AGP program may hang' in the registory for "LargePageMinimum.
    I have a Nvidia Geforce 8400GS video adapter, running a composite video output to a TV in Dualview mode.
    Default appeared after the latest Nvidia driver update through microsoft
    I tried all the tips on Firefov execution in safe mode, etc.
    Looking for feedback

    CARE

    Disabling Plugin-Container is not a recommended solution
    

    There is a danger that Firefox itself will become crashy if you disable the plugin container.

    even more importantly Adobe is not testing the new versions of Flash with the in-process configuration, which means that we're seeing crashes which are specific to in-process.  {bug 769721]
    

    Unfortunately I know the problems of security, disable plugin - container.exe. I don't know that it is a problematic area in Firefox to manage plugins such as Silverlight and Flash related questions. Mozilla has known about flash player crashes for years for example and o guess they cannot not possible design that it is THEIR browser plugin container causing the problem and always point the finger to the flash. I'm sorry that I don't have the other answer for you.

    As long as the original article, I've referenced, you can use my regedit to implement as well and does not require a re-boot machine unless you have a blocked running process that you can not kill.

    I'm glad that I was able to get it resolved rather painless for you

    Best regards

  • How to read the text of an XML with the dom parser?

    Hi all

    It's my code. How will I be able to read the text inside the xml file using dom parser?

    my xml file is like this...



     
        LLEYTON
        Hewitt
        Australian
       
        1
        897
       

     


        André
        Agassi
        American
       
        2
        679
       

     

    which I stored in _xml.

    InputStream is = getClass () .getResourceAsStream (_xml);

    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance ();

    DocumentBuilder db = dbf.newDocumentBuilder ();

    Doc document = db.parse (is);

    NodeList nl = doc.getElementsByTagName("*");

    for (int i = 0; i)< nl.getlength();="">

    {

    System.out.println ("node name" + nl.item (i) .getNodeName ());  Player, firstname, lastname, tennis o/p

    System.out.println ("node value" + nl.item (i) .getTextContent ());  o/p value null, null, null, null

    }

    I want the text in the first name should get displayed as "Lleyton" and any other text in other tags as Andre/Agassi/American/2/679

    You can install JDE and operates the samples, you will find XMLDEMO that will help you read XML application blackberry;

    good luck;

  • The use of dynamic text with Actionscript

    I have a variable called "managername. My film requires data in a text document. The problem is that my flash variable name is also part of the name of the entry in the text document. Like this:

    myText_district = 109
    & myText_Ian = 189
    & myText_Dave = 8
    & myText_Ray = 14

    Y at - it a syntax that I can use in the field of the Var of the property Panel to get the variable equivalent to something like "myText"+ _root.managername? ".

    OR

    Is there an example somone can show me how to load variables from a text file in a dynamic text field SPECIFIC completely into the action script?

    Any help is greatly appreciated.

    Well, you will have to wait until the content of districtmanager.txt load in. All about the right time for the file to load interent. Flash is not wait until what the code load, it just not the loadVariablsNum and then continues on the trace that there no variables (again) with the name myText_Ian or what you have.

    If you are publishing for Flash 6 or higher, you should probably use the LoadVars class. This gives you the onLoad event so you can then put your code in there and make sure that variables are loaded before you try to use them.

    Another question, is what happens when you get a new Manager? You should put in another variable and make the entire file again. That's why I think you should consider possibly develop this with XML or another way of not having to hard-code these things.

  • Find and replace the part of a url in the menu

    I use a tesing server and have all my links in the pop-up menus that are linked. I'm about to go live and you want to substitute the name of the test server with the new true site name. Subdirectory names, and the page will be the same, just the domain part evolves. Is it possible to find and replace it in the world, or do I have to go into my png and redo every single link?

    You did your absolute links? Why?

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.dreamweavermx-templates.com - template Triage!
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================

    "EVN" wrote in message
    News:e64uf9$7LP$1@forums. Macromedia.com...
    > I use a tesing server and have all my links in the related pop-up menus
    > to
    > it. I'm about to go live and want to replace the tests
    > server
    > name with the new name of the real site. The subdirectory names and page
    > the
    > even, just the domain part is changing. Is there a way find and replace
    > This
    > in the world or what I have to go into my png and redo every single link?
    >

  • HTTP 413 - exception too large entity when you try to read the audio data from URL http

    Hello!

    I sent an audio file of size 718 KB on tamcat and I try to play via a URL but http 413 exception, please help here is my code:

    Try
    {
    Player p = javax.microedition.media.Manager.createPlayer ("http://192.168.0.172:8090 / new.wma");
    p.Realize ();
    VolumeControl volume = (VolumeControl) p.getControl ("VolumeControl");
    volume.setLevel (30);
    p.prefetch ();
    p.Start ();
         
    }
    catch (System.Exception e)
    {
    System.out.println (try ());
    }

    YOUR help is needed thanks.

    Hey thanks for much for your help... I managed to solve the problem using this example BufferedPlaybackDemo accept I made a few changes to it... This added to the URL and change the connection on Read_Write

    if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED)
                url.append(";interface=wifi");
            else
                url.append(";deviceside=true");
    

    Thanks anyway

  • How to describe the part of an image with color

    Can someone walk me through how to describe this logo in color? It has jagged edges, which are difficult to see in white, but I want to expose the logo all in yellow. No idea how. Thank you!

    Screen Shot 2016-04-21 at 12.03.51 PM.png

    autumns33771245 wrote:

    Can someone walk me through how to describe this logo in color? It has jagged edges, which are difficult to see in white, but I want to expose the logo all in yellow. No idea how. Thank you!

    1. Open the file
    2. Activate the selection tool while holding the SHIFT key, drag on a circle to embrace the logo and elliptical
    3. Go to Image > culture
    4. Place the logo cropped on its own layer (CTRL + J)
    5. Set your foreground to yellow color chip
    6. Press CTRL + left click the thumbnail of the layer on the layer with the logo (not the name) to load the logo
    7. Go to Edition > selection of contour (outline). Place of the race inside, try 4 px width, ok it
    8. Activate the tool magic wand and left-click on a white box, then hit delete on the keyboard
    9. Place a layer of vacuum between the background layer and the layer with the logo. I filled in black for the demonstration.

  • Hi, the 'after' see doesn´t work on my computer, I can see only photos in 'before' mode. The part "after" is blue with a white cross. The situation appear in the browser. (LR 6) Any advice would be great, thanks. Chris

    no after view.jpg

    Reach:

    Edit > preferences > Performance

    Lightroom > preferences > Performance (on Mac OSX)

    Disable the GPU acceleration.

    For Windows, you should go to the website of the manufacturer of your graphics processor and check the driver updates. Once updated you can try turning on GPU acceleration, otherwise leave this option disabled.

    Mac GPU, updates occur with updates to the OS.

    https://helpx.Adobe.com/Lightroom/KB/Lightroom-GPU-FAQ.html

  • I click on a title to read the news and article opens with writing so small I can't do it, what to do?

    I don't know all the details except that it's an old p/c, running old software.
    He disobeys any time

    Hello!

    On your keyboard press Ctrl + 0 together at the same time to set the default text size.

  • After you download CyberLink PowerDVD 12, am unable to read the comics

    Since the download, CyberlinkPower DVD 12, am unable to read the comics if it starts with a trailer or advertising.  When it comes to the "Play" button, nothing happens.  Someone, please help that Cyberlink will not say as to what is happening.  Thank you.

    Hello

    As much as we want to help you with this, I fear that this issue is not part of our scope of support. I recommend you contact CyberLink support, as they are one who takes over this issue properly and in the best position to address this problem.

    Thank you for your understanding in this matter.

    Thank you!

  • "Weird problem: cannot write the letter'm ' in Safari with active Javascript

    Hello. Starting with the last system update (for what I can tell), I get this weird behavior in Safari and safari ONLY: I can not enter the letter'm ' in any text field (for example, search google, bing search engine, google docs, search apple support). However, I can write perfectly well the letter'm ' in the address bar, as well as in other browsers (Opera, Firefox) in the exact same conditions. The only way I can get Safari to recognize'm ' is to disable JavaScript. However, I don't see any JavaScript code that can block the keyboard or the part of it. With the help of a U.S. keyboard.

    Any suggestion?

    Thank you

    Is the letter'm "replaced by another letter or symbol.   If Yes, what?   Or you're just an empty space?

Maybe you are looking for