Answer to 2 questions

L

Lloyd Sheen

I am posting this to answer two question that I had posted earlier. I do
this since I think it is good practice for those who ask to confirm if
others suggestions fix their problem or if the poster fixed the problem
thereselves.

First is a problem with creating a "progress" type animation during the
playing of media files.

To accomplish this I did the following:

Create the element (I used a <td>) as follows:

<td id="DurationTDPos" style=" text-align:center;
background-image: url(Images/Progress.png);
background-position-x: -325px;
background-repeat: repeat-y ">

The png file is 325px wide to match the length of the td. It is originally
positioned -325px to make it non-visible using the background-position-x
attribute. As the media plays you calculate the % of the media played and
move the background image accordingly.

if (WMP.controls.currentPosition > 0)
{
currentPercent = (WMP.controls.currentPosition /
curItem.duration) * 100;
one = 325 - Math.floor(325 * (currentPercent/100));
two = '-' + one;
three = two + 'px';
currentPXString = three;
DurationTR.style.backgroundPositionX =currentPXString ;
}

The second problem was that when I was using a repeater I used the
ItemCreated rather than the ItemDataBound. What happened was the first time
it executed all looked fine on the page. A subsequent execution caused the
page to skip the page_load event and the button_click event such that the
data was not bound on the second execution and the ItemCreated was called
first with no e.Item.DataItem.

Changing the event fixed this problem.

Thanks
Lloyd Sheen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top