How to place a string in a movieclip timeline variable to a url within a class request?

Hello

I coded a class of audio player, I want to be able to reuse throughout my project to a different sound to each movieclip. The audio player works great and loads of sounds when I request the url from the class, but I can't ask the url encoded on the chronology of the parent movieclip.

I have an instance of movieclip named musicPlayer in 4 different parent movieclips that is bound to a named MusicPlayer class that contains the code of my audio player.

To test, in one of the parent movieclips, I placed the following code to set the path of the url to a string variable:

var mp3url = "tuba.mp3";

Then, in my class, I said the same variable as a string:

public var mp3url:String;

and I tried passing to my application url:

mp3File.load (new URLRequest (mp3url));

Then I get an error: "1151: there is a conflict with the mp3url definition in the internal namespace."

As mentioned above, the sound is loaded perfectly when I set the url path to a string in my class variable as follows:

public var mp3url:String = "tuba.mp3";

Thank you in advance!

use a function to pass this variable or you'll have a timing problem:

in your class:

private void urlF(urlS:String):void {}

declare mp3url in your class

mp3url = URL;

You can now use mp3url

}

on your timeline:

varF ("tuba.mp3");

Tags: Adobe Animate

Similar Questions

  • How to avoid the string * empty * on new pushScreen

    Someone knows how to avoid the string * empty * coming on each press of the screen and instead * void * can I have my own channel at the same place... Please let me know its possible or not...

    Thank you

    read the API:

    http://www.BlackBerry.com/developers/docs/4.7.0api/NET/rim/device/API/UI/component/ListField.html#se... (java.lang.String, int)

  • Can anyone tell how to insert a string between the two another string...?

    Can anyone tell how to insert a string between the two another string...?
    For example: String1 = 'ABC '.
    String2 = "XY".

    I want that the chain of output like "AXYBC".

    If you have the Position where you want to place your chain, this might work:

    SQL> r
      1  declare
      2    vStr1 varchar2(20) := '123456789';
      3    vStr2 varchar2(20) := 'aa';
      4    nInsertPos number := 3;
      5    vResult varchar2(20);
      6  begin
      7    vResult := substr(vStr1, 0, nInsertPos) || vStr2 || substr(vStr1, nInsertPos+1);
      8    dbms_output.put_line(vResult);
      9* end;
    123aa456789
    

    If you want to insert it after a special character, you can search for the position of your character with the help of instr

    concerning

  • How to place a photo of 'album' in a 'book' you have already created

    How to place a photo of 'album' in a 'book' you have already created

    show the sidebar (menu display == > display the sidebar) and open the album - dragging the photo of the album to the project window to the bottom of the sidebar

    LN

  • How to pass a string to a vi from a dll?

    I have a DLL that generates errors in the log. How can I display my Panel before these errors? In other words, how to pass a string from a DLL to a vi using the library to call feature?

    Thank you

    Diego

    The DLL actually allocates memory for the string? If this is the case, there should be another function to free the memory. Otherwise you won't be able to do the deallocation of LabVIEW, which means you would have to write a wrapper DLL. If you do not have the deallocation, then you will have a memory leak.

    Are you sure that the DLL is not simply wait for a buffer "of a proper size? In this case, you can simply create a U8 in LabVIEW to a size that is larger that the largest string that you expect to get.

  • How to connect a string to Boolean true or false constant

    Hello.

    I can't try to figure out how to connect a string constant to a result of a function of true/false. I create a VI that creates a random number, and then has the user to enter a number in numerical order. These 2 numbers are compared, and if the number of users is smaller, I want a string constant to display "too small." If the user is equal, I want the string constant to display "correct" and if the number is larger, the constant will display "too big."

    This is a picture of what I'm doing, but notice I has not inserted for 'too broad' and 'too small' string constants, as I always try to understand how to connect the string constant to this.

    Thanks for any help.


  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • How to concatenate the string with a digital command?

    Hello

    How to concatenate the string with a digital command?

    Thank you.

    I think I forgot to add the semicolon, what you can do is, drag the CONCATENATE function and add semicolon.

  • How to pass a string of e-mail with attachments?

    How to pass a string of e-mail with attachments? I received an email and had answers in both directions. I try now to send the original of the attachments on the first 2 emails. How do I do that? My receiptiant says that he gets the e-mail message but has no attachments?

    You don't mention what you use for e-mail.
     
    You can either transfer the messages all attachments, or save attachments and then attach them to a new message.
  • How to place the inactive icons in a file or hide them

    How to place the inactive icons in a file or hide them?

    Hello Barbara,.

    You can create a folder on your desktop and cut and paste icons in the folder.

    Thank you

    Thomas

  • How to create the string of JSON using QVariantMap array?

    Hi all

    How to create sub string of Json using QVariantMap array?

    {
        "Test1": [
            {
                "dataTest1": "0000",
                "dataTest2": 1412,
                "dataTest3": "",
                "dataTest4": "0000",
            }
        ],
        "Test2": {
            "data1": 1412008,
            "data2": "0000",
            "data3": "A",
            "data4": "0000",
        }
    }
    

    Waiting for your answer please reply me as soon as possible.

    JSON array is QVariantList

    JSON object is QVariantMap

    then create a QVariantLsit and insert your QVariantMaps

  • How to divide the string in bb-cascades

    1. I have a table of data as json

      {"RegistrationResult":"Registered Success:Empid:157:TableName:COMPANY156"}
      
    2. Now, how I want to split the show list view in qml and string as the follwing

      Success stories

      EmpID = 157

      TableName = COMPANY156

    3. Please tell the concept of cutting a string and show the result in qml

    I can get the result of the follwing method:

    {"RegistrationResult":["Registered Success","Empid":"157","TableName":"COMPANY156"]}
     
    

    But I do not know how to split the string for a first... Help, please...

    svmrajesh wrote:

    1. ,......"Registered Success:Empid:157:TableName:COMPANY156"}

    Take a look at QString docu

    Just do something like

    myString.split(':')

    and you get a QStringList and this QStringList is directly mapped to a table in QML JavaScript

  • How to store a string of application properties

    Hi all!

    I just want to know how to store a string of properties of the application, so that I can access this channel of my app (just as we do in j2ME)

    Thank you that solves my query

  • How to place data files in two places during duplication of database or refresh via RMAN test

    Hi all

    can you please find the solution and help me on this point

    How to place data files in two places during duplication of database or refresh via RMAN test

    Thank you

    Ran

    Hi all

    Please send me as soon as possible if you have a solution.

    Thank you.

    Ran

  • How to place a sequence of nested on a sequence, like a nested sequence

    I've recently migrated to first CC. Whenever I put a sequence of nested on a sequence, instead of export this file without welding, it places all the files contained in this sequence instead of the nested sequence. How to place the sequence embedded in the form of sequences of nested instead of simple files on another sequence?

    Simply click the icon of the sequence.

Maybe you are looking for

  • How to exchange a mp3 file with another without losing metadata?

    I like to follow my iTunes library usage statistics, and I have a file of the song I want to replace it with a newer version. (The latest version is a more long/extended cut of the file that I currently have). I don't want to lose the metadata of the

  • Problem restoring stuck MacBook Pro system and time machine

    This morning my retina MBP (El Cap 10.11.4, updated about a week ago) has frozen. It was working fine yesterday, but wake from sleep this morning nothing would go, apps wouldn't start, nothing, so I rebooted. He got about a third of the way between t

  • email for info request

    I received an email saying that my account would be suspended, but a weird email?  j***m***[@]iCloud.com is it legitimate? Susan < email published by host >

  • How to configure playback SIT

    Hi all I use a host VI SIT on my desk and the model on a target RT. The way I set it up right now is that I'm able to type in some input on the host VI values, and happening in the model (that I put in place in the SIT Connection Manager). Now I want

  • Failed to update to Microsoft Office Word 2007 (KB982135)

    Having had a number of recent updates fail to install automatically, I have installed them individually manually except one. During the execution of the download "Update of security for Microsoft Office Word 2007 (KB982135)", he reached a point in th