Skip navigation
Currently Being Moderated

SwfPanel Not Loading from SWC

Jul 8, 2011 8:41 AM

I'm working in Flash CS5, with FlashDevelop as my external text editor. Everything is AS3.

 

I have a custom component I've created that has HTML text content.

 

I created a small Flex 3.5 application as a SWFPanel Custom UI for this. Nothing fancy - really just a RichTextEditor wired up to the component's HtmlText property.

 

I set the Custom UI in the ComponentDefinition, choosing external.

 

Everything works great - I can edit my text from the components panel, all as expected. Some tracing code that I put in the Custom UI shows up in my Flash logs, and the output panel, as expected.

 

I compile my component as an SWC, then export it, then import the SWC into a new movie. The component works as expected but my Custom UI doesn't load (this is all on the same machine, so the path should not have changed). In the component inspector I just get an empty white panel and the tracing code no longer appears.

 

I go back, and change from having the Custom UI as an external SWF to embedding it. Now the UI doesn't load, even in my original test movie, and it still doesn't work when exported as an SWC.

 

If I unpack the SWC, incidentally, I can see that all the Custom UI code is embedded there, as it should be.

 

In the Flash Log for the main movie, I get no errors at all at any time. In the movie where I've imported the SWF, I occasionally get the following, but not necessarily when selecting the component in question:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at StageCore::StageObject/UpdateSelection()
    at StagePlayer$/InvalidateStage()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at flash.external::ExternalInterface$/_callIn()
    at Function/<anonymous>()


TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at StageCore::StageObject/GetRealObject()
    at StageCore::StageObject/ClearStage()
    at StageCore::MainStage/ClearTree()
    at StagePlayer$/RemoveView()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at flash.external::ExternalInterface$/_callIn()
    at Function/<anonymous>()

 

 


Has anyone experienced this problem? Any idea what it might be? Is the fact that the SwfPanel is a flex app problematic? If so, why does it work in the test movie but not when exported?

 

Any help would be appreciated. I'm really in a hurry on this so I'm cross-posting to the extensions and AS3 fora in the hope that someone might have an answer. I think I've read all the CS3 component tutorials out there but nothing seems to cover this problem except some old stuff about AS3 being problematic in SwfPanels. Not sure if this is still current though.

 

Thanks in advance, as always, for any assistance.

 

Jude

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points