How to access properties of symbols in loaded SWF?

I'm making the migration from Flash to Flex, but I'm running
into a dead end on one particular area: accessing and manipulating
properties of symbols in a loaded SWF.
The SWF is actually a simple library of a detailed parts
illustration. I would like to load the entire SWF in position, and
be able to change the attributes (i.e. colors) of individual
symbols (or parts of the illustration). I can load, display and
manipulate each symbol separately, but I need the parts to remain
in place.
The original art was created in Illustrator and exported as
SWF using the symbols palette.
I can always go back to Flash, but I'm forcing myself to move
forward and do this project in Flex (baptism by fire!!).
Is there some sort of dot notation to access the symbols from
within the SWF, without loading them all separately?
Let me put this another way: it appears that I can load an
SWF and then instantiate each symbol in that SWF, and then load
each symbol to the 'stage' (or whatever it's called in Flex)
separately.
I can certainly instantiate each symbol separately, and then
align it on stage, but it seems to me to be bass-ackward to do it
that way, expecially since I created the original SWF with
everything in position.
Is there no way to access the attributes of the individual
symbols within an SWF without separately instantiating them?
I'm just having trouble getting my head around this. Any help
is greatly appreciated.

Okay, I took a look at this info and it's what I was already
doing.
Here's a simplified example of what I'm trying to do, using
the example in the swf9.pdf file.
Let's assume I've created a SWF with a "BlueSquare" movieclip
(in the symbols panel in Flash, exported for AS). In that clip,
there is another symbol called "Star". I import the SWF and
BlueSquare symbols in with the following code:
<mx:Script>
<![CDATA[
[Embed(source=”../assets/circlesquare.swf”)]
[Bindable]
public var LogoCls:Class;
[Embed(source=”../assets/circlesquare.swf”,
symbol=”BlueSquare”)]
[Bindable]
public var LogoClsBlueSquare:Class;
</mx:Script>
If I instantiate the BlueSquare on stage, it includes the
Star symbol when previewed, but I can't figure out how to get at
the Star symbol to change color. If I apply a color change to the
symbol, it changes the entire BlueSquare symbol.
If I instantiate the Star symbol separately, I can then
position it on the stage and make changes, but that requires
positioning it with actionscript. I'm trying to not have to
position a sub-element of my actual artwork because of it's
complexity.
I'd like to display the main movieclip (or sprite) with the
ability to access the attributes of a sub-movieclip or
sprite.

Similar Messages

  • How to access the text symbols of a class

    Hi Experts,
    Can anyone pl. tell me how to access the text symbols of a class.
    Thanks,
    Uday.

    Hi,
    Please check
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm

  • How to access properties of running workflow 2013 instances?

    Hi there,
    I am trying to figure out how I can access properties of a running workflow instance. I have created the following PowerShell:
    Add-PSSnapin microsoft.sharepoint.powershell
    $web = Get-SPWeb http://app-72b5c37f94da1d.apps.sharepoint2013.local/sites/appdev/SharePointWorkflowApp
    $wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
    $list= ($web.lists|where Title -eq "List1")
    $sub = $wfm.GetWorkflowSubscriptionService()
    $subscriptions = $sub.EnumerateSubscriptionsByList($list.ID)
    $inst = $wfm.GetWorkflowInstanceService()
    $instances= $inst.Enumerate($subscriptions[0])
    $instance= $instances[0]
    $instance.Status
    $instance.UserStatus
    $instance.Properties
    I am not able to retrieve the arguments or variables via this route. Only UserStatus is a valid working option at this point.
    The variables and arguments of the sequence which I have configured via Visual Studio 2013's Workflow Designer, resulted in the following xaml:
      <x:Members>
        <x:Property Name="EenArg" Type="InArgument(x:String)" />
        <x:Property Name="argument1" Type="x:String" />
        <x:Property Name="argument2" Type="InOutArgument(x:String)" />
        <x:Property Name="strArg" Type="InOutArgument(x:String)" />
        <x:Property Name="intArg" Type="InOutArgument(x:String)" />
        <x:Property Name="dateTimeArg" Type="InOutArgument(x:String)" />
      </x:Members>
    None of which are propagated via de Properties collection. 
    What am I missing here?

    Hi,
    To access the properties of a workflow instance, here is a blog with code demos for your reference:
    http://ranaictiu-technicalblog.blogspot.com/2013/05/sharepoint-2013-workflow.html
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • Accessing a class from a loaded SWF

    In Flash Professional, I drew a shape, converted it to symbol, linked it to class Symbol1 (extends MovieClip) which is generated at run-time, and saved the SWF file as shape.swf.
    Now my main application wants to load shape.swf and create multiple instances of Symbol1 but I get ReferenceError when trying to access the class Symbol1.
    Below is my main application's code. Errors thrown are mentioned in comments.
    public class MovieClipTest extends Sprite
        public function MovieClipTest()
            var url:String = 'shapes.swf';
            var l:Loader = new Loader();
            l.contentLoaderInfo.addEventListener(Event.COMPLETE, f);
            l.load(new URLRequest(url), new LoaderContext(false, ApplicationDomain.currentDomain));
        private function f(event:Event):void
            var content:Sprite = (event.currentTarget as LoaderInfo).content as Sprite;
            trace(getQualifiedClassName(content.getChildAt(0))); // output: Symbol1
            trace(ApplicationDomain.currentDomain.getDefinition('Symbol1')); // throws Error #1065: Variable Symbol1 is not defined.
            trace(getDefinitionByName('Symbol1')); // throws Error #1065: Variable Symbol1 is not defined.

    Your "Symbol" is obviously not in the current ApplicationDomain, but in the loaded SWF's domain:
    var symbolClass:Class = event.target.applicationDomain.getDefinition("Symbol") as Class;
    var symbolInstance:MovieClip = new symbolClass() as MovieClip;
    Also because you're loading a SWF, the content of the Loader is a MovieClip, not a Sprite.
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • 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

  • Can't Access MovieClips and Functions in Loaded SWF

    Hi everybody,
    I'm trying to simply access anything inside this loaded SWF and all I get is 'null'.
    I have code in the parent SWF that needs to tell the child SWF movieclip what to do but nothing works. This was a piee of cake in AS2 and I can't seem to get anything to crossover in AS3.
    Here's my code:
    import com.greensock.TweenMax;
    import flash.display.MovieClip;
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("SWCS_S3_500x250_exp_panel_2.swf"); // in this case both SWFs are in the same folder
    myLoader.load(url);  // load the SWF file
    panel2.addChild(myLoader);   // add that instance to the display list, adding it to the Stage at 0,0
    panel2 = myLoader.content as MovieClip;
    photo_about.alpha = 0;
    photo_downloads.alpha = 0;
    //panel2.content_about.alpha = 0;
    //panel2.content_downloads.alpha = 0;
    function closeSection():void
              panel2.controlsMC.forcePause();
              TweenMax.to(photo_about, .5, {alpha:0});
              TweenMax.to(photo_downloads, .5, {alpha:0});
              TweenMax.to(photo_home, .5, {alpha:0});
              TweenMax.to(panel2.content_about, .5, {alpha:0});
              TweenMax.to(panel2.content_downloads, .5, {alpha:0});
              TweenMax.to(panel2.controlsMC, .5, {autoAlpha:0});
              TweenMax.to(panel2.content_home, .5, {alpha:0});
    panel2 traces null and all the clips loaded within pull up undefined property errors.
    Can somebody please tell me what I'm doing wrong? I'd be stoked to know what I'm missing and feel like this should be a piece of cake.
    Thanks for any help!

    You are not adding the content to the stage at 0,0, you are adding it to panel2 at 0,0.  THen you take panel2 and assign it to be something that likely doesn't exist by the time you assign it.  You need to wait until the loader completes loading before you attempt to do anything with its content, otherwise it has no content (null).  Similarly, you cannot control anything in the loaded swf until it has finished loading.  So assign an event listener to the contentLoaderInfo property of the Loader to determine when loading is complete, and have the event handler function deal with starting the interaction with it.
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("SWCS_S3_500x250_exp_panel_2.swf");
    myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, processLoadedSWF);
    myLoader.load(url);
    function processLoadedSWF(evt:Event):void {
        // deal with the loaded swf here
        // but you don't want to be assigning it to the panel2 object that contains the loader
    As far as controlling anything inside the swf you load, is it an AS1/2 or an AS3 swf?

  • Loading external swf, how to deal with errors within the loaded swf?

    I have a Flex app that basically lets you browse a bunch of thumbnails that represent swf files, when you click a thumbnail it opens a window that loads the actual swf into an image control. The problem I have is that these swfs can be uploaded by our clients, so they may have actionscript errors being thrown, etc. We can't really predict what they may do. Is there a way I can load these swf in such a way as to ignore any errors that the loaded swf may generate within itself.
    For example, one such swf reads some text from a text file to display, but when they are viewing it in this manner the file isn't there so a stream error is generated. My parent Flex app doesn't care about this error and I don't want to see it thrown up in an actionscript error box (I have debug verison loaded on my PC obviously) or interfere with the parent app in any way.
    Would application domains help at all? Would it make a difference if I loaded the swf into a separate domain? Or is there some way I can generically trap any error coming from the loaded swf and just ignore them?
    Any help appreciated.
    Thanks,
    Marcus

    There is no way to catch errors thrown at random times.  Remember that most folks have the release player which does not show error dialogs.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How to access properties of swf created with pdf2swf

    Hi all-
    I am new to flex, I have been using pdf2swf to convert
    multi-page pdfs to swf files and then load them in adobe flex. I am
    able to load the files correctly with SWFLoader but not access the
    properties to advance the frames (play, stop). I have been scouring
    the internet for a way to do this that I understand.
    I have tried doing something like:
    var mymovie:MovieClip = MovieClip(myloader.content);
    and then using
    mymovie.play();
    which I can't seem to get to work.
    Has anyone here done this successfully. If so, could you give
    me an example of how this is done?
    Thanks,
    Cameron Bracken

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    Flex 3 - Embedding asset types:
    You can embed Button and MovieClip symbols in a Flex
    application, but you cannot embed ... Alternatively, if you use the
    SWFLoader control to load the Flex
    Link:
    http://livedocs.adobe.com/flex/3/html/embed_4.html
    BrideL.OrG Blog Archive Importing a SWF into Flex with AS3:
    Jul 4, 2006 ... Just to say thanks for posting the SWFLoader
    example, the ONLY one on the ... controlling frames using the
    movieclip details via SWFLoader.
    Link:
    http://www.bridel.org/?p=9
    All Classes (Flex 3):
    mx.skins.halo, The skin for the border of a SWFLoader or
    Image component when ..... mx.core, FlexMovieClip is a subclass of
    the Player's MovieClip class.
    Link:
    http://livedocs.adobe.com/flex/3/langref/class-summary.html
    Cannot load the SWFLoader content in a movieclip - Flex
    India:
    May 17, 2007 ... implementation of movieClip class in as2 is
    different from as3. ... Im just trying to load a .swf in flex. Im
    using SWFLoader
    Link:
    http://groups.google.com/group/flex_india/msg/85ec872c7d94851a
    S (Flex 3):
    SWFLoader. A flag that indicates whether to scale the content
    to fit the ..... for the content in the browser, such as
    'www.adobe.com' or 'www.example.org'.
    Link:
    http://livedocs.adobe.com/flex/3/langref/all-index-S.html
    SWFLoader gotoAndStop [Archive] - ActionScript.org Forums:
    Jun 27, 2006 ... [Archive] SWFLoader gotoAndStop Flex 2 &
    3. ... Is there any way that it is possible to cast the movieclip
    to flash 9 movieclip?
    Link:
    http://www.actionscript.org/forums/archive/index.php3/t-109586.html
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

  • How to access the URL on page load and open it in the new tab of browser

    Hi All,
    I am using Jdeveloper 11.1.1.5 and i have one page "Hello.jspx" and one data control consist of two attributes :-one is "id" and other is "url".
    The datacontrol has been created from the WebService.
    Now my requirement is : -
    whenever i run the page "Hello.jspx" , then on page load the url attribute should get accessed and should be opened in a new window or tab of the browser.As the url contains the information about the document.
    Hello.jspx page doesn't contain any bindings of the url attribute.
    I had thought of using the PhaseListener class and use the onPageLoad method .But how do i get the url from the dataControl and open it in the other tab of the browser on page load.
    Please suggest!!!!
    Thanks.

    Hi,
    I don't think this can be done this way. I would think that you need to execute JavaScript upon Hello.jspx load to open a new window and pass the URL to it
    Frank

  • How to access Properties in Custom Crawler

    [Plumtree 5.0.2 / .NET]
    Hi,
    Where in the source code for the NT File Crawler does the accessor (in this case the html accessor) pick up the metadata from the document and input the values into the Plumtree Cards?
    To explain - we are developing a custom crawler that will crawl html formatted files containing metadata about the documents to be indexed, and not crawling the original documents themselves. (I can explain the reasons for this in more detail if relevant)
    One of the values included in this metadata is the location of the original file which I need the crawler to make the ClickThroughURL.
    Rather than parsing the html document myself, I figured the HTML Accessor is already doing the job for me. The field is mapped as a property in the document type for this crawler and I just need to work out how to to access that to replace:
    data.ClickThroughURL = CurrentFile.FullName;
    with:
    data.ClickThroughURL = MY_VALUE_FROM_PROPERTIES;
    I'm struggling a bit through lack of doco but I thought if I could find the section of the code where the crawler sets the properties for each document I'd be able to see how I can access the collection - I'd thought it would be in IDocument.GetMetaData, but I can't spot it.
    I hope this makes sense to someone out there....
    thanksAni

    Hi Clinton,
    I checked PTSpy and it appears to be looking at the right URL, but receiving a 404. PTSpy records the following, (I've changed the server name but it was correct):
    Entering Function CPTUserCookieDatabase::AddHeadersToCookies: parameters: lpctstrDomain = APP_SERVER_WHERE_CRAWLER_LOCATED.hosting.companyname.net; lpctstrObject = /ANITA/DJCustomCrawlerWS/XUIService.asmx; lpctstrHeaders = HTTP/1.1 404 Not FoundServer: Microsoft-IIS/5.0Date: Wed, 02 Mar 2005 03:12:54 GMTX-Powered-By: ASP.NETX-AspNet-Version: 1.1.4322Cache-Control: privateContent-Type: text/html; charset=utf-8Content-Length: 1530; lCookieSegment = -1;
    I wondered if it's trying to look for "/ANITA/DJCustomCrawlerWS/XUIService.asmx" in the portal server or whether it's looking in the lpctstrDomain where the file actually exists. Would you expect to see a fully qualified URL for lpctstrObject? Either way, as I said there is no 404s recorded in the IIS logs on either servers.
    ==================================
    Back to the question of getting a customized property value from the Crawler. Can you explain a little more about "CrawlerConstants.TAG_PROPERTIES" and what I'm looking for please? I can see that this is getting its value from the web.config key "UseRemoteProperties" which in my instance had the value of "0" i.e. USE_LOCAL.
    The custom property I want to get the value of is called "FileLocation" and when i go to the knowledge directory and check the properties page of the documents I'm crawling the value is right there in the "Customized Properties" exactly as expected whether I've got "UseRemoteProperties" set to 0 or 1 (and it's refreshed any time I change it and re-run the crawl).
    In Document.cs (GetMetaData()) the DocumentMetaData() object is instantiated and the method Put() is used to populate some of the document's property values, and there is the comment that they are overwritten by the accessor depending on the "proper setting in the web.config file" which is the CrawlerConstants.TAG_PROPERTIES that you spoke of.
    So where does the accessor do this? Somewhere, something (the accessor presumably) is writing all the other custom properties to the card. I've tried to use the Get() method for DocumentMetaData:
    data.Get("FileLocation");
    to retrieve the value for the one I'm after but when I write this out to the log it's always blank, the value hasn't been set yet. Where and how can I retrieve this value to update the clickThroughURL with it?
    Thank you again. Please shout if I haven't explained this very well, I'm wondering whether my lack of understanding is making it hard for me to phrase my questions, but I'm getting desperate, I've spent far to much time and money on this.
    Ani

  • How to access properties from portallapp.xml in jsp file

    <b>portalapp.xml</b>
    <property name="SupportUrl" value="http://sapdp1ci.zrh.swissre.com:53000/irj/portal?navigationtarget=navurl://8f7e974723098424468c8ae903228c0e">
              <property name="personalization" value="dialog"/>
              <property name="plainDescription" value="Support Desk Link URL"/>
              <property name="category" value="Navigation"/>
            </property>
    <b>jsp code</b>
    private String getSupportUrl(IPortalComponentRequest request)
         IPortalComponentContext myContext = request.getComponentContext();
         IPortalComponentProfile profile = myContext.getProfile();
         String supportDeskLocation = profile.getProperty("SupportUrl");
         //String supportDeskLocation = (String)request.getNode().getValue(SUPPORT_URL);
         return supportDeskLocation;
    but supportDeskLocation is coming as null.
    Please help me in solving the issue.
    Points will be awarded
    thanks
    bala

    Hi Michal,
    How are you?
    I´m trying to access a property from portalapp.xml and I have in the right place according to your post and here is my code to retrieve it:
    String value = (String)request.getNode().getValue("MyLogoffUrl");
    Did you activated something or did something else so your property could be reached by the JSP?
    It is just returning null in my case.
    Thanx in Advanced!
    Kind Regards,
    Gerardo j

  • Accessing parent variables in externally loaded swf - Help please

    I thought I knew how to do this, but maybe someone might be able to see why this is not working...
    here's what I have (simplified to only show necessary code):
    Main Timeline:
    var currentItem:String = 'applesauce';
    (then some code to load an external swf)
    External swf main timeline:
    trace(currentItem);
    it returns "undefiend"
    i have tried
    trace(MovieClip(root).currentItem);
    trace(MovieClip(this.parent).currentItem);
    each time undefined, any ideas?

    movieClip(parent.parent)
    supposedly ... didn't work for me ... but it was explained the 1st parent reference is the loader .. the second the maintimeline ..
    if your loading it into a MC .. add an additional parent ref ..

  • Accessing properties of some other iView through PAR

    Hello Everybody!
    Can anybody tell me how to access properties of other iViews in my PAR code?
    Suppose i have created a PAR file and i want to access some properties of an iView which are made out of some other PAR or may be out of the box. I want to use the other iViews properties in my current new iView. may be i will have to give the PCD Id of the iView and the property name which i want to access..
    Can this be done? if yes then how?
    Urgent help will he appreciated
    Regards
    Gaurav

    Hi Prakash,
    I had tried to change the property by using
    iprofile.setAttributeValue("TCode","VA01");
    iprofile.store();
    but it is not getting reflected in the iview,the iview is running the same TCode described during its creation.
    any other things to be made.
    my requirment is not to change for ever the property .change has to reflect only to the particular user for his session.
    thanks,
    -Krishna

  • Getting properties from loaded swf

    hi there,
    I am loading different swfs into my loader object "loader"
    and I also have a description of each swf below it ("desc"
    "desc_back").. Each swf is different in size and i want to move/
    scale "desc" and "desc_back" it to fit. This seems to be kind of
    working but it changes to fit the loaded swf before the one I want
    it to. it is if it is taking the properties of the last loaded swf
    instead of the one just loaded...I have tryed using an onload
    listener amoung a number of things. my action script is not very
    strong so it could be something simple.
    thanks :)

    you must wait until loading is complete before trying to
    access the _width and _height of the about-to-be-loaded swf. ie,
    use preloader code or the onLoadInit() method of the
    moviecliploader class.

  • How can I access global variables in a loaded Applescript?

    How can I access global variables in a loaded script, in Xcode, ApplescriptObjC? Basically, I have a global variable defined in my parent script using "property", and I need to modify objects connected to those variables inside of a loaded script.
    Example:
    Parent script:
    script AppDelegate
    property myTextField : missing value
    //linked to a text field object
    tell myScript to myAwesomeHandler_()
    end script
    Loaded script:
    on myAwesomeHandler_()
    myTextField's setStringValue_("The new Xcode is so glitchy ugh")
    //changes value of linked text field of parent script
    end myAwesomeHandler_
    The problem is, the variable is undefined in the Loaded script, and I need it to have the same value as the parent script, and I don't want to pass the variable through the Handler. Any ideas?

    I think want you are looking to do will need to be done in two steps. Because myTextField needs to be a property for the ObjectiveC part of the code you cannot turn it into a global.
    However if you make a temporary variable global assign the string to it in the handler then set myTextField off of it.
    global myTextFieldGlobal
    script AppDelegate 
    property myTextField : missing value 
    //linked to a text field object 
    tell myScript to myAwesomeHandler_() 
    myTextField's setStringValue_(myTextFieldGlobal)
    end script 
    on myAwesomeHandler_() 
    set myTextFieldGlobal to "The new Xcode is so glitchy ugh"
    //changes value of linked text field of parent script 
    end myAwesomeHandler_ 
    I know you stated you did not want the handler to return a value but I have to ask why? Global's, imo, are not a good idea and really should be used as a last resort.
    One other possibility is to pass a reference to the property to the handler. Not sure if that works in AS of if that would satisfy our requirement of not passing the variable through the handler
    <edit>
    Another though have you tried to define the property outside the script?  That is
    property myTextField : missing value
    script AppDelegate
    Not sure if that will work.
    You might also want to have a look at Scope of Properties and Variables Declared in a Script Object

Maybe you are looking for