Load a swf in flex movie and access to its classes

I am a newbie to flash/flex. Think this is the right forum, the Flash Builder forum seems to be for installation only.

I create a movie in Flash Builder (a map) that has two events. Now, I have loaded into a SWFLoader in flex 4.5 project, he plays and acts fine. I imported a CFC from the same film in the flex project so I could access events. They appear but I can not throw the contents of the MapView class film loader, I need to do to make the method addEventListener for cards of two events. I tried to add that the event listener for both the charger and directly to the content and to root. How can I join the event listener class generator flash in flex?

Thank you

Bubba

Found after 8 1/2 hours of research

public void mapLoaded (e: Event): void

{

If (! mapBar.content.hasEventListener (MapHotSpotEvent.HOTSPOT_EXPANDED))

{

mapBar.content.addEventListener (MapHotSpotEvent.HOTSPOT_EXPANDED, mapExpanded);

mapBar.content.addEventListener (MapHotSpotEvent.HOTSPOT_CLICKED, mapExpanded);

var flx:Object = e.target.getChildAt (0);

var bar: * = flx.getChildAt (0);

bar.content.addEventListener (MapHotSpotEvent.HOTSPOT_EXPANDED, mapExpanded);

bar.content.addEventListener (MapHotSpotEvent.HOTSPOT_CLICKED, mapExpanded);

}

}

Tags: Flex

Similar Questions

  • load a SWF into another domain and access its functions and variables

    I need to load a swf file into another domain and call its functions and access to its variables, in the same field, I can load and access its functions successfully, but in different areas not.

    control the class security.  Depending on the browser version that you're targeting you might be able to get out of the allowDomain() method, but you'll probably want to use a cross-domain security file.

  • FLex: Creation and access to session variables

    Hi all

    Good morning people.
    Am new on SDS and using Flex 2.0

    I have hotel_list in the collection. and have a mapped datagrid which has a "Book now" button on each row (hotel).
    Then click on the 'book now' button, I want to spend the more information in the same row to the next page.
    Can I create the session variable and access session variables in the next page side server.
    How do I do... ?


    Pls any one advice me on creating session variables and access even in another page?
    Can one after the code example?


    My code is as follows...

    < mx:Script >

    <! [CDATA]

    import flash.net.navigateToURL;
    public void OnBook_click(hcode:String):void {}
    ("var request: URLRequest = new URLRequest("/quick_search/booking.mxml ");
    var uv:URLVariables = new URLVariables();
    UV.hotelcode = hcode;
    Request.Data = UV;
    navigateToURL (request, "_self");
    }
    < / mx:Script >


    < mx:DataGrid id = "dg" width = '100% ', rowHeight = styleName "38" = "GridColumnText."
    "dataProvider ="{hotel_details}"enabled =" {! ds.commitRequired} "creationComplete =" fill_hotelDetails () ".
    verticalScrollPolicy = "{mx.core.ScrollPolicy.OFF}" rowCount = "10" height = "404" > ""
    < mx:columns >
    < mx:DataGridColumn dataField = "hotel_address" headerText = "name of the hotel.
    headerStyleName = "DynamicLabel" width = "300" wordWrap = "true" editable = "false" / >

    < mx:DataGridColumn id = "pr_rate" dataField = "prdt_rate" headerText = "rate."
    headerStyleName = "DynamicLabel" paddingRight = "10" editable = "false" width = "50" / >

    < mx:DataGridColumn dataField = "hotel_status" headerText = "availability".
    headerStyleName = "DynamicLabel" editable = "false" width = "75" / >

    < mx:DataGridColumn headerText = "book now" editable = "false" dataField = "hotel_code."
    headerStyleName = "DynamicLabel" width = "75" sortable = "false" >
    < mx:itemRenderer >
    < mx:Component >
    < mx:HBox width = "25%" horizontalCenter = "0" horizontalAlign = "center".
    styleName = paddingTop "GridColumnText" = "5" >
    < mx:Button id = "book" label = "book now" click = "outerDocument.OnBook_click (data.hotel_code)" / > "
    < / mx:HBox >
    < / mx:Component >
    < / mx:itemRenderer >
    < / mx:DataGridColumn >
    < / mx:columns >
    < / mx:DataGrid >

    Instead of pass... is the values to booking.mxml as request parameters possible to define session variables?
    pls someone help me...


    THX in advance
    Raphael alboury

    Take a look at the shared objects, I think these are the kind of thing you're after. In my view, that the subtopic "By specifying a path" must be particularly pertinent for sharing variables/objects between two swf files.

    LiveDocs - shared objects

  • Securing of Captivate movies and access via the Web

    Hi all

    My apologies if this is a little off topic, but I just thought that someone out there has fallen on this problem and come upwards with a solution. All the tips / pointers thank you gratefully received!

    I would create a bunch of Captivate movies that will be accessible on the web. Different customers/clients need to access different movies. What I would really like to be able to do is post these movies on my site OR a site offering secure accommodation.

    The customer would be given a URL - when you can access the URL, they are going to a login page (and provide a password), and then be presented with a start page / menu where they can access movies that relate to the software they use (customers all use different versions of the software as well as movies are subtly different for each).

    A grave on this type of hosting solution or has any ideas for this scenario?

    Thank you very much
    Craig

    Craig,
    I think you have the wrong end of the stick about htaccess
    I made a small example for you here protected folder
    username and password = larry

    a good host is http://ukwebsolutionsdirect.co.uk/hosting.php
    I use them for all my domains/site and they are cheap

    Paul

  • Flex 2 and Access database

    I want to know if flex is able to access an access database through coldfusion or flash remoting?

    You can access the data without flash remoting. Use and application like CF, php or ASP even middleware and format the data in XML format. Then connect to the data via an HTTPRequest or XML object, and then import the data.

    No need to Flash Remoting unless you need to communicate complex objects between Flex and the server.

  • What happened to the flash swf? Flex? and what is the new flash will look like? (HTML5/Javascript)? Flash does not work on droids or Iphones currently until the?

    Hello

    I'm more angry to discover that adobe Flash has changed once with Flex and now it also seems to be unusable. Every news source and, frankly, Adobe should do a much better job informing developers creative clould

    How to better use its products. I imagine that the security issues with adobe flash make unusable today. I just tried a simple slide show in flash and of course, he did not work on my droid which brings me to this status to feel screwed by Adobe!



    What version of flash if everything works on all websites and mobile devices for chrome browsers, fire fox and IE?

    Hi Rob, take your question to Adobe animate CC - homepage. There are many new choices available with the last Fl which is compatible with mobile devices.

  • rented a movie and paid but its not downloading

    I rented a movie today and money has been deducted from my account, but it does not appear in the download or purchase from anywhere

    Hello loreneis,

    Thank you for using communities of Apple Support.

    I see that you are having problems with a movie you rented from the iTunes Store.

    I would recommend to take a look at the following article to ensure you're not missing something, when you rent your movie:

    About rent movies on the iTunes Store

    If you're still having problems, the following article provides information on how to report a problem with a purchase from the iTunes Store:

    Report a problem with an item purchased from the iTunes Store, App Store, Mac App Store, and iBooks Store

    Best regards.

  • Load external swf file

    Hi all

    I am trying to load an external SWF file in my site... but it does not work. Here is my code

    public var CD:Loader = new Loader();

    protected function application1_creationCompleteHandler(event:FlexEvent):void

    {

    CD.load (new URLRequest ("http://localhost/assets/slide.swf"));

    addChild (this. (CD);

    CD.x = 2;

    CD.y = 170;

    / / TODO self-generated stub method

    }

    Can someone tell me what goes wrong...

    The url is correct and his works in my browser when I type " " http://localhost/assets/slide.swf ' in the browser... So the problem is with flex...

    I tried to load this swf into my project and it crashed the browser.  What is written this swf?  AS3 or earlier?  If I'm not mistaken load one previous VERSION other than 3 will cause additional problems and needs to work to spare but I'm not 100% sure.

  • AS2 loading swf that loads additional s AS2 swf into Flex

    My loaded AS2 swf can not seem to load the AS2 swf using loadMovie() and loadMovieNum().

    I have a file .mxml with a tag with an attribute of the source of mx:Image bound to a string variable. I can set this variable to a valid way to AS2 swf and swf file load as expected.

    However, the AS2 swf contains one or more statements loadMovie() to load additional SWFs 'child' in empty movieClips that fails silently.

    (I have to load several legacy/AS2 projects, I try to avoid the migration of these projects to AS3, also try to avoid incrustation of the SWF to the 'child' in a single AS2 swf).

    I tried both loadMovie and loadMovieNum, I change the publication for local file access and network access settings, I tried to replace the mx:Image bound by a mx:SWFLoader tag, tag none of these work. I even tried to switch the compiler Flex setting - use network.

    All the other features seem to work in the loaded AS2 swf.

    I found many posts/articles as intercommunication between an AS3 Flex swf and loading AS2 swf, but it's not my problem. I need not communication, a few features.

    Thanks in advance for any idea!

    OK, once more, during 5 minutes walk away a problem proved to be invaluable. I started to think that maybe there is a known issue with loadMovie(). Even if I was trying to avoid to touch the source code of these sovereign wealth funds AS2, I decided that it would be useful to test replacing loadMovie() by MovieClipLoader.loadClip () statements.

    It works! Even if it means that all the old AS2 files that I need to load will have to be revised, it is much less of a task of migrating to AS3 or incorporation of the swf file of the child in the movie alone. I hope at least that this will save someone else the frustration of trying to do the same thing.

  • Compile a CSS into SWF without SDK merged and loading dynamically

    I have a flex application that is built with the SDK merged in (by my own reasons). This application dynamically loads a SWF style that was built without the SDK merged. Unfortunately, it seems that the loaded SWF file fails to solve its references with the SDK and gives me an error of execution of 1014.

    If I merge the SDK in the CSS SWF then it works. If I put my application and the CSS SWF to use the SDK as a RSL, then it works. In short, the matrix is:

    CSS SWF, SDK merged? Application, SDK merged? Œuvres?
    YesYesYes
    YesNO.Yes
    NO.YesNO.
    NO.NO.Yes

    I don't want a big CSS SWF to load dynamically with all the SDK inside when I already have the SDK loaded with my request. Any help much appreciated.

    I generate a link-state of the main application and allows to exclude

    the CSS SWF classes.  The CSS SWF should be built with

    merged in code, but the link-report and - external load-trainees will expel

    they share classes.

  • can not access google play movies and tv app

    I tried to access google game films and television, but he wouldn't take my password

    Hi Mario Amos.

    1. what operating system is installed?

    2. how you try to access google game movies and tv?

    3. what browser do you use?

    4. don't you make changes to the computer before this problem?

    5. What is the error you get when trying to access google game movies and tv?

    You can read these articles and check if that helps.

    On movies & TV on Google game: https://support.google.com/googleplay/answer/1257647?rd=1#

    I watch movies & TV shows on your computer: https://support.google.com/googleplay/answer/1266222?hl=en&ref_topic=2803020

    Google game: https://support.google.com/?hl=en

    Google product Forum: http://support.google.com/bin/static.py?hl=en&page=portal_groups.cs

    Thank you.

  • How load and access bitmap images?

    Hey there!

    After a few days of frustration and of searching the Web, I finally understand how to make a sheet of sprite and animate it.  I understand the classes and how to import external actionscript files that contain in my Flash project.  The problem is, I can't understand how to name and load a bitmap from the folder and pass on my functions as arguments.  > _ <

    How load and access an external bitmap in Actionscript 3.0?

    I use a class that I found online here: http://www.bensilvis.com/?p=229

    The problem comes when I try to access my bitmap parts, while he tries to do here: http://www.bensilvis.com/?p=317

    var currentSprite : SpriteSheet = new SpriteSheet (sheet, 20, 20) ;


    It is the only line that confuses me because it uses a variable "sheet", which is a bitmap, and I don't know how to set a name / my external bitmap image as such.

    SpriteSheet(tileSheetBitmap:Bitmap, width:Number = 16, height:Number = 16)
    • tileSheetBitmap: the bitmap of the sprite sheet that we will use
    • width: the width of the tiles in the map
    • height: the height of the tiles in the map

    Thank you!  < 3

    you use the loader class to load a bitmap.  When the loading is complete you can cast content loader as a bitmap for the help of the compiler with more coding.

  • How to load external swf file and unload the swf file parent?

    I have a question. Let's say I have file1.swf, file2.swf and file3.swf, how can I link this 3 files together.

    Let's assume that file1.swf is the main content file, but as I load file2.swf, I want the file1.swf get replaced by file2.swf. How could unload file1.swf at that time, so that my file2.swf will become the main content file?

    and even once, when my current post file2.swf and I want it get replaced by file3.swf tinkle of a button. so that i can unload the file2.swf and let them file3.swf become the main content file...
    Anyone have ideas on this?
    Thank you..

    If you're publishing to fp 10 + use:

    var loader: Loader = new Loader();

    var urlR:URLRequest = new URLRequest();

    addChild (loader);

    Btn1.addEventListener (MouseEvent.Click, f);

    btn2.addEventListener (MouseEvent.Click, f);

    function f(e:Event):void {}

    {if (Loader.Content)}

    loader.unloadAndStop ();

    }

    {if(e.currentTarget==btn1)}

    urlR.url = "file2.swf";

    } else {}

    urlR.url = "file3.swf";

    }

    Loader.Load (urlR);

    }

    p.s. Please check the useful/correct, if there is.

  • Loading movies and Animation

    I'm working on a project for school.  I have a layout so that if someone presses a button, it will load a SWF for the user to view.   The button works and loads the swf file, it works.  But rather than be an animation, it only shows the first frame of the animation and is static.

    Should what code I use to make this game after loading?  Or is there something else I need to do?

    Just for the record, I'm a convert to a button symbol button in the library.  After placing the button on the page, I clicked on the button and open the Actions palette in order to code the swf file loading.  I have an empty symbol as a placeholder that I named loader_mc so that I had something to reference when coding.  I just need to get this moving animation!

    Any thoughts?

    unless there is a stop() in the first image that sovereign wealth funds, it will be read by default.  If there is a stop(), you must apply a play() to the content loader property as a movieclip AFTER loading is finished:

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, f);

    function f(e:Event):void {}

    MovieClip (loader.content) .play ();

    }

  • Load a CSV file and access to variables

    Hi guys,.

    I am new to AS3 and treated with AS2 before (just to get the scope when change it).

    Is it possible in AS3 to load an excel .csv file into Flash using the URLLoader (or?) and the data in the form of variables?

    I can get the .csv to load and trace values (cell1, cell2, cell3...) but I do not know how to collect the data and place it into variables.

    Can I create a table and access like so... MonTableau [0], myArray [1]? If so, I don't know why it does not work.

    I have to be on the road quite wrong. Here's what I have so far...

    var loader: URLLoader = new URLLoader();
    loader.dataFormat = pouvez;
    loader.addEventListener (Event.COMPLETE, dataLoaded);

    var request: URLRequest = new URLRequest ("population.csv");
    Loader.Load (request);
    //...
    function dataLoaded(evt:Event):void {}
    var myData:Array = new Array (loader.data);
    trace (mydata [i]);

    }

    Thanks for any help,

    Sky

    Simply load your csv file and use the string flash methods to allocate these values in a table:

    var myDate:Array = loader.data.split(",");

Maybe you are looking for