PDA

View Full Version : image / flash



benslayton
05-25-2006, 10:24 PM
http://www.dynamicdrive.com/dynamicindex4/image3.htm

How do I use flash instead of a picture?
I have tried:

<html>
<head>
<!--drag engine code installed here-->
</head>
<body>
<embed src="test.swf" class="drag"><br>
<embed src="test2.swf" class="drag"><br>
<h1><b>"Hi there</b></h1>
</body>
</html>

Instead of:

<html>
<head>
<!--drag engine code installed here-->
</head>
<body>
<img src="test.gif" class="drag"><br>
<img src="test2.gif" class="drag"><br>
<h1><b>"Hi there</b></h1>
</body>
</html>

jscheuer1
05-25-2006, 10:55 PM
I think you would at least need to use the standard object/embed tag used for all flash on the web. MS has just recently made things a bit more complicated because they have this new wrinkle where you need to click on active objects to use their controls. This may or may not apply if it is a simple flash image. If it does apply to your flash files, there are workarounds.

benslayton
05-25-2006, 11:08 PM
Ok So where would this:


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="2500" height="2000">
<param name="movie" value="http://uploadfile.putfile.com/videos/14417541158.swf">
<param name="quality" value="high">
<embed src="http://uploadfile.putfile.com/videos/14417541158.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="2500" height="2000"></embed>
</object>

Go into this:


<img src="test.gif" class="drag"><br>
<img src="test2.gif" class="drag"><br>

:cool: ;) :)

benslayton
05-25-2006, 11:12 PM
I tried this but it didn't work:


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="2500" height="2000">
<param name="movie" value="http://uploadfile.putfile.com/videos/14417541158.swf" class="drag">
<param name="quality" value="high">
<embed src="http://uploadfile.putfile.com/videos/14417541158.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="2500" height="2000" class="drag"></embed>
</object>

you can view the page here (http://www.bellsouthpwp2.net/b/e/benslayton124/drag.htm)

benslayton
05-25-2006, 11:24 PM
jscheuer1 What happend? Anybody... Whay are the fourms so slow today?

jscheuer1
05-26-2006, 03:28 AM
Slow forums happen. Servers and routers are just machines. Anyways, you would have to apply the class name directly to the object tag, not to a param, and for it to work in other browsers, you would also have to apply the class name to the embed tag. However, be smart, look over the details on the demo page, this 'drag' class may only work with certain tags, if so (and even if not) you might be better off putting the object/embed inside, say - a division, with the class of 'drag'. Pay attention as well, often with drag scripts you need to assign position:absolute; or relative; - check the documentation. See also Walter Zorn's dragable objects (http://www.walterzorn.com/dragdrop/dragdrop_e.htm).

benslayton
05-26-2006, 03:45 AM
Thanks man, I have found a new way. Is what I did what google stuff for a while and finnaly found a tutorial. It is a flash tutorial that you would link the pictures to and they would be draggable. Well instead of linking it to a picture, I linked it to a flash file. Which is the one that I want to drag.

Here is the link if you want to see it...
http://www.bellsouthpwp2.net/b/e/benslayton124/drag.htm

But there is one other thing I need to do. How do I fix it where when you go to the page it pops up at a specific location. I have modified some of it but not sure how to do the rest here is the code from flash:


_root.createEmptyMovieClip("container",1);
container.loadMovie("http://uploadfile.putfile.com/videos/14417541158.swf");
container._x = container._y =-1000 ;

_root.onMouseDown = function () {
startDrag ("container",false) ;
}
_root.onMouseUp = function () {
stopDrag () ;
}

the number in red is what I modified. I thought that If I modified the contianer._x= that it would work. But when I modify the y one. it moves the flash down and to the right...

I have no clue if anybody here knows that much flash. But Please leave sugg.

Thanks

oh and here is the actual page it is going on http://www.bellsouthpwp2.net/b/e/benslayton124/getdir.htm

jscheuer1
05-26-2006, 04:11 AM
I'm not real sharp on flash but know that it is similar to javascript. This line:


container._x = container._y =-1000 ;

In almost any programming language means that the x and the y either equal -1000 or that they equal their current values minus 1000 or that they equal the current y value minus 1000. If you break it up:


container._x = 100;
container._y =-1000 ;

or:


container._x =+100;
container._y =-1000 ;

and play around with the values, you will get a better idea of just what is going on. Generally x is either width or left/right position and y is either height or top/bottom position. This is only because they are set that way elsewhere in the code or are available as global values in that language but, it is the common usage for those letters because of the ubiquitous x/y coordinate system we all learned in high school.

Still, this portion of your code may be for setting the starting point or for setting positions once things start moving. It would be best to know which you are dealing with, as well as which you want to influence, before expecting any particular sort of result. Experimentation will usually tell you what you are dealing with.

benslayton
05-26-2006, 04:16 AM
Ok, I tried your tip earlier. But just in case, I tried it agian. If you have ever used flash, If there is something wrong, when you save it, it shows a error box. It say that container._x =+100; is wrong. The only way I can get the box to not show up is to leave it w/out anything like: container._x =+;

If you don't know I dont know who will.

jscheuer1
05-26-2006, 05:28 AM
Someone with more grounding in flash but, what I would do is experiment with those values and syntaxes that do not cause an error and observe the various results they produce. And/or read up on the topic.

shachi
05-26-2006, 06:49 AM
I think that the dom-drag script uses id and something called Drag.init("id") to drag stuffs around. So I would suggest you to give an ID to your swf object.:)