Set X,Y Position for loaded SWF file

I'm sure this question has been asked before, but I have been
reading the forum and get seem to find the answer. (Yes I looked at
the AS2 dictionary before I posted.) I'm trying to load an external
SWF into my stage. I have entered X,Y, coordinates, but the
external SWF loads at 0,0 I have attached the code I was trying.
Any help would be appreciated. This code is on the button, should
it be on the timeline? Thanks!

Glad you took that in the good spirit it was offered. After I
posted it I was worried that I sounded too mean. Your new code is a
big improvment IMHO! I've made a few changes and attached that and
I'll go through them with ya.
The first cool thing you did and you might not even be aware
of all of it is that you were using the return type of
createEmptyMovieClip. Whenever you checkout something in the help
files, notice the return type. That tells you that cEMC returns a
reference to the newly created clip. If you capture it and assign
it to a variable you can then use that variable as a
"short cut" of sorts. So even though you named
the new clip roscoe, I'm refering to it as container. Not such a
big deal for this example, but in the future you might attach a
bunch of clips with names/paths like:
myContainer.backgroundArt.button1
myContainer.backgroundArt.button2
etc.
So remember that trick. I've also added a this to the cEMC.
It is a good habit to always prefix methods with an instance of the
class they belong too. For example there might be times when the
scope isn't clear and your clip will not get attached where you
think. Of course using this inside a function is one of those
times! So sometimes I would create a variable called home (outside
of any functions) which refered to my main timeline. Then I could
use home.createEmptyMovieClip() inside pretty much any function or
handler and not worry about where my clip was being created.
Next, setProperty is also the old style. I find it much
easier just to set the property with the assignment operator (that
would be the equal sign) and the dot. So:
setProperty("someObject",someproperty,somevalue)
becomes
someObject.someproperty = somevalue;
I think most people find that easier to read.
I'm not sure, but generally I don't think I would create my
MCL instance inside the onRelease handler. No real reason I could
give for that, except perhaps if you have several buttons and each
one will load a different clip. In that case they could all use the
same loader and you wouldn't need to repeat the code over an over.
Hey! that seems to be a pretty good reason to me.
Finally. The way you handled the onLoadInit will work, but
for some reason it isn't the prefered way. It has never really been
clear to me why, but they prefer to have you create an object, add
your event handlers to the object, and then add the object as a
listener. I've shown you how here.
BTW, if you hadn't figured it out, the onLoadComplete is
pretty useless. Several of the properties, like _width and _height
are not yet available at that event, so you picked the right one
(onLoadInit) if you want to scale the content after it loaded.
Good luck and let me know if you need to figure out something
else.

Similar Messages

  • BitmapData prblm for loading swf file

    hi
    i making the photo gallery, here i am using the bitmap data
    for making some effects between each image when it's start to load.
    but in between the images we are using swf files but after
    applying the effect the swf is not playing..
    can any one suggest what i need to make to clear this issue
    ~~
    SK

    yes the timeline is not working when i start to applied in
    the movieclip. how to overcome this issue. bcoz i need check the
    current frame and totalframe. to check whether the swf has played
    fully or not. after that only it 'll start to laod the images
    but here i can't able to get the current frame and the total
    frame . it means i lost the timeline( swf consists of more than 40
    frames) ..here how to check the 40 frames played or not
    ~~
    Sk

  • Complete code for loading swf file in actionscript 3

    i have a swf
    file which i want to load into a fla file and export as a new swf file. I understand this part but my actionscript 3.0 code that i put on frame one of the timeline does not work. I have tried every version i have seen online including in adobe's actionscript 3 classroom in a book.... and other books..... i want the swf to run immediately so i dont think i need any event listeners since i am not clicking a button or anything like that... just running the swf at start. any help wuld be appreciated... sent two day on this already... i can do it in actionscript 2 but have not figured it our in actionscript 3......... why does eeryone seem to do this slightly different too?   a complete code would be nice since obvously i am stupid........
    thanks

    Show the code you put in frame 1.  I don't think you can do what you say you intend to though.  As far as I know you cannot create a new filein the way you explained you intend to.  If you load the file dynamically as a separate swf, then you will always need to.

  • Loaded SWF file CANNOT be made into button DIRECTLY?

    I'm experiencing a problem which may have no solution, but I
    would like to know why I cannot do what I want to do.
    PROBLEM:
    I am attempting to load in an external SWF file and once it
    is loaded, I wish to directly make the new Sprite/MovieClip into a
    button. However, the newly loaded Sprite/MovieClip seems to be
    resistant to be made into a button DIRECTLY. I would like to know
    why this is.
    WORKAROUNDS:
    Here are a couple of workarounds, but again I wish to know
    why I cannot do what I want to do.
    1) I place the new Sprite/MovieClip into an empty Sprite on
    stage and make the once empty sprite into a button.
    2) Construct the external SWF in such a way so i can refer to
    a MovieClip within the SWF file and make that MovieClip into a
    button.
    CODE EXAMPLE:
    I am loading a SWF file thru a Loader and then taking the
    loaded SWF file and adding it to an existing sprite on the stage. I
    then attempt to make a button out of the newly loaded swf file, but
    it fails to be clickable.
    The following is some quick code to illustrate my problem. I
    already have workarounds in place, so please let me know WHY the
    following code is impossible. thanks!
    ==============================================================================

    There should be no problem with what you are trying to do. If
    you want someone to look at what you've done, you have to be
    careful to show that and not possibly errant code because that is
    the substance of your post and what you requested be looked at--we
    cannot guess what you may have done wrong in setting things up or
    for code that you do not show.
    I tried your code before posting my response and it worked
    fine except for your error with the COMPLETE aspect. I did not
    utilize any objects for loading things into, so I suggest you look
    there.

  • Ipad i have load swf file but swf  is not working proper(flex 4.6) but android is fine to work how

    ipad i have load swf file but swf  is not working proper(flex 4.6) but android is fine to work how

    On the MBP, in iTunes, switch to Song view and enable the iCloud Status column by pulling down View > View options and selecting the option for "iCloud Status." Close the small window. Look for any tracks that have a status of "waiting." If you see several of them disable iTunes Match while holding down the Option key. Quit iTunes, wait a few seconds, then open it again and turn iTM back on. Let it compelete the scan. Wait until all tracks that are "waiting" have a status of either "matched" or "uploaded."
    On the iPad, turn off iTunes Match then launch the Music app and let the contents clear out. Power cycle the iPad for good measure, then re-enable the service once all the tracks in iTunes have been processed.

  • Loading swf files from an iPhone Air App

    Although the faq says its possible ( http://bit.ly/gyxmCo  )  I can't seem to load .swf files from my app.
    There's no .AS code in the .swf file I'm trying to load.
    PNG files load with no problems, swf's fail.
    A working example would be appreciated instead of suggestions, I've spent the entire day trying out suggestions
    regards,
    Martijn

    Because I can't see any library assets in an as2.0 file.
    I've discovered that the swf fails to load as soon as you make a symbol 'export for actionscript'
    probably because it will then create a class. So you can only load SWF's as simple pictures or animations, you cant use it as an asset library with multiple animations/images/sounds in it..
    As for you other questions:
    it doesnt matter if the file is local or on the web. same results
    I created the swf file from a fla in CS4,  and I'm compiling my air project that loads the swf  with FlashDevelop.

  • Loaded swf file alignment

    when i i design something in a file i have it aligned how i
    want it, however when i load the page into another, although the
    loader component is aligned, the content inside the loaded swf file
    is no longer where it should be. why is that? how can i fix this?
    i've just been

    Also, remember that if you load an external SWF into another
    movieClip, then the _root changes. The loaded SWF will no longer be
    considered _root, unless you specify in frame 1:
    this._lockroot = true;
    this would be the issue of your miss-alignment, if you are
    using ActionScript to align objects dynamically.
    If you are not using actionscript for alignment, then
    Mocaloca's suggestion should be the answer.

  • How load swf file (flash 8) with adobe captivate 3 without enter the HTML?

    How load swf file (flash 8) with adobe captivate 3 without enter the HTML?

    Hi SaSQuaCh69247,
    Issue 1 :- Select the SWF file in library, right click, and
    select update.
    Issue 2 :- Actually it could be valid for Issue 1 also. It
    seems like SWF file you are trying to import, does some action
    like, importing another swf or connecting to server on the first
    frame itself. Captivate will try to play the first frame of SWF
    when you import them. Try creating a keyframe with the stop action
    as the first frame in your SWF, and see if you still have the
    issue.
    Issue 3 :- The approach I am mentioning over here is
    generally the last approach which I will take in such scenerios,
    but since you have already experimented a little, so try this.
    Go to C:\Documents and Settings\<user name>\Application
    Data\Adobe\Adobe Captivate
    Rename captivate_v20.dat as captivate_v20_org.dat.
    Restart Captivate Application.
    thanks

  • How to manage ApplicationDomain for loaded SWFs across different domains?

    I've been getting this following error -- when I'm loading a subsidiary SWF into a main one. The sub swf contains the overlays. OverlayOne is a subclass of Overlay.
    TypeError: Error #1034: Type Coercion failed: cannot convert OverlayOne@18684f89 to Overlay.
         at HSRawVideoPlayer/setCurrentOverLay()
         at HSRawVideoPlayer/showOverlay()
         at HSRawVideoPlayer/dotRoll()
    I googled and found that I should probably be setting the applicationDomain of the loader context of the loaded swf to be that of the loading SWF (as per Senocular's article on the subject) -- although I thought that in cases of conflict this would resolve to the loading SWFs ApplicationDomain, so not necessary.
    But I've also read that this won't work across different domains, and that's the situation here -- the client wants the urls of loading and loaded swf's to be fully qualified . Will setting the ApplicationDomain of the loaded SWF to be that of the parent solve the problem above, even if they are in different domains? Can someone show me a short code snippet? Thanks!

    Hi,
    DSS has inbuilt functionalities to compare the transactions against the in built rules.If the transactions take place not in accordance with the in-built rules,it is treated as a "violation" and is reporetd.
    Virsa is an example of DSS tool.Here you can build rules for access and process ;constantly compare the actuals Vs the rules;report the violations.
    In SAP R3 for example,the T/code:pfcg is tailored for access control,while the invoice parking [f-63] is tailored for process control.Using VIRSA,you can address to risks involved both,namely,access and process control.This is an example of how DSS can help in Risk integration.
    In these tools,we have an Engine for building the rules-based on this we build the rules.These rules are stored in a table.when a transaction-for which we have built a rule - takes place,the system compares the rules VS actuals.The inconsistencies if any are reported as violations.
    Hope this helps.
    Regards,
    Ramesh

  • How can I make my external loaded .SWF file smoothly disappear after 15 seconds?

    Hi,
    How can I make my external loaded .SWF file smoothly disappear after 15 seconds? The following is the code to load an external .SWF file:
    var K:Loader=new Loader();
    addChild(K);
    K.load(new URLRequest("clock.swf"));
    K.x = 165;
    K.y = 247;
    K.contentLoaderInfo.addEventListener(Event.INIT, growLoader);
    function growLoader(evt:Event):void {
         K.width = 130;
         K.height = 130;
    I want to make clock.swf file disappear from the page after 15 seconds using some smooth disappear effect.
    Please help.
    Thanks.

    Something even better:
    http://www.greensock.com/
    Check out TimelineMax I LOVE it...
    The guy that made this (and gives it away for free!) is a saint.

  • How to detect the end of a loaded swf file

    Hello Guys
    This is my first time on this forum, come here with a great
    hope
    I have loaded a picture file (jpeg) and a video file (swf)
    into the main flash file using xml
    on frame 3, I load the picture and on frame 7, I load the
    video, there is a stop action on frame 6
    Now when the flash is executed the picture is displayed ( it
    says "Click here to view the video")
    when the user click the picture , the video is loaded and
    starts to play ---- so far everything is working fine
    now what I want to do is, once the video finishes playing (
    not stoped) I want to display the picture again
    can you tell me how to detect the end of an external loaded
    swf files,
    Please help me
    Thanking You
    Shriram

  • How to create an xml to load swf files in sequence?

    hello everyone
    I'm new in web design... I know how to animate in flash, using timeline, frames, layers, twins and so on... But I want to move forward so I want to create a xml to load swf files in sequence and in loop. Each swf file has 8 seconds.You can see the example here in www.cm-seixal.pt.
    I'm not a programmer but I understand how actionscript works... I hope you can help me
    Cheers!
    Ana

    you can use the urlloader class to load your xml file.  use the loader's complete event and the loader's data property to retrieve the data in your xml file.

  • Loading swf files for anonymous user login

    Hi,
    We are having swf file retrieving from oracle database in home page. I can able to view swf file for normal users, but anonymous user login, not able to see swf file in the page. Other image format like jpg/gif files anonymous user login images are loading properly. Pls. kindly advise, where issue occurs.
    kumar. G

    Hi Ram
    Thanks for your response. Let me know, how to connect to oracle database for anonymous user login. Based on that i will work around that approach for fixing this issue.
    By
    kumar. g

  • SQL Loader: specify position for pipe separated file

    Hi,
    I have a problem with sql loader. i need to load 5 columns in a table and my file only contains 3 fields (pipe separated file) i need to add a sequenced id and a loading date. When i try to run the below, the sequence and the sysdate is populated correctly, but column3 is inserted into column1. If i add my file two more null columns, then it works properly:
    ||column1|column2|column3
    also if i put my variables in the end it also works, but i cannot restructure the table so this solution doesnt work. Do u have any idea how to specify positions in pipe separated files? i should load file in the below format:
    column1|column2|column3
    it onlz works properly if i add the two pipe in the beginning
    my control file:
    LOAD DATA
    INFILE 'test201001.csv'
    APPEND
    INTO TABLE test_load
    FIELDS TERMINATED BY '|'
    id "seq.nextval",
    sys_creation_date "sysdate",
    column_1,
    column_2,
    column_3
    Thanx your help in advance
    Edited by: user9013593 on 2010.01.19. 6:18
    Edited by: user9013593 on 2010.01.19. 6:19

    user9013593 wrote:
    Hi,
    I have a problem with sql loader. i need to load 5 columns in a table and my file only contains 3 fields (pipe separated file) i need to add a sequenced id and a loading date. When i try to run the below, the sequence and the sysdate is populated correctly, but column3 is inserted into column1. If i add my file two more null columns, then it works properly:I hope someone provides a better solution below, but since no one has yet ...
    Can you load the data "as is" into a work table, then use a PL/SQL program to process the work table correctly according to the data you have?

  • Loading swf file

    I'm having trouble with loading a swf file in my flash. I am buidling a flash website where I have a lot different sections.
    Main file: index.swf where i have main buttons and an UILoader.
    now i want to load my homepage in the UILoader so I set the UILoader source to homepage/index.swf
    The homepage loads no errors but as soon as I add some actionscript anything (declare one variable) i get this error
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at index_fla::MainTimeline/index_fla::__setProp_loaderr_Scene1_loader_1()
    at index_fla::MainTimeline$iinit()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at index_fla::MainTimeline/index_fla::frame1()
    Anybody can help? I search everywhere. I and only ever write on forums when Im hopeless

    The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
    - is not in the display list
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with different names assigned.
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

Maybe you are looking for

  • What settings are required for DP_PROC_TY,CT_PROC_TY,TEND_TYPE

    hai friends what settings are required for DP_PROC_TY,CT_PROC_TY,TEND_TYPE Thanks a lot Regards VinayKrishna

  • Rounding decimals

    Dear all, Is there any way to restrict the Signed data decimal to 2 places? We have decimal formatted in the BPC Excel front end. But this doesnt stop data from Input schedule restricted to 2 decimal places in fact table. Some users wrongly enter dat

  • Weird Lines showing in PDF at certain Zooms

    I created this layout in InDesign. When I print to PDF, I can see the outlines of an object's container (the pink line on the left) over another object (the brown silhouette on left). Sometimes I can see both lines when I zoom in to 150% in Adobe Acr

  • IMessage problem - Cannot get it to work

    iMessage problem - I cannot get iMessage to sync. I have a iPhone 4 and iPad 2 both on iOS 5. everything else works fine. I cannot get the iMessage to sync. Both have the same @me id. if I try to add another email I get "iMessage Activation Unable to

  • What can I do if a digital download crashes?

    So I just got the Hunger Games and decided to digital download code for my ipod touch. But I plugged my ipod into my computer and it stopped downloading. Now every time I tap the download error to retry it come up for one second then said again "Down