A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: executing script in a child swf

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    5

    executing script in a child swf

    Is there any way to execute some actionscript in a child swf from the parent without actually having the script in the child swf,or having to add a callback.I'm new to flash so i don't know what can be done,or if it's easy to do.to be more specific,i need search a array.
    ANY help would be thanked......

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    What do you mean execute script in a child swf without having script in the child swf? That doesn't make any sense.

    Where is the array you need to search? Where do you need to trigger the search from, and where do you need to use the result?

  3. #3
    Registered User
    Join Date
    Feb 2012
    Posts
    5
    You must know that it's possible to call some functions in a child swf from the parent,and what i'm trying to say is,what if you want to execute a function but don't have it already in the child swf?Can you maybe inject it in?Or is there some method i have overlooked?,i want to trace the results,and instead of displaying it in the output panel,i want to show it in a text box.

  4. #4
    Junior Member
    Join Date
    Feb 2012
    Location
    Philadelphia, PA
    Posts
    4
    You are asking if you can inject a method into a child SWF that does not already exists? Sounds like kind of a security risk.

    As far as I know, you can only call methods of child SWF that have been created in the child (i.e., already exists). If you know the variable name of the array you need to search, maybe you can access it if it is public.

  5. #5
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    If your child swf is a MovieClip, you could use the undocumented addFrameScript method to inject timeline code. This will overwrite any code that's already on that frame.

    Otherwise, you might be able to do something with a plain Function (not a method bound to a class or instance) and the call or apply method of that function, passing the child swf as the thisArg.

    But the fact that you think you need to do this is a big red "bad design" flag to me.

  6. #6
    Registered User
    Join Date
    Feb 2012
    Posts
    5
    You guys have helped me a lot,I have seen it done in as2 but never in as3.it was a flash file designed to debug the child by the listvariables method and compiled into a exe by swfkit,you could add some script in the soft too, so I don't know if the scrpt was from the swf or the exe(i did not make it)in the end it just traced it.so you could do the same with debug,but anyway I know now sth I did not.where did you hear of addframescript?I have never until now.how do you use it?,explian some more

  7. #7
    Registered User
    Join Date
    Feb 2012
    Posts
    5
    IT works!!!!!!!!!!!!!!!!!!
    THANK YOU!
    accept my thanks.~o(≧v≦)o~

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center