Pass the url of the AS3 fla class

I have a class that works with an external swf with play, pause, and slider. Now that I have everything working, I would like to be able to pass the URL of the SWF file that is external to the main fla As class. I managed to use a 'set' inside the class to retrieve the name, but it is not apparently trigger until after the external SWF is loaded. The following code snippets:

CntlClass:

public var loader: Loader;
private var _urlName:String;

public void CntlClass()
{
loader = new Loader();
loader.contentLoaderInfo.addEventListener (Event.COMPLETE, movieLoaded);
Loader.Load (new URLRequest (_urlName));

.

.

.

public function set urlName(value:String):void
{
_urlName = value;
}

Main FLA file - other than a controller (cntl_mc) that contains a "play" button, a pause button and a slider, the only thing in the FLA file is this code in the first frame:

cntl_mc.urlName = "extswf.swf";

You must remove the load() your Builder.  Otherwise, you must call your setter before your Builder runs - a guaranteed error.

so, have your setter call a function that executes your load() method

Tags: Adobe Animate

Similar Questions

  • Is there a bug in the as3 tween class

    Is there a bug in the as3 tween class that causes interpolations is stopped before completing. I read that there is and that a 3rd party tween class should be used. I'm starting to learn as3 and experimentation, but it would be good to know when I move on more complex projects.

    The solution for this would also make your overall function. It simply means place your feature in the top level of your film.

    I did some research on this topic, but I found a lot of conflicting answers.

    Any help is welcome thanks in advance.

    interpolations should NOT be local to a function.  otherwise, they are likely to be gc would be before they finish.

  • To access the objects placed directly in the fla of the as3 class file?

    Hello

    I'm pretty new to flash and I do this game were traveling along a track and along this trail, there are a lot of boxes, I want my character to pick up.

    Now my question is, is it possible to use a symbol in the library and just place it on the track directly in the fla. folder and then power it hitTest with the character, I added in the as3 file?

    I hope I did, it's understandable.

    Thanks in advance!

    Sincerely of Smith

    Is your code in a separate class? If so, simply extend a display object (for example public class Foo extends Sprite). Then, you have access to the scene, as well as objects in the timeline panel.

    The code for hittest is quite simple. Continually check the hitTest, a test against an another movieclip movieclip method to see if it returns true. How do optimize you how many tests is performed are up to you. Management if the person is on the path you will help understand what are the objects to test against.

  • How to pass the object as a parameter in AS3?

    I get the impression that the non-static objects passing is not allowed in AS3. I never had a problem with that in AS2. Am I correct in this understanding?

    If Yes, do you know what is considered a best practice regarding pass non-static objects as parameters? Is not a good practice? Thank you!

    Ooops nevermind, I got the argument name of past typed exactly as the name of the class, that was the problem.

    function(passed:passed) = boo boo

  • How to open a session in an application apex of a link to the html page, passing the username and password in the url

    Hello

    I have a html page (can be created by jsp/other technology) where I need to provide a link to an apex application passing the user name and password, so that the user does not have to connect. I tried below, but it shows the login page.

    <! DOCTYPE html >

    < html >

    < body >

    " < p > < a href =" https://Apex.Oracle.com/pls/Apex/f?p=75478:101:0:login:P101_USERNAME, P101_PASSWORD:[email protected], gmail@123 [email protected] , gmail@123 "> my Application < /a > < /p > "

    < / body >

    < / html >

    no idea how to do it?

    Apex 5 / chrome browser / window 7

    Concerning

    Sanjaya

    Hi Sanjaya,

    from a security point of view I would strongly recommend NOT to include a clear text password in an HTML page or pass it through a url!

    But back to your question why it does not work. It does exactly what you say APEX. Go to page 101. If you want to simulate a page you submit must use BRANCH_TO_PAGE_ACCEPT which tells APEX to go to this page, but performs the 'Treatment of the Page' page instead of make. See http://docs.oracle.com/cd/E59726_01/doc.50/e39147/concept_sub.htm#CHDICEDJ

    Here is the correct URL, you must use.

    https://Apex.Oracle.com/pls/Apex/f?p=75478:101:0:BRANCH_TO_PAGE_ACCEPT:P101_USERNAME, P101_PASSWORD:[email protected], gmail@123

    Concerning

    Patrick

  • Pass the product ID through the URL of the payment page for the 'reception - buy' landing page. is this possible?

    Pass the product ID through the URL of the payment page for the 'reception - buy' landing page. is this possible?

    You can just the module module_shoppingcartsummary and liquid, you can return the items in the basket to.

    The developer reference

  • Pass the value modal page using static URLS

    Hi guys,.

    I have a simple page with three boxes.

    When one of the check boxes is selected, I want to draw a new page which I use as a modal page (SkillBuilders Modal plug to help).  I need to pass a value of a checkbox (P1_WTD_OPT_OUT) in the new modal page.

    I have the following in the static URL

    f? p = & APP_ID.:2: & APP_SESSION.:2:P2_WTD_ID, P2_WTD_OPT_OUT: & P1_WTD_ID, & P1_WTD_OPT_OUT. :

    where I'm moving the value of P2_WTD_OPT_OUT to P1_WTD_OPT_OUT.

    As I don't submit anything when the check box that calls the modal page is checked, how I would pass the value in the modal page?

    At the moment, if P1_WTD_OPT_OUT is enabled or not, P2_WTD_OPT_OUT is always null when modal page.

    I use apex v4.0

    Any help would be great,

    Thank you

    Here is what goes wrong:

    -page is first rendered, P8_WDT_OPT_OUT is NULL

    -the static url for the modal lov is generated. Given that the item is NULL value in the url for the P9_WDT_OPT_OUT point shall be void in this url

    -l' change event fires. The P8_WDT value is stored in session state

    -the modal opens and navigates to the static url

    End result is that the P9 indeed will be null.

    The solution to this is to not not to set the value of the item through the URL, because it will simply not work. But given that the element of P8 is located in session state, you can use the value of it to the default value of the element on P9.

    On page 8, I changed the dynamic action to not set the value of the element in the URL, and on page 9 I changed the default value of the element.

  • CFSELECT, passing the value selected in the URL?

    Is it possible to use CFSELECT to pass the selected value in the list as a URL variable?

    for example. at present I have surround the CFSELECT in a form and use the onChange event to submit the form

    What I want to do is to pass the selected value in the list as a URL variable, instead of a form element

    Guy, just managed to track down the answer. Could not formulate my question correctly on search engines. When I finally got the correct sentence; There, it reminded me to use GET instead of POST

    Nothing of confidential transmitted, so that's fine.

    All sorted

  • Pass the timeline variable to one of my classes!

    Hello!
    The title says it all.

    I need to pass a boolean variable is set to false for one of my classes called "Edit".

    It is passed to true when one of the functions of this class is managed.

    I tried a few ways different, but had no luck.

    Someone has an idea?

    If you instantiate the class in the timeline panel, you can simply call a method in the class - passing the variable as a parameter.

    easyGame.setTimelineVar (myVar);

    And have another method that allows you to retrieve the value:

    myVar = easyGame.getTimelineVar ();

  • Pass the URL query string variable to Captivate?

    I created a Flash button for my total Captivate, it uses PHP to update a CSV file with the user name and the id of course.

    The user name is from a URL string. If it was just a Flash file, I could pass the page HTML using FlashVar values. My flash button is not exposed until the last slide in the room of Captivate. How can I get this value so that my Flash button can pass it?

    If the value passed to the FlashVar to the Captivate swf, is a local variable that can be called from the Flash button? I know I did not adequately explain this right, but maybe someone can decipher this enough to get the gist.

    Hello

    Just write a javascript in html function that returns the user name.

    Call this function in your flash movie using the external interface call

    Hope this helps

    Delighted Kishore.

  • How to pass a url parameter and recover on the next page for use with LOV?

    Hello

    I am passing the parameter to another page in the url link, however on the second page, which is a form, I don't know how to use it to get the correct value of a LOV to display.

    Thank you
    John

    John,

    You shouldn't do anything really. If the value of the element is defined (see session state) and the value is a valid value from the LOV, then it must be displayed. If you're still having problems, try to put an example on apex.oracle.com and provide the name of user/password work/name space. You can create a new user account for this purpose.

    Kind regards
    Dan

    http://danielmcghan.us
    http://sourceforge.NET/projects/tapigen
    http://sourceforge.NET/projects/plrecur

    You can reward this answer by marking as being useful or correct ;-)

  • Problem by passing the values in the url

    Hai...

    I have created a report region1, because I change the link to change the values, after clicking on the edit link region.2 will appear, im passing in the url of the region.2. My problem is that the values of a ': ' in that... so by passing the values in the url im not getting the onlu 'Region.2' for values that got ':' in it... How can I overcome the issue.

    im passing value contains ':' in this example:-"petroleum products: Europe.

    When I pass this URL im get like this

    http://nypploratest.Platts.McGraw-Hill.com:7777 / pls/dews/f? p = 100:105:1304192021604971:NO:P105_NEWS_CODE,
    P105_NEWS_DESCRIPTION, P105_NEWS_CODE_HIDDEN:PDD % 2COil % 20Products: % 20Europe, 2-1 colon is included in the url


    Please help me...

    Thank you

    David

    Yes, it's possible. Depends on what you are doing. Source value of the element can be a query, so if you have spent the value PK of a line in a table to the page, then the query source of this element could extract the line using this key and use the text value retrieved from another column to fill the text element.

    Scott

  • How to pass the parameters in the http post method?

    Hello

    I want to download the mp3 file on server and I need to pass two parameters with the post method.

    Here is my code for this.

                          String userid="id_user=8379";
                  String filename="trackName=sample.mp3";
                  String params=userid+"&"+filename;            
    
                            httpcon=(HttpConnection)Connector.open("http://api.upload.com/gStorage/uploadSong?output=json",Connector.READ_WRITE);
                httpcon.setRequestMethod(HttpConnection.POST);
                httpcon.setRequestProperty("Content-type","application/x-www-form-urlencoded");
                httpcon.setRequestProperty("Content-type","audio/mpeg3");
                os=httpcon.openOutputStream();
                os.write(params.getBytes("UTF-8"));
                fc=(FileConnection)Connector.open("file:///E:/sample.mp3",Connector.READ_WRITE);
                fileis=fc.openInputStream();
                bos=new ByteArrayOutputStream();
                byte[] data=new byte[50000];
                int ch;
                while ((ch=fileis.read(data,0,data.length))!=-1) {
                    bos.write(data,0,ch);
                }
                os.write(bos.toByteArray());
                os.close();
                System.out.println("Response code From server"+httpcon.getResponseCode());
                if(httpcon.getResponseCode()!=HttpConnection.HTTP_OK)
                {
                    System.out.println("Failed to upload bytes");
                }
                else
                {
                    //is=httpcon.openInputStream();
                    DataInputStream dis=httpcon.openDataInputStream();
                    int ch1;
                    StringBuffer buffer1=new StringBuffer();
                    while ((ch1=dis.read())!=-1) {
                        buffer1.append((char)ch1);
                    }
                    System.out.println("Response From Server"+buffer1.toString());
                }
            } i am getting response code ok but fail to upload file.
    

    may I passing the parameter in the wrong way?

    thankx.

    Hello

    Nitin I currently do a midlet project.

    So I used multipart post method.

    I just read this article. http://MindTouch.firmstep.com/AchieveForms/Design_Guide/Integration_Actions/types/HTTP_POST#top

    package com.http.main;
    
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.Hashtable;
    
    import javax.microedition.io.Connector;
    import javax.microedition.io.HttpConnection;
    
    import com.sun.midp.io.BufferedConnectionAdapter;
    
    public class HttpMultipartRequest
    {
        static final String BOUNDARY = "----------V2ymHFg03ehbqgZCaKO6jy";
    
        byte[] postBytes = null;
        String url = null;
    
        public HttpMultipartRequest(String url, Hashtable params, String fileField, String fileName, String fileType, byte[] fileBytes) throws Exception
        {
            this.url = url;
    
            String boundary = getBoundaryString();
    
            String boundaryMessage = getBoundaryMessage(boundary, params, fileField, fileName, fileType);
    
            String endBoundary = "\r\n--" + boundary + "--\r\n";
    
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
    
            bos.write(boundaryMessage.getBytes());
    
            bos.write(fileBytes);
    
            bos.write(endBoundary.getBytes());
    
            this.postBytes = bos.toByteArray();
    
            bos.close();
        }
    
        String getBoundaryString()
        {
            return BOUNDARY;
        }
    
        String getBoundaryMessage(String boundary, Hashtable params, String fileField, String fileName, String fileType)
        {
            StringBuffer res = new StringBuffer("--").append(boundary).append("\r\n");
    
            Enumeration keys = params.keys();
    
            while(keys.hasMoreElements())
            {
                String key = (String)keys.nextElement();
                String value = (String)params.get(key);
    
                res.append("Content-Disposition: form-data; name=\"").append(key).append("\"\r\n")
                    .append("\r\n").append(value).append("\r\n")
                    .append("--").append(boundary).append("\r\n");
                System.out.println("****In while Loop:-****"+res);
            }
            res.append("Content-Disposition: form-data; name=\"").append(fileField).append("\"; filename=\"").append(fileName).append("\"\r\n")
                .append("Content-Type: ").append(fileType).append("\r\n\r\n");
            return res.toString();
        }
    
        public byte[] send() throws Exception
        {
            HttpConnection hc = null;
    
            InputStream is = null;
    
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
    
            byte[] res = null;
    
            try
            {
                hc = (HttpConnection) Connector.open(url);
    
                hc.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + getBoundaryString());
                hc.setRequestProperty("Content-Length",postBytes+"");
    
                hc.setRequestMethod(HttpConnection.POST);
    
                OutputStream dout = hc.openOutputStream();
    
                dout.write(postBytes);
                dout.close();
    
                int ch;
    
                is = hc.openInputStream();
                StringBuffer buffer=new StringBuffer();
    
                while ((ch = is.read()) != -1)
                {
                    bos.write(ch);
                    buffer.append((char)ch);
                }
                res = bos.toByteArray();
                System.out.println(buffer.toString());
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
            finally
            {
                try
                {
                    if(bos != null)
                        bos.close();
    
                    if(is != null)
                        is.close();
    
                    if(hc != null)
                        hc.close();
                }
                catch(Exception e2)
                {
                    e2.printStackTrace();
                }
            }
            return res;
        }
    }
    

    and use it in this way

    public void getBytes()
        {
            ByteArrayOutputStream bos=null;
            try
            {
                bos=new ByteArrayOutputStream();
                InputStream fis=getClass().getResourceAsStream("/super.mp3");
                int ch;
                byte[] data=new byte[120];
                while((ch=fis.read(data,0,data.length))!=-1)
                {
                    bos.write(data,0,data.length);
                }
                Hashtable params=new Hashtable();
                //params.put("id_user","8474");
                params.put("id_user","8379");
                params.put("file1","audio.mp3");
                HttpMultipartRequest httpreq=new HttpMultipartRequest("http://api.upload.com/gStorage/uploadSong?", params,"file1","xpressMusic.mp3","audio/mpeg",bos.toByteArray());
                httpreq.send();
                bos.close();
                fis.close();
            }
            catch (Exception e) {
                System.out.println("Exception"+e);
            }
    

    Here, the key is contenttype, contentLength.you can get the info on it from the link above.

    thankx.

  • How to pass the session IMAQ to the Subvi

    Hello

    My experience with LabView is neither very good nor extended. I am a scientist and I'm with IMAQ data acquisition. My current problem is that the people who wrote the script is modular, versatile, or clear initially structured. So I try to reduce the ridiculous number of tests in a simple flowchart to a level that people can actually understand it... and to make the more versatile script for future experiments.

    I'm introducing quite a few subVIs to be executed repeatedly. However, I can't know how to pass the IMAQ session on the Subvi. I constantly get the error messages. In this case, I want to acquire images with OIDE_CollectFrame.vi controlled by OIDE_TrialPhaseCollect.vi. I couldn't understand how to assign the refnum IMAQ session class, either.

    It is probably a newbie question, but usually I program with LabView.

    Dennis


  • BrowserField - pass the Connection object

    I want to make raw html in the user interface. I tried with browserfield, but in this case, I need to pass the Connection object.

    In my case I'm not any kind of connection, I have data html file in my project (eclipse).

    How can I create the connection object?

    Hello

    you want to analyze the raw html, which is wriitten in a text file (not URL)? In the affirmative. PM me. I can send the example file u...

Maybe you are looking for

  • Suddenly, yahoo mail won't download in the Inbox, I tried everything to fix. I can send, but not receive.

    I am in China on China Telecom. My POP/SMTP settings are correct and the incoming port is 995, security is disabled. It worked fine for a month and now it has just stopped. It checks for mail in my yahoo Inbox and connects very well and then nothing

  • Satellite A205-S5864 - stop itself and the slow performance

    I'm new to this forum, so help me out anyway you can. I noticed that my Toshiba laptop showing odd behavior lately. She recently began to stop himself suddenly without warning. We arrived at the point where it is a regular occurrence. I don't know wh

  • ICS soak test timing

    Nobody knows, maybe Shaver forums in the impregnation test came out before the release? Calendar should be different for the major OS updates

  • Anyway I can get rid of the need to enter the password in Windows 8.1 pro

    At the start of my system? It's a daily pain because I have to ask my tutor to kick it to me because I am disabled and that you do not have my voice recognition software running until I connected to the system, and of course I can't type so...

  • Problems with video recording

    Hello I have some problems with the video recording on the BlackBerry. On the BB 9700 my application crashes when I try to stop recording. The file producedthe app is empty.On BB 9800 I have the same problem unless I have explicitly defined the video