This is a migrated thread and some comments may be shown as answers.

Embedding Flash Movies

7 Answers 280 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Radu Mitache
Top achievements
Rank 1
Radu Mitache asked on 27 Apr 2008, 10:37 PM
Currently in the RadEditor, if you use the FlashManager and insert a Flash object, you can see it in the UI as an actual Flash movie and you are able to resize it, etc.

But if I take the script that was generated, something like this:


<embed pluginspage=http://www.macromedia.com/go/getflashplayer align=baseline src="/Resources/2.swf" width=150 height=150 type=application/x-shockwave-flash loop="false" menu="false" quality="high" salign="LT" bgcolor="">

and I copy paste this script, then the RadEditor does not consider it an object and it remains in text format.

I basically need to be able to create my own Custom Dialog that inserts Flash Movies with additional parameters and I wish the FlashMovie to be inserted and treated as an actual movie object, instead of just inserting some text.

Any suggestions are most welcome.

7 Answers, 1 is accepted

Sort by
0
Radu Mitache
Top achievements
Rank 1
answered on 28 Apr 2008, 07:38 PM
No ideas/info ?

I am basically using a 3rd party Flash Chart component and I need to know whether it is possible to insert it into the Editor just like you would with a normal Flash movie.

The difference is that this Chart requires either :
a) Parameters
b) Javascript to initialize it

So far I have tried with both but nothing happens.
0
genesplitter
Top achievements
Rank 2
answered on 28 Apr 2008, 08:10 PM
I have done something similar. Here is what I did:

1)  set allowscripts="true" in your RadEditor

2) Create a function in code-behind to build your script html. In my case I enclose the movie player in SWFObject javascript (SWFObject works great).


    protected string BuildFlashPlayer()
    {
        string s;


        s = "<script type='text/javascript' src='" + Utility.GetNonSSLRoot() + "/mediaplayer/swfobject.js'></script>";
        s += "<div id='player' style='padding-bottom:25px'><img src='" + Utility.GetNonSSLRoot() + "/images/flash_logo.png' /></div>";

        s += "<script type='text/javascript'>";
        s += "var so = new SWFObject('" + Utility.GetNonSSLRoot() + "/mediaplayer/mediaplayer.swf','mpl','580','260','8');";
        s += "so.addParam('allowscriptaccess','always');";
        s += "so.addParam('allowfullscreen','true');";
        s += "so.addParam ('wmode','opaque');";
        s += "so.addVariable('width','580');";
        s += "so.addVariable('height','260');";
        s += "so.addVariable('file','" + Utility.GetNonSSLRoot() + "/playlist.aspx?UserID=" + Utility.GetCurrentDomainName() + "');";
        s += "so.addVariable('autoscroll','true');";
        s += "so.addVariable('displaywidth','300');";
        s += "so.addVariable('thumbsinplaylist','true');";

        s += "so.write('player');";
        s += "</script>";

        return s;
    }

3) Add an entry in the RadEditor snippets custom dialog

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadEditor1.Snippets.Add("<img src='../images/FlashManager.gif' /> Enhanced Flash Player", BuildFlashPlayer());
        }
    }


Voila, you can paste an custom Flash object into RadEditor, save the HTML, and display the HTML in your web app and play the movie.

Here is a working example where I do just that - http://demo.donaldlee.net
0
Radu Mitache
Top achievements
Rank 1
answered on 29 Apr 2008, 09:35 PM
Hi Donald,

I have tried your solution but it didn't work. Thanks for your post anyway.

My problem is NOT that I cannot insert the String with the Flash Movie script into the HTML area of the Editor. That I can do, but I also wish to see a preview of the flash object, just like it occurs when inserting flash objects from the FlashManager dialog.

So, once again what I am interested in is seeing the flash object rendered inside the editor after I insert the string for it.

Some feedback from someone in Telerik could prove to be very helpful, as it appears there is some special method which needs to be called in order to "read" and then to "render" the newly inserted string content.

0
Radu Mitache
Top achievements
Rank 1
answered on 29 Apr 2008, 10:12 PM
I have fixed the issue.
0
genesplitter
Top achievements
Rank 2
answered on 29 Apr 2008, 10:14 PM
Great work, what was the fix?
0
Radu Mitache
Top achievements
Rank 1
answered on 01 May 2008, 03:32 PM
It seems that the Editor didn't like <object> tags. So instead I just used <embed> and it works fine.
0
rajeev c
Top achievements
Rank 1
answered on 05 May 2010, 11:51 AM
I am using RadEdior 7.3.1 version for MCMS 2002 application.
I am facing one issue i.e. unable to insert the flash files using <object> tag but I am able to insert using <embed> tag.
Did you found any solution?

Thanks
Rajeev
Tags
Editor
Asked by
Radu Mitache
Top achievements
Rank 1
Answers by
Radu Mitache
Top achievements
Rank 1
genesplitter
Top achievements
Rank 2
rajeev c
Top achievements
Rank 1
Share this question
or