
Flash class supports
This is a simple UI application which uses a Flash control for movie playback.
// Sample Code for FlashSample.h #include <FUi.h> #include <FBase.h> #include <FGraphics.h> class FlashSample : public Osp::Ui::Controls::Form, public Osp::Ui::IFlashEventListener { public: FlashSample(void) :__pFlash(null){} virtual result OnInitializing(void); void ConstructFlash(Osp::Base::String& fileName, Osp::Base::String& fileUrl); public: virtual void OnFlashDataReceived(const Osp::Ui::Control& source, const Osp::Base::Collection::IList& paramList); virtual void OnFlashDataReturned(const Osp::Ui::Control& source, const Osp::Base::Collection::IList& paramList); virtual void OnFlashTextEntered(const Osp::Ui::Control& source, Osp::Ui::FlashTextInputMode inputMode, const Osp::Base::String& defaultText, int limitTextLength); virtual void OnFlashLayoutChanged(const Osp::Ui::Control& source, Osp::Ui::FlashLayoutStyle layoutStyle); private: Osp::Ui::Controls::Flash *__pFlash; }; // Sample Code for FlashSample.cpp #include "FlashSample.h" using namespace Osp::Base; using namespace Osp::Graphics; using namespace Osp::Ui; using namespace Osp::Ui::Controls; result FlashSample::OnInitializing(void) { result r = E_SUCCESS; String fileName(L"/Res/{Flash Contents File}"); // For Remote Streaming //String fileUrl(L"http://{Server URL}/{Flash Contents File}"); // Create a Flash Control __pFlash = new Flash(); return r; } void FlashSample::ConstructFlash(String& fileName, String& fileUrl) { Rectangle bounds = GetBounds(); if (!fileUrl.GetLength()) // Local Flash Contents __pFlash->Construct(bounds, FLASH_STYLE_PLAY_WITHOUT_FOCUS, fileName); else // The .SWF file, which embeds .FLV for streaming needs to be placed on the local path as well as the URL. __pFlash->Construct(bounds, FLASH_STYLE_PLAY_WITHOUT_FOCUS, fileName, fileUrl); __pFlash->AddFlashEventListener(*this); // Add a Flash to the Form AddControl(*__pFlash); // Display the Form Draw(); Show(); // Play a Flash __pFlash->Play(); } // Implement an IFlashEventListener void FlashSample::OnFlashDataReceived(const Osp::Ui::Control& source, const Osp::Base::Collection::IList& paramList) { // Todo: } void FlashSample::OnFlashDataReturned(const Osp::Ui::Control& source, const Osp::Base::Collection::IList& paramList) { // Todo: } void FlashSample::OnFlashTextEntered(const Osp::Ui::Control& source, Osp::Ui::FlashTextInputMode inputMode, const Osp::Base::String& defaultText, int limitTextLength) { // Todo: } void FlashSample::OnFlashLayoutChanged(const Osp::Ui::Control& source, Osp::Ui::FlashLayoutStyle layoutStyle) { // Todo: }
| Osp::Ui::Controls::Flash::Flash | ( | void | ) |
This is the default constructor for this class.
| virtual Osp::Ui::Controls::Flash::~Flash | ( | void | ) | [virtual] |
This is the destructor for this class.
| void Osp::Ui::Controls::Flash::AddFlashEventListener | ( | const Osp::Ui::IFlashEventListener & | listener | ) |
Adds a listener instance.
The added listener can listen to events on the given event dispatcher's context when they are fired.
| [in] | listener | The listener to add |
| result Osp::Ui::Controls::Flash::Construct | ( | const Osp::Graphics::Rectangle & | rect, | |
| FlashStyle | style, | |||
| const Osp::Base::String & | localFilePath, | |||
| const Osp::Base::String & | urlFilePath = L"" | |||
| ) |
Initializes an instance of Flash with the specified rectangular region, style, and file paths.
| [in] | rect | The (X,Y) coordinates of the top left of the created window The width and height of the window |
| [in] | style | The style of the flash object |
| [in] | localFilePath | The local file path into this flash object |
| [in] | urlFilePath | The url file path for remote streaming |
| E_SUCCESS | The method was successful. | |
| E_OUT_OF_MEMORY | Insufficient memory. | |
| E_INVALID_STATE | This instance has already been constructed. | |
| E_INVALID_ARG | A specified input parameter is invalid. | |
| E_NETWORK_FAILED | The network is unavailable. | |
| E_SYSTEM | A system error occurred. |
| result Osp::Ui::Controls::Flash::EnterText | ( | const Osp::Base::String & | text | ) |
Enters the text into an input text field.
| [in] | text | The text block to enter |
| E_SUCCESS | The method was successful. | |
| E_SYSTEM | A system error occurred. |
| virtual Osp::Graphics::Color Osp::Ui::Controls::Flash::GetBackgroundColor | ( | void | ) | const [virtual] |
| FlashQuality Osp::Ui::Controls::Flash::GetQuality | ( | void | ) | const |
Gets the quality of a flash animation.
| FlashRepeatMode Osp::Ui::Controls::Flash::GetRepeatMode | ( | void | ) | const |
Gets the repeat mode of a flash animation.
| FlashStatus Osp::Ui::Controls::Flash::GetStatus | ( | void | ) | const |
Gets the playing status of a flash animation.
| int Osp::Ui::Controls::Flash::GetVolume | ( | void | ) | const |
Gets the volume of the current instance of Flash.
0 to 99. | bool Osp::Ui::Controls::Flash::IsSoundEnabled | ( | void | ) | const |
Checks whether sound is enabled or not.
true, if sound is enabled false, otherwise | void Osp::Ui::Controls::Flash::Pause | ( | void | ) |
Pauses a flash animation.
| void Osp::Ui::Controls::Flash::Play | ( | void | ) |
| void Osp::Ui::Controls::Flash::RemoveFlashEventListener | ( | const Osp::Ui::IFlashEventListener & | listener | ) |
Removes a listener instance.
The removed listener cannot listen to events when they are fired.
| [in] | listener | The listener to remove |
| void Osp::Ui::Controls::Flash::Resume | ( | void | ) |
Resumes a flash animation.
| void Osp::Ui::Controls::Flash::SendDataEventToActionScript | ( | const Osp::Base::String & | actionScriptListener, | |
| const Osp::Base::Collection::IList & | dataValueList | |||
| ) |
Sends data to the action script when the action script receives the specified event from application.
| [in] | actionScriptListener | The name of the specified event |
| [in] | dataValueList | A list of data |
| void Osp::Ui::Controls::Flash::SendDataToActionScript | ( | const Osp::Base::String & | data | ) |
Sends data to the action script in a flash animation.
| [in] | data | The data to be sent to the action script |
| virtual void Osp::Ui::Controls::Flash::SetBackgroundColor | ( | const Osp::Graphics::Color & | color | ) | [virtual] |
| void Osp::Ui::Controls::Flash::SetQuality | ( | FlashQuality | quality | ) |
Sets the quality of a flash animation.
| [in] | quality | The quality of the flash animation |
| void Osp::Ui::Controls::Flash::SetRepeatMode | ( | FlashRepeatMode | repeatMode | ) |
Sets the repeat mode of a flash animation.
| [in] | repeatMode | The repeat mode of the flash animation |
| void Osp::Ui::Controls::Flash::SetSoundEnabled | ( | bool | enable | ) |
Sets whether to enable sound or not.
| [in] | enable | A bool value to decide whether to enable sound or not |
| result Osp::Ui::Controls::Flash::SetVolume | ( | int | volume | ) |
Sets the volume of the current instance of Flash. Range of volume is 0 to 99.
| [in] | volume | The new value of volume. |
| E_SUCCESS | The method was successful. | |
| E_OUT_OF_RANGE | The specified volume is out of range. | |
| E_INVALID_STATE | This method is invalid for the current state of this instance. |
| void Osp::Ui::Controls::Flash::Stop | ( | void | ) |
Stops a flash animation.